Skip to content

Fix lfe_init_SUITE ERL_LIBS to target the compiled lfe app - #522

Merged
rvirding merged 1 commit into
developfrom
bugfix/lfe-init-ct
Jul 11, 2026
Merged

rvirding merged 1 commit into
developfrom
bugfix/lfe-init-ct

Conversation

@oubiwann

@oubiwann oubiwann commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

Problem

lfe_init_SUITE fails locally under a bare rebar3 ct or a clean make tests, but is green in CI:

{undef,[{lfe_init,start,[],[]}, ...]}   %% kernel `user` child fails to start

Root cause

The suite spawns bin/lfe and sets 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. So bin/lfe could only find lfe_init via its fallback rebar3 path, which defaults to the default profile.

CI's builds job runs rebar3 compile (populating _build/default/lib/lfe/ebin) before make ct, so the wrong ERL_LIBS was silently rescued by the default-profile fallback. 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.

Fix

Derive ERL_LIBS from the running app: the parent of code:lib_dir('lfe') is the actual _build/<profile>/lib dir containing the compiled lfe app. This makes the suite independent of which rebar3 profile happens to be pre-built. bin/lfe is still located from the repo root as before.

This is a test-harness fix only — the lfe_init / OTP-28 user_drv work from #518 is fine; lfe -eval genuinely works. The test was just pointed at the wrong library directory.

Verification

  • rebar3 ct --suite test/lfe_init_SUITE → 4/4 pass
  • clean make tests → all 112 tests pass

🤖 Generated with Claude Code

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]>
@rvirding
rvirding merged commit 38150ec into develop Jul 11, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants