Skip to content

Fix strace-macos to work inside Nix devShells - #46

Merged
Mic92 merged 1 commit into
mainfrom
nix-packaging
Nov 25, 2025
Merged

Fix strace-macos to work inside Nix devShells#46
Mic92 merged 1 commit into
mainfrom
nix-packaging

Conversation

@Mic92

@Mic92 Mic92 commented Nov 25, 2025

Copy link
Copy Markdown
Owner

When inside a Nix devShell with default stdenv, /usr/bin/python3 resolves to Nix's Python which lacks LLDB bindings, causing strace to fail with "Failed to load LLDB Python module" error.

This occurs because Nix sets DEVELOPER_DIR to point to its SDK, making system tools like xcrun find Nix's Python instead of macOS system Python.

Solution: Use Command Line Tools Python directly at its fixed path (/Library/Developer/CommandLineTools/usr/bin/python3) which always has LLDB bindings and works reliably in any environment.

Fixes: #44

When inside a Nix devShell with default stdenv, /usr/bin/python3
resolves to Nix's Python which lacks LLDB bindings, causing strace
to fail with "Failed to load LLDB Python module" error.

This occurs because Nix sets DEVELOPER_DIR to point to its SDK,
making system tools like xcrun find Nix's Python instead of macOS
system Python.

Solution: Use Command Line Tools Python directly at its fixed path
(/Library/Developer/CommandLineTools/usr/bin/python3) which always
has LLDB bindings and works reliably in any environment.

Fixes: #44
@Mic92
Mic92 merged commit 9e6273e into main Nov 25, 2025
3 checks passed
@Mic92
Mic92 deleted the nix-packaging branch November 25, 2025 19:08
@iniw

iniw commented Nov 25, 2025

Copy link
Copy Markdown

Oh, the issue being an env var instead of xcode-select -p makes a lot more sense. I didn't know about $DEVELOPER_DIR.

By the way, unrelated to this project but related to the issue, this is something that has been annoying me for months: NixOS/nixpkgs#456879 do you know what kind of change I'd need to make to nixpkgs to make it propagate $DEVELOPER_DIR/usr/share/man properly inside of devshells?

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.

Doesn't work inside devShells with the default stdenv

2 participants