Split -mode embedded into separate argv elements - #236
Open
ryanwinchester wants to merge 1 commit into
Open
Conversation
erl does not split argv elements, so a single "-mode embedded" string is not recognized as a flag and the VM silently boots in interactive mode: init:get_argument(mode) returns error and code:get_mode() returns interactive. Modules are loaded lazily instead of preloaded, and embedded mode's fail-fast guarantee on missing modules is lost. Same class of bug fixed in burrito-elixir#225 for "-s elixir start_cli" and "-elixir ansi_enabled true"; -mode was missed. Verified in a wrapped app on macOS 26 arm64 (zig 0.16.0): before: code:get_mode() = interactive, init:get_argument(mode) = error after: code:get_mode() = embedded, init:get_argument(mode) = {ok,[["embedded"]]} Fixes burrito-elixir#233
-mode embedded into separate argv elements
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 #233.
erldoes not split argv elements, so passing"-mode embedded"as a single element meansinitnever recognizes the flag and the VM silently boots in interactive mode. #225 fixed exactly this class of bug for"-s elixir start_cli"and"-elixir ansi_enabled true", but-modewas missed.Dependency-free demonstration:
Verification
Probe app wrapped with this branch, run on macOS 26 arm64 (Zig 0.16.0), printing from
Application.start/2::code.get_mode():interactive:embedded:init.get_argument(:mode):error{:ok, [[~c"embedded"]]}Note: this branch is independent of #235 but touches an adjacent region of
erlang_launcher.zig; if both land there may be a trivial conflict to resolve.