Skip to content

fix(erlang): respect compile false for precompiled installs#9866

Merged
jdx merged 3 commits into
jdx:mainfrom
risu729:codex/fix-erlang-compile-false-precompiled
May 17, 2026
Merged

fix(erlang): respect compile false for precompiled installs#9866
jdx merged 3 commits into
jdx:mainfrom
risu729:codex/fix-erlang-compile-false-precompiled

Conversation

@risu729

@risu729 risu729 commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make core:erlang treat erlang.compile=false as strict precompiled mode instead of falling back to kerl
  • keep the existing fallback to kerl when erlang.compile is unset, and keep compile=true source-only
  • add an e2e regression for an unsupported distro (ImageOS=nobara-43) that asserts no build-install fallback happens

Investigation

Discussion #9433 shows Unsupported OS version: nobara-43, followed by kerl build-install. Python and Node already bail when compile=false cannot find a precompiled artifact. Ruby is different and currently documents fallback behavior for ruby.compile=false.

Validation

  • cargo fmt --check
  • git diff --check
  • shellcheck e2e/core/test_erlang_precompiled_strict
  • mise run build
  • mise run test:e2e e2e/core/test_erlang_precompiled_strict

Discussion: #9433

This PR description was generated by an AI coding assistant.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements stricter enforcement for Erlang precompiled binary usage. It introduces a precompiled_unavailable helper in src/plugins/core/erlang.rs that triggers a failure if erlang.compile is disabled and binaries cannot be found, rather than silently falling back. An E2E test was also added to validate this behavior on unsupported platforms. I have no feedback to provide.

@greptile-apps

greptile-apps Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR introduces a precompiled_unavailable helper in erlang.rs that centralises the "no precompiled binary found" logic: when erlang.compile=false it bails with a clear error instead of silently falling through to kerl build-install, while the default (None) preserves the existing kerl fallback. A new e2e test exercises this path on Linux using ImageOS=nobara-43 to assert that neither installation succeeds nor a kerl fallback occurs.

  • src/plugins/core/erlang.rs: All six former debug!+Ok(None) early-returns are replaced by self.precompiled_unavailable(…), which either bails (compile=false) or logs-debug+returns-None (compile=None). The #[cfg(not(any(linux, macos, windows)))] stub is updated to preserve the compile=true→kerl path while bailing for compile=false.
  • e2e/core/test_erlang_precompiled_strict: New test file with a Linux guard, an expected-failure if block, and two assertions on the captured output — one confirming the "unsupported OS version" message and one ruling out any build-install invocation.

Confidence Score: 5/5

The change is safe to merge; it only tightens an explicit opt-in (compile=false) while leaving the default kerl fallback untouched.

The core logic change is small and well-scoped: the new precompiled_unavailable helper is called only when a precompiled path would have silently returned None, so existing default behaviour is unchanged. All three platform branches (linux, macos, windows, and the catch-all) are updated consistently. The e2e test directly validates the new bail path with a real unsupported OS value and guards against regression to the kerl fallback.

No files require special attention.

Important Files Changed

Filename Overview
src/plugins/core/erlang.rs Adds precompiled_unavailable helper that bails when compile=false, replacing all silent debug!+Ok(None) fallbacks with the new centralised check. Logic is consistent across linux, macos, windows, and other-platform branches.
e2e/core/test_erlang_precompiled_strict Adds a regression test that exercises the strict-precompiled path on Linux using ImageOS=nobara-43; includes a Linux guard. Two existing open threads from prior review rounds cover set -e interaction and the platform guard (guard is now present).

Reviews (3): Last reviewed commit: "test(erlang): match shell test formattin..." | Re-trigger Greptile

Comment thread e2e/core/test_erlang_precompiled_strict Outdated
Comment thread e2e/core/test_erlang_precompiled_strict Outdated
@risu729 risu729 marked this pull request as ready for review May 16, 2026 08:04
@jdx jdx merged commit bda82b9 into jdx:main May 17, 2026
32 checks passed
@risu729 risu729 deleted the codex/fix-erlang-compile-false-precompiled branch May 17, 2026 15:30
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