feat: implement shell flavors and fix workspace-wide initialization#2259
Open
pranavpurankar wants to merge 1 commit intoconda:mainfrom
Open
feat: implement shell flavors and fix workspace-wide initialization#2259pranavpurankar wants to merge 1 commit intoconda:mainfrom
pranavpurankar wants to merge 1 commit intoconda:mainfrom
Conversation
2 tasks
Author
|
Hi @baszalmstra and @wolfv, I noticed #2119 is also touching the activation logic for performance. My PR (#2259) focuses on architecture for shell flavors (Dash/Busybox). I've been looking at the run_activation_fast_path logic in #2119. I want to ensure that the Rust base environment calculation remains 100% consistent with the POSIX specific flavors I'm introducing in #2259.
Potential problem: Vee1e's code (PR #2119) has a function called I just want ensure they play well together |
3661ea1 to
861178d
Compare
897218a to
870f6ba
Compare
870f6ba to
fc1e7c7
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.
Description
This PR implements support for additional POSIX-compliant shells (sh, dash, ksh, busybox) by implementing suggested "Flavor" architecture to the Bash shell struct. This fixes the limitation where these shells were not recognized during environment activation.
Key Improvements & Thought Process:
Arch Refactor: Following feedback in feat: added support for sh ShellEnum #2077, I converted Bash from a unit struct to a formal struct containing a BashFlavor enum. This allows for fine grained control over shell specific syntax if needed in the future while maintaining a clean, unified POSIX interface.
Avoiding Breakage and Ripple-effect: Unlike previous attempts, this PR provides the necessary stiching code for the entire Rattler workspace. I identified and updated all initialization points in the Python bindings (py-rattler), Linux menu integrations (rattler_menuinst), and link script logic to prevent compilation failures.
Fixes #1224 (support more shell type for ShellEnum)
How Has This Been Tested?
I performed a split execution test strategy using a specialized Ubuntu (24.04.4 LTS) container environment to ensure isolation:
Unit & Regression Testing: Ran the full rattler_shell test suite. All 27 core activation/deactivation tests passed, including new test cases for dash.
Cross-Language Verification: Verified the Rust-to-Python boundary by checking the py-rattler crate compilation.
Ensured the rattler_menuinst Linux integration correctly initializes the new Bash(Bash::default()) struct.
Snapshot Testing: Generated and verified new insta snapshots for dash deactivation to ensure the generated shell scripts are syntactically correct for POSIX compliance.
Lint Checking: Validated the workspace using
cargo clippy --all-targets -- -D warningsandcargo fmt --all.AI Disclosure
This PR contains AI-generated content.
I have tested any AI-generated content in my PR.
I take responsibility for any AI-generated content in my PR.
Purpose: Planning, Understanding code base, Stability, Optimization.
Tools: Antigravity IDE
Models: Claude Opus 4.6 (Thinking) and Gemini 3.1 Pro (Low)
Prompt: Assisted in structuring a verbose code and optimizing it. Also helped in writing comments, and mentored just like core maintainers whenever I stuck at something. Played crucial role in understanding the overall crate structure and it's dependencies this where I indentified the ripple-effect. Last but not least helped me writing PR description to meet project standards.
Checklist:
I have performed a self-review of my own code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
I have added sufficient tests to cover my changes.