Skip to content

Comments

makeBinaryWrapper: build static wrappers on static platforms#320138

Open
risicle wants to merge 2 commits intoNixOS:stagingfrom
risicle:ris-make-binary-wrapper-static
Open

makeBinaryWrapper: build static wrappers on static platforms#320138
risicle wants to merge 2 commits intoNixOS:stagingfrom
risicle:ris-make-binary-wrapper-static

Conversation

@risicle
Copy link
Contributor

@risicle risicle commented Jun 15, 2024

Description of changes

I'm not very big on static stdenv's so this may be naive, but it feels like we should be building static binary wrappers on static platforms.

Also fixed tests.makeBinaryWrapper to work on static platforms (though with sanitizers disabled)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@risicle risicle added the 6.topic: static Static builds (e.g. pkgsStatic) label Jun 15, 2024
@risicle risicle requested a review from Ericson2314 as a code owner June 15, 2024 21:10
@risicle risicle force-pushed the ris-make-binary-wrapper-static branch from 5f2c90d to 51c5dd4 Compare June 15, 2024 21:14
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin 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 Jun 15, 2024
@JohnRTitor
Copy link
Member

@NixOS/static

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 27, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 2, 2025
@Gerg-L
Copy link
Contributor

Gerg-L commented May 1, 2025

This supersedes #320138

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label May 1, 2025
@alyssais
Copy link
Member

This supersedes #320138

Comment on wrong PR?

@Gerg-L
Copy link
Contributor

Gerg-L commented May 17, 2025

Sorry, #390021 is the other pr with the same intent.

@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 13, 2025
Copy link
Contributor

@wolfgangwalther wolfgangwalther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment from #390021 (comment) still applies, I believe. We should not try to replicate the same as the static adapter, but just use the NIX_CFLAGS... variables that are already set.

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 19, 2025
@wolfgangwalther
Copy link
Contributor

We should not try to replicate the same as the static adapter, but just use the NIX_CFLAGS... variables that are already set.

These NIX_CFLAGS_... are unset on purpose for makeBinaryWrapper ever since #164163.

I see roughly the following options:

  • Do something similar to this PR, i.e. recreate the same logic as in the static adapater in makeBinaryWrapper. We'd need to handle darwin, too. Possibly other adapters need the same, now or in the future.
  • Remove the local NIX_CFLAGS_... override and try to filter its contents somehow, to only get supported flags. Don't even know how.
  • Remove the local NIX_CFLAGS_... override and try to always run makeBinaryWrapper with the CC provided by the derivation - and then only fallback to the cc that is currently used when its not otherwise available.

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

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: static Static builds (e.g. pkgsStatic) 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants