fix: reenable compile task before running queued tasks#367
Merged
zachdaniel merged 2 commits intoash-project:mainfrom Mar 15, 2026
Merged
Conversation
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 <noreply@anthropic.com>
Removed comments explaining the re-enabling of compile tasks.
Contributor
|
🚀 Thank you for your contribution! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Could not load <Module>, error: :nofileerrors whenmix igniter.installruns queued tasks (likeash.codegen) that depend on freshly generated source filescompile,app.config, andloadpathsMix tasks before each queued task inrun_next/1Problem
When installing multiple packages (e.g.
mix igniter.install ash ash_postgres ash_authentication ...), the pipeline:mix compileearly (before new source files exist).exfiles and queue anash.codegentaskash.codegencallsMix.Task.run("compile"), but this is a no-op becausecompilealready ran in step 1Code.ensure_compiled/1fails with:nofilefor newly generated modulesReproduction
Fails with:
Fix
Add
Mix.Task.reenable/1forcompile,app.config, andloadpathsbefore running each queued task, so downstream tasks that callMix.Task.run("compile")actually trigger a fresh compilation.Test plan
install_test.exs:34) is a pre-existing flake onmain, not caused by this change🤖 Generated with Claude Code