[Backport release-25.11] virtualisation/rosetta: Perserve ArgvZero to fix python virtualenv creation#465308
Merged
SuperSandro2000 merged 1 commit intorelease-25.11from Nov 28, 2025
Conversation
…eation Preserving ArgvZero is supported from MacOS 14 Sonoma forward, which is the current minimum supported version of nixpkgs. See https://developer.apple.com/documentation/virtualization/running-intel-binaries-in-linux-vms-with-rosetta#Mount-the-Shared-Directory-and-Register-Rosetta The necessity of this fix came up with python virtual environments, because python uses the path of the executable (argv zero) to determine if it should load a virtual environment or not. In the past this was overriden with NIX_PYTHONEXECUTABLE, NIX_PYTHONPATH and NIX_PYTHONPREFIX, but we stopped doing that for the python interpreter so it works more like a normal python interpreter in nix. Without those variables, in the rosetta emulated case, python was no longer able to determine where it was called from, and thus could not correctly activate virtual environments in that case. (cherry picked from commit f5eb10b)
13 tasks
SuperSandro2000
approved these changes
Nov 28, 2025
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.
Bot-based backport to
release-25.11, triggered by a label in #463106.Before merging, ensure that this backport is acceptable for the release.
Even as a non-committer, if you find that it is not acceptable, leave a comment.