Repository navigation
feat(env)!: scrub release variables from child processes - #170
Merged
Merged
Conversation
joshrotenberg
marked this pull request as ready for review
November 1, 2026 13:52
This was referenced Nov 1, 2026
joshrotenberg
added a commit
that referenced
this pull request
Nov 1, 2026
BREAKING CHANGE: Child processes launched inside an Elixir release, when RELEASE_ROOT is set, now scrub RELEASE_*, BINDIR, ROOTDIR, and release PATH entries by default, as introduced in #170. Set release_env: :inherit to opt out. Custom runners must honour {name, false} entries in opts[:env] by removing those variables from the inherited environment on every implemented execution callback.
joshrotenberg
added a commit
that referenced
this pull request
Nov 2, 2026
* fix(env): route release_env through IEx chat and resume Route release_env through config for chat and resume so later say calls retain the policy. Test inherited and scrubbed child variables and PATH. Document false environment values in the runner typedoc and the CHANGELOG sentence for the release environment scrub. * fix(env)!: declare the release environment scrub from #170 as breaking BREAKING CHANGE: Child processes launched inside an Elixir release, when RELEASE_ROOT is set, now scrub RELEASE_*, BINDIR, ROOTDIR, and release PATH entries by default, as introduced in #170. Set release_env: :inherit to opt out. Custom runners must honour {name, false} entries in opts[:env] by removing those variables from the inherited environment on every implemented execution callback.
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.
Closes #156.
Changes
Commands launched from a Mix release inherited its boot variables and release runtime directories, causing a project's
elixirandmixto fail withcannot get bootfile. Child environments now scrub these values by default when the parent hasRELEASE_ROOTset.Config.release_env, defaulting to:scrub, and route:inheritthrough convenience calls as an explicit opt-out.ChildEnv.release_scrub/1andnormalize/3helpers. Remove inheritedRELEASE_*,BINDIR, andROOTDIR, and complete PATH entries matching the parent's BINDIR, either root's bin, or either root's directerts-<version>/bin.Acceptance
Validation
Before both pushes, ran the complete reproducible CI check matrix locally:
mix docs --warnings-as-errorspassedThe new fake-CLI suite has 18 tests covering 103 subprocess invocations. The real Forcola shim was available and exercised.
A real Mix release smoke test passed all eight combinations of runner (Port/Forcola), operation (execute/stream), and policy (scrub/inherit). With the default scrub, child
elixir -e 'IO.puts(:ok)'andmix --versionsucceeded from an unrelated directory, with all 15 host RELEASE_* variables, BINDIR, ROOTDIR, and release PATH entries absent. With :inherit, both commands reproduced the original boot-file failure.Four authenticated live Codex integration tests remain excluded by the repository's standard CI test command. Release publishing is a main-only side effect and was not run. No acceptance items remain incomplete.
GitHub CI passed all five jobs on
352ffb49527e1863d4da1aa8fb6109f08edaf742: both Elixir/OTP jobs, docs, and both pinned CLI contracts. Final CI run.