fix(export): sync successful exports when readonly args fail#1604
Merged
fix(export): sync successful exports when readonly args fail#1604
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | b07d3e8 | Commit Preview URL | May 08 2026, 09:12 AM |
82532df to
b07d3e8
Compare
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.
Motivation
exportto return nonzero for an operand and the interpreter to skip syncing all exported operands intoself.env, so otherwise-valid NAME=VALUE operands in the same command were not visible toprintenv/export -pdespite being set in shell variables.Description
crates/bashkit/src/interpreter/mod.rsto always perform export env sync forexportand to skip only operands that are readonly by checking the_READONLY_<NAME>marker instead of gating onresult.exit_code == 0.export_continues_after_readonly_error_and_exports_good_argsincrates/bashkit/tests/blackbox_security_tests.rsthat assertsexport LOCKED=skip GOOD=okexits1and thatGOODis visible viaprintenv.exportbuiltin implementation; this change only adjusts the interpreter-side env synchronization so Bash-compatible semantics are maintained.Testing
cargo test -p bashkit --test blackbox_security_tests finding_readonly_bypass::export_continues_after_readonly_error_and_exports_good_argsand the test passed (ok).self.envand visible toprintenv.Codex Task