MacOS compatible mktemp in cc-wrapper#258608
Merged
Artturin merged 1 commit intoNixOS:stagingfrom Oct 8, 2023
Merged
Conversation
Contributor
|
I think this is fine to do, even if it ultimately may be obsoleted by using tools from the store, at some point. Making these parts more portable is IMHO a good thing. |
Member
Author
|
Thanks @Mindavi. I've changed the base branch to staging. |
Mindavi
approved these changes
Oct 4, 2023
Contributor
Mindavi
left a comment
There was a problem hiding this comment.
Looks ok, but hopefully we can get some more eyes on this
Artturin
approved these changes
Oct 5, 2023
Member
|
Commit name is wrong though, should be |
malt3
approved these changes
Oct 5, 2023
Contributor
malt3
left a comment
There was a problem hiding this comment.
Was able to reproduce the issue in Bazel / rules_nixpkgs on macOS and this does fix it.
The commit 6f2b3ba introduced a `mktemp` invokation that uses the `--tmpdir` flag, which is not available on MacOS. This changes the invokation to a portable one based on the following StackOverflow answer https://stackoverflow.com/a/31397073/841562 .
5999867 to
13a4690
Compare
Member
Author
|
Thank you!
@Artturin I've fixed the commit name. |
|
Ohhhh, this one will resolve the issue I encountered a while ago... #254104 |
reckenrode
added a commit
to reckenrode/nixpkgs
that referenced
this pull request
May 31, 2024
This changes ld-wrapper to use a temporary file for the response file passed to ld instead of using process substitution. ld64 does not handle long command-lines when reading from the response file, which defeats the point of using a response file to handle long command-lines. cctools-port was patched to work around this, but nixpkgs is now using Apple’s source release directly instead of the port. Since it’s preferable not to patch Apple’s release heavily (to reduce the difficulty of updating to new versions and to match upstream’s behavior), use the approach that was adopted in cc-wrapper to work around issues with response files in newer versions of clang. Related PRs (cctools-port): - NixOS#213831 - tpoechtrager/cctools-port#132 Related PRs (cc-wrapper): - NixOS#245282 - NixOS#258608
reckenrode
added a commit
to reckenrode/nixpkgs
that referenced
this pull request
Jun 2, 2024
This changes ld-wrapper to use a temporary file for the response file passed to ld instead of using process substitution. ld64 does not handle long command-lines when reading from the response file, which defeats the point of using a response file to handle long command-lines. cctools-port was patched to work around this, but nixpkgs is now using Apple’s source release directly instead of the port. Since it’s preferable not to patch Apple’s release heavily (to reduce the difficulty of updating to new versions and to match upstream’s behavior), use the approach that was adopted in cc-wrapper to work around issues with response files in newer versions of clang. Related PRs (cctools-port): - NixOS#213831 - tpoechtrager/cctools-port#132 Related PRs (cc-wrapper): - NixOS#245282 - NixOS#258608
13 tasks
reckenrode
added a commit
to reckenrode/nixpkgs
that referenced
this pull request
Jul 13, 2024
This changes ld-wrapper to use a temporary file for the response file passed to ld instead of using process substitution. ld64 does not handle long command-lines when reading from the response file, which defeats the point of using a response file to handle long command-lines. cctools-port was patched to work around this, but nixpkgs is now using Apple’s source release directly instead of the port. Since it’s preferable not to patch Apple’s release heavily (to reduce the difficulty of updating to new versions and to match upstream’s behavior), use the approach that was adopted in cc-wrapper to work around issues with response files in newer versions of clang. Related PRs (cctools-port): - NixOS#213831 - tpoechtrager/cctools-port#132 Related PRs (cc-wrapper): - NixOS#245282 - NixOS#258608
reckenrode
added a commit
to reckenrode/nixpkgs
that referenced
this pull request
Jul 16, 2024
This changes ld-wrapper to use a temporary file for the response file passed to ld instead of using process substitution. ld64 does not handle long command-lines when reading from the response file, which defeats the point of using a response file to handle long command-lines. cctools-port was patched to work around this, but nixpkgs is now using Apple’s source release directly instead of the port. Since it’s preferable not to patch Apple’s release heavily (to reduce the difficulty of updating to new versions and to match upstream’s behavior), use the approach that was adopted in cc-wrapper to work around issues with response files in newer versions of clang. Related PRs (cctools-port): - NixOS#213831 - tpoechtrager/cctools-port#132 Related PRs (cc-wrapper): - NixOS#245282 - NixOS#258608
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 of changes
Closes #258607
The commit 6f2b3ba introduced a
mktempinvokation that uses the--tmpdirflag, which is not available on MacOS.This changes the invokation to a portable one based on the following StackOverflow answer https://stackoverflow.com/a/31397073/841562 .
Things done
I have tested the patch in isolation by patching the cc-wrapper at the use-site, see this commit.
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)