BugFix: Keep Elixir modules listed in ebin/PROJECT.app on erl-only rebuilds - #1053
Open
artman41 wants to merge 1 commit into
Open
BugFix: Keep Elixir modules listed in ebin/PROJECT.app on erl-only rebuilds#1053artman41 wants to merge 1 commit into
artman41 wants to merge 1 commit into
Conversation
…builds (ninenines#1052) MODULES was only recomputed from the Elixir compiler's output when at least one EX_FILE was itself out of date ($?). A build triggered solely by a changed .erl file or app.src skipped Elixir compilation entirely, silently dropping any Elixir-defined modules from the generated .app file's modules entry. This breaks releases running under `-mode embedded`, which requires every module to be pre-listed there and, unlike interactive `erl`, won't fall back to path-based lookup for anything missing. Since an .ex file's name doesn't necessarily match the module(s) it defines, the only reliable way to learn a module's real name is to compile it. Rather than doing that unconditionally on every rebuild, cache the resolved list to ERLANG_MK_TMP/ex_modules.log the moment there is a reason to compile (an EX_FILE is out of date, or the cache is missing, e.g. first build or after distclean). Any other rebuild reuses the cached list instead of recompiling every Elixir file again. Added | $(ERLANG_MK_TMP) as an order-only prerequisite so the directory exists before the cache file is written. Covered by a new core-elixir-keep-modules-on-erl-only-rebuild test, which also asserts (via a marker file and find -newer) that the Elixir module is not recompiled on the erl-only rebuild.
This was referenced Aug 17, 2026
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.
Fixes #1052
To be upfront: Claude noticed this while I was having it scaffold a project.
Claude identified and produced the fix but I've had it break the change into more simpler and clean code because having it as a one-liner was almost unreadable.
I've reviewed the code myself and both the code & test appear good.
Happy to rework the code if needed