From dd1d0a9778c9e7d3bafa8bca767b4d89b170d257 Mon Sep 17 00:00:00 2001 From: Albin Kocheril Chacko <8876252+albinkc@users.noreply.github.com> Date: Mon, 16 Mar 2026 00:14:18 +0530 Subject: [PATCH 1/2] fix: reenable compile task before running queued tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When igniter writes newly generated source files to disk and then runs queued tasks (like `ash.codegen`), those tasks call `Mix.Task.run("compile")` which is a no-op because compile already ran earlier in the igniter pipeline — before the new files existed. This causes `Code.ensure_compiled/1` to fail with `:nofile` for any modules that were generated during the install process. Fix by re-enabling compile, app.config, and loadpaths before each queued task so that downstream tasks can trigger a fresh compilation. Co-Authored-By: Claude Opus 4.6 --- lib/igniter.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/igniter.ex b/lib/igniter.ex index 25925d9..0f7c762 100644 --- a/lib/igniter.ex +++ b/lib/igniter.ex @@ -2132,6 +2132,14 @@ defmodule Igniter do defp run_next([{task_name, args} | rest]) do Mix.Task.reenable(task_name) + + # Re-enable compile and related tasks so that queued tasks which + # invoke `Mix.Task.run("compile")` (e.g. `ash.codegen`) actually + # trigger a fresh compilation of newly written source files. + # Without this, compile is a no-op because it already ran earlier + # in the igniter pipeline before the new files were written to disk. + Enum.each(["compile", "app.config", "loadpaths"], &Mix.Task.reenable/1) + Mix.Task.run(task_name, args) run_next(rest) rescue From 857ccd54cfab59e76cc8c1f46125fff8611c9c3c Mon Sep 17 00:00:00 2001 From: Albin Kocheril Chacko <8876252+albinkc@users.noreply.github.com> Date: Mon, 16 Mar 2026 00:57:16 +0530 Subject: [PATCH 2/2] Clean up comments in run_next function Removed comments explaining the re-enabling of compile tasks. --- lib/igniter.ex | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lib/igniter.ex b/lib/igniter.ex index 0f7c762..f0c46ee 100644 --- a/lib/igniter.ex +++ b/lib/igniter.ex @@ -2132,14 +2132,7 @@ defmodule Igniter do defp run_next([{task_name, args} | rest]) do Mix.Task.reenable(task_name) - - # Re-enable compile and related tasks so that queued tasks which - # invoke `Mix.Task.run("compile")` (e.g. `ash.codegen`) actually - # trigger a fresh compilation of newly written source files. - # Without this, compile is a no-op because it already ran earlier - # in the igniter pipeline before the new files were written to disk. Enum.each(["compile", "app.config", "loadpaths"], &Mix.Task.reenable/1) - Mix.Task.run(task_name, args) run_next(rest) rescue