Skip to content

gcc: rework, clean up, and document the cursed symlink hack#378569

Merged
K900 merged 2 commits intoNixOS:stagingfrom
K900:gcc-symlink-nonsense
Feb 7, 2025
Merged

gcc: rework, clean up, and document the cursed symlink hack#378569
K900 merged 2 commits intoNixOS:stagingfrom
K900:gcc-symlink-nonsense

Conversation

@K900
Copy link
Contributor

@K900 K900 commented Feb 1, 2025

Fixes dangling symlinks.

Also flips the direction of symlinks on cross
from $lib/$target/lib -> $lib/lib to $lib/lib -> $lib/$target/lib

Tested by building hello, pkgsCross.aarch64-multiplatform.hello, loadlibrary (as x86_64-multilib).

Fuck my life.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@K900 K900 force-pushed the gcc-symlink-nonsense branch from 0ee4ce6 to 6adb7eb Compare February 1, 2025 16:17
@github-actions github-actions bot added 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin 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: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Feb 1, 2025
@K900 K900 force-pushed the gcc-symlink-nonsense branch from 6adb7eb to 74d3b4b Compare February 2, 2025 06:49
K900 added 2 commits February 2, 2025 22:12
Fixes dangling symlinks.

Also flips the direction of symlinks on cross
from $lib/$target/lib -> $lib/lib to $lib/lib -> $lib/$target/lib
This reverts commit 3fd43d5.

The proper fix is now in.
@K900 K900 force-pushed the gcc-symlink-nonsense branch from 74d3b4b to 97a3367 Compare February 2, 2025 19:12
Copy link
Contributor

@tobim tobim left a comment

Choose a reason for hiding this comment

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

Built successfully up to grpc and pkgsStatic.grpc.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 4, 2025
@K900 K900 merged commit ceb3ac5 into NixOS:staging Feb 7, 2025
28 checks passed
@trofi
Copy link
Contributor

trofi commented Feb 8, 2025

Bisect says 97a3367 Revert "gcc: disable symlink checks on cross + nolibc for now" broke pkgsCross.mingw32.stdenv.cc.cc (a wine dependency) as:

$ nix build --no-link -f. pkgsCross.mingw32.stdenv.cc.cc -L
...
i686-w64-mingw32-nolibc-gcc> ERROR: noBrokenSymlinks: the symlink /nix/store/x4klpsmnjvn7dsqr5sa1vlicrblp2yzv-i686-w64-mingw32-nolibc-gcc-14-20241116-lib/i686-w64-mingw32/lib points to a missing target: /nix/store/x4klpsmnjvn7dsqr5sa1vlicrblp2yzv-i686-w64-mingw32-nolibc-gcc-14-20241116-lib/lib
i686-w64-mingw32-nolibc-gcc> ERROR: noBrokenSymlinks: found 1 dangling symlinks and 0 reflexive symlinks

@trofi
Copy link
Contributor

trofi commented Feb 8, 2025

Bisect says c1907fb gcc: rework, clean up, and document the cursed symlink hack broke libgccjit build on staging as:

$ nix build --no-link -f. -L libgccjit
...
@nix { "action": "setPhase", "phase": "installPhase" }
Creating compatibility symlink: lib -> /nix/store/9pi82l0ipx1mr5kcci8gcym5vf6pgv4y-libgccjit-14-20241116/lib32
Creating compatibility symlink: lib -> /nix/store/9pi82l0ipx1mr5kcci8gcym5vf6pgv4y-libgccjit-14-20241116/lib32
ln: failed to create symbolic link '/nix/store/9pi82l0ipx1mr5kcci8gcym5vf6pgv4y-libgccjit-14-20241116/lib32': File exists

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

Labels

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. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants