Repository navigation
Fix lfe_init_SUITE ERL_LIBS to target the compiled lfe app - #522
Merged
Merged
Conversation
The suite spawns bin/lfe and set ERL_LIBS to the repo root, which is
not a valid OTP library directory for the lfe app: the compiled beams
(including lfe_init.beam) live in _build/<profile>/lib/lfe/ebin, while
the root ebin/ holds only lfe.app. bin/lfe could therefore only find
lfe_init via its fallback rebar3 path, which defaults to the `default`
profile.
CI stayed green because the builds job runs `rebar3 compile` (populating
_build/default/lib/lfe/ebin) before `make ct`. A bare `rebar3 ct` -- or
`make tests`, which cleans _build and builds only the test profile --
never populates the default profile, so lfe_init was absent from the
resolved code path and the kernel user child failed with
{undef,[{lfe_init,start,[],[]}...]}.
Derive ERL_LIBS from the running app instead: the parent of
code:lib_dir('lfe') is the actual _build/<profile>/lib dir containing
the compiled lfe app, making the suite independent of which rebar3
profile happens to be pre-built. bin/lfe is still located from the repo
root as before.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
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.
Problem
lfe_init_SUITEfails locally under a barerebar3 ctor a cleanmake tests, but is green in CI:Root cause
The suite spawns
bin/lfeand setsERL_LIBSto the repo root, which is not a valid OTP library directory for thelfeapp. The compiled beams (includinglfe_init.beam) live in_build/<profile>/lib/lfe/ebin, while the rootebin/holds onlylfe.app. Sobin/lfecould only findlfe_initvia its fallback rebar3 path, which defaults to thedefaultprofile.CI's
buildsjob runsrebar3 compile(populating_build/default/lib/lfe/ebin) beforemake ct, so the wrongERL_LIBSwas silently rescued by the default-profile fallback. A barerebar3 ct— ormake tests, which cleans_buildand builds only the test profile — never populates the default profile, solfe_initwas absent from the resolved code path.Fix
Derive
ERL_LIBSfrom the running app: the parent ofcode:lib_dir('lfe')is the actual_build/<profile>/libdir containing the compiledlfeapp. This makes the suite independent of which rebar3 profile happens to be pre-built.bin/lfeis still located from the repo root as before.This is a test-harness fix only — the
lfe_init/ OTP-28user_drvwork from #518 is fine;lfe -evalgenuinely works. The test was just pointed at the wrong library directory.Verification
rebar3 ct --suite test/lfe_init_SUITE→ 4/4 passmake tests→ all 112 tests pass🤖 Generated with Claude Code