Stop Elixir's CLI consuming app arguments and halting the VM - #230
Open
joshrotenberg wants to merge 1 commit into
Open
Stop Elixir's CLI consuming app arguments and halting the VM#230joshrotenberg wants to merge 1 commit into
joshrotenberg wants to merge 1 commit into
Conversation
1.6.0 split "-s elixir start_cli" from a single argv element into three. erl
does not split argv elements, so the flag was never recognised before and
start_cli never ran. Now it does, and it does what it is supposed to: claims
--version and --help, treats the first remaining plain argument as a script
path, and halts the VM when it finishes.
Two consequences for wrapped applications:
$ probe hello world
No file named hello
$ probe --version
Elixir 1.20.2 (compiled with Erlang/OTP 29)
and, with no arguments at all, an application that never halts exits ~1.3s
after boot, which breaks servers and Phoenix applications.
Emit --no-halt and -- after -extra, and strip them back off in
Burrito.Util.Args. --no-halt restores the pre-1.6.0 lifetime, -- stops the CLI
claiming arguments, and start_cli still runs, so the boot behaviour the split
was made for is unaffected.
Fixes burrito-elixir#229
This was referenced Jul 27, 2026
Contributor
|
@doawoo This PR looks good to me. Could you please merge it and bump a new version ? |
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 #229.
1.6.0 split
"-s elixir start_cli"from a single argv element into three.erldoes not split argv elements, so the flag was never recognised before andstart_clinever ran. Now it does, and it does what it is supposed to: claims--versionand--help, treats the first remaining plain argument as a script path, and halts the VM when it finishes.Two consequences for wrapped applications:
and, with no arguments at all, an application that never halts exits about 1.3s after boot, which breaks servers and Phoenix applications.
Change
Emit
--no-haltand--after-extra, and strip them back off inBurrito.Util.Args.--no-haltrestores the pre-1.6.0 lifetime,--stops the CLI claiming arguments, andstart_clistill runs, so whatever the split in #225 was made for is unaffected.Reverting to the single joined element would also fix both, but only by making
start_clisilently not run again.Verification
A 12-line application whose only dependency is burrito, built on macOS 26 arm64 with Zig 0.16.0, and on Linux arm64 in a container.
Arguments, before and after:
Lifetime, no arguments, application never halts:
timeoutNot broken by the change:
System.halt(7)gives 7)maintenance directoryandmaintenance metaworkhead -3, on both platforms--still receives it, since only the exact leading--no-halt --pair is strippedAlso exercised against a real application: an MCP server that takes
--transportand--portand then runs indefinitely. On 1.6.0 it cannot start; with this change it parses its flags, completes a protocol handshake over stdio, serves a live tool call, and exits 0 when its client disconnects.One note for the docs:
System.argv/0is populated only oncestart_cliruns, which is afterApplication.start/2, so applications still needBurrito.Util.Args.