Skip to content

Stop preferring /opt/homebrew/bin/shadowenv#3957

Open
joshheinrichs-shopify wants to merge 1 commit intoShopify:mainfrom
joshheinrichs-shopify:no-homebrew
Open

Stop preferring /opt/homebrew/bin/shadowenv#3957
joshheinrichs-shopify wants to merge 1 commit intoShopify:mainfrom
joshheinrichs-shopify:no-homebrew

Conversation

@joshheinrichs-shopify
Copy link

We distribute shadowenv via Nix, but at least one person still has an old version installed on their machine via Homebrew. The version at the front of their $PATH and the one in Homebrew were far enough out of sync that they were incompatible. By just looking for shadowenv on $PATH we should be able to locate the correct version.

It looks like this was added to help with cases where $PATH is broken[1]. We could keep something as a fallback, but at least at Shopify, /opt/homebrew/bin isn't a good fallback anymore.

[1] b7dc6d2

We distribute shadowenv via Nix, but at least one person still has an
old version installed on their machine via Homebrew. The version at the
front of their $PATH and the one in Homebrew were far enough out of sync
that they were incompatible. By just looking for shadowenv on $PATH we
should be able to locate the correct version.

It looks like this was added to help with cases where $PATH is
broken[1]. We could keep something as a fallback, but at least at
Shopify, /opt/homebrew/bin isn't a good fallback anymore.

[1] b7dc6d2
@joshheinrichs-shopify joshheinrichs-shopify requested a review from a team as a code owner February 13, 2026 16:52
@vinistock
Copy link
Member

The main reason the fallback was added is because if you open VS Code from an icon (rather than from the terminal), it does not inherit the shell environment and then it cannot find executables like shadowenv.

This was already an issue with the Homebrew version. Several developers open the editor from the icon and then then /opt/homebrew/bin wasn't in their $PATH, causing the environment activation to crash.

How can this problem be addressed in the Nix approach without blocking developers from opening their editors through the icon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants