Skip to content

cc-wrapper: Resolve mktemp and rm path statically#271339

Closed
ghost wants to merge 3 commits intostagingfrom
unknown repository
Closed

cc-wrapper: Resolve mktemp and rm path statically#271339
ghost wants to merge 3 commits intostagingfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Dec 1, 2023

This commit converts cc-wrapper.sh into a .nix file consisting of
one large string.  This will allow future commits to hoist
conditionals out of bash code, into Nix code.  This allows to add or
remove conditional code from the cc-wrapper **without causing
rebuilds on platforms where the condition is false**.
@ghost ghost marked this pull request as ready for review December 1, 2023 01:53
@ghost ghost requested a review from Ericson2314 as a code owner December 1, 2023 01:53
@ghost ghost requested a review from malt3 December 1, 2023 01:55
Adam Joseph and others added 2 commits November 30, 2023 18:15
Without this, mktemp (and rm) from the host environment is picked up.
This may result in mktemp behaving differently (on darwin) or mktemp / rm not being found at all.

Adapted from:

  77c5993

Co-Authored-By: Malte Poll <1780588+malt3@users.noreply.github.com>
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Dec 1, 2023
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Dec 1, 2023
@ghost ghost closed this Jan 23, 2024
@ghost ghost deleted the pr/cc-wrapper/mktemp branch January 23, 2024 06:47
@aherrmann
Copy link
Copy Markdown
Member

Was this closed in favor of another PR or merged in another way? If not, may I ask why this was closed?

As I understand it this change would resolve the issue that #271159 aimed to resolve, see also #258607 (comment) for another relevant thread.

I recently encountered the same issue when running a Nix provided GHC in a restricted environment on MacOS. In that case mktemp was not found in the restricted environment. The Nix provided GHC invokes cc-wrapper as part of compilation, which then fails to execute mktemp.

cc @avdv

@katexochen
Copy link
Copy Markdown
Contributor

@aherrmann @malt3 I think the closing of this PR happened in in the light of NixOS/nixpkgs-committers#60 (comment).

Maybe you can cherry-pick and open a new PR or wait some days until things have calmed a little.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: stdenv Standard environment 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants