Skip to content

Fix for zsh-specific env loading behavior#2111

Open
derrickauyoung wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
derrickauyoung:bugfix/zsh-unable-to-load-rez-context-2058
Open

Fix for zsh-specific env loading behavior#2111
derrickauyoung wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
derrickauyoung:bugfix/zsh-unable-to-load-rez-context-2058

Conversation

@derrickauyoung
Copy link
Copy Markdown

@derrickauyoung derrickauyoung commented May 18, 2026

Original Issue

Fixed #2058

Root Cause

zsh runs .zshenv before .zshrc, so the export HOME=/real/home inside the generated .zshenv triggered before rez's .zshrc could be sourced, bypassing the context

Fix

ZDOTDIR is the correct zsh-native mechanism for redirecting dot file loading, and doesn't require touching HOME at all

  • Updated shells.py UnixShell class to implement default HOME environment var setting for the HOME env var hijack
  • Updated rezplugins/shells/zsh.py class to re-implement default methods to utilize ZDOTDIR instead

Thanks to @JeanChristopheMorinPerso and @ legomir for their initial diagnosis and background info on this problem.

@derrickauyoung derrickauyoung requested a review from a team as a code owner May 18, 2026 01:14
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 18, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: derrickauyoung / name: Derrick Auyoung (7dcb6ba)

@maxnbk maxnbk added the devdays26 ASWF Dev Days 2026 label May 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

❌ Patch coverage is 36.36364% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.64%. Comparing base (d415b96) to head (8a3b027).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/rez/shells.py 28.57% 5 Missing ⚠️
src/rezplugins/shell/zsh.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2111      +/-   ##
==========================================
- Coverage   60.65%   60.64%   -0.02%     
==========================================
  Files         164      164              
  Lines       20584    20592       +8     
  Branches     3579     3579              
==========================================
+ Hits        12485    12487       +2     
- Misses       7224     7229       +5     
- Partials      875      876       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Derrick Auyoung <derrick.auyoung@gmail.com>
@derrickauyoung derrickauyoung force-pushed the bugfix/zsh-unable-to-load-rez-context-2058 branch from 7dcb6ba to 78e5a62 Compare May 18, 2026 18:05
Signed-off-by: Derrick Auyoung <derrick.auyoung@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devdays26 ASWF Dev Days 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zsh unable to load rez context properly

2 participants