Skip to content

gcc: 2 symlink 2 hack#380325

Merged
K900 merged 4 commits intoNixOS:stagingfrom
K900:2-symlink-2-hack
Feb 19, 2025
Merged

gcc: 2 symlink 2 hack#380325
K900 merged 4 commits intoNixOS:stagingfrom
K900:2-symlink-2-hack

Conversation

@K900
Copy link
Contributor

@K900 K900 commented Feb 8, 2025

image

Tested nix build .#pkgsCross.mingw32.libarchive .#pkgsCross.aarch64-multiplatform.libarchive .#gccgo .#libgccjit .#loadlibrary.

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.

@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 8, 2025
@vcunat vcunat removed their request for review February 8, 2025 16:14
@vcunat
Copy link
Member

vcunat commented Feb 8, 2025

(I'm afraid I don't have capacity.)

Copy link
Contributor

@Mindavi Mindavi left a comment

Choose a reason for hiding this comment

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

This seems to make sense to me and is well explained in the comments.

@K900 K900 merged commit 065c3ed into NixOS:staging Feb 19, 2025
67 checks passed
SFrijters added a commit to SFrijters/nix-qemu-espressif that referenced this pull request Mar 11, 2025
This includes NixOS/nixpkgs#380325
and should fix the nix-qemu-esp32c3-rust-example.
@trofi
Copy link
Contributor

trofi commented Mar 14, 2025

Bisect says 5e2e98f gcc: document, clean up, undangle install symlink hacks broke claws-mail build in master as https://hydra.nixos.org/build/292052276:

/nix/store/kmfzghfpqmfl98mgx802994q58vys2bf-gnused-4.9/bin/sed: can't read /nix/store/yxci1m17spdrd2a428rgwzzk2np18j9m-gcc-14-20241116-lib/lib/../lib64/libstdc++.la: No such file or directory
libtool:   error: '/nix/store/yxci1m17spdrd2a428rgwzzk2np18j9m-gcc-14-20241116-lib/lib/../lib64/libstdc++.la' is not a valid libtool archive

It fails both on aarch64-linux and x86_64-linux.

@vcunat
Copy link
Member

vcunat commented Mar 14, 2025

On current nixpkgs master we would work around this by

--- a/pkgs/by-name/cl/claws-mail/package.nix
+++ b/pkgs/by-name/cl/claws-mail/package.nix
@@ -331,6 +331,12 @@ stdenv.mkDerivation rec {
       feature: map (flag: lib.strings.enableFeature feature.enabled flag) feature.flags
     ) features);
 
+  # FIXME: ugly hack for https://github.com/NixOS/nixpkgs/pull/389009
+  postConfigure = ''
+    substituteInPlace libtool \
+      --replace 'for search_ext in .la $std_shrext .so .a' 'for search_ext in $std_shrext .so .a'
+  '';
+
   enableParallelBuilding = true;
 
   preFixup = ''

I didn't push this one, as the package won't build anyway, for a different reason.

@vcunat
Copy link
Member

vcunat commented Mar 14, 2025

And on current staging we have a general fix.

@trofi
Copy link
Contributor

trofi commented Mar 14, 2025

On current nixpkgs master we would work around this by

--- a/pkgs/by-name/cl/claws-mail/package.nix
+++ b/pkgs/by-name/cl/claws-mail/package.nix
@@ -331,6 +331,12 @@ stdenv.mkDerivation rec {
       feature: map (flag: lib.strings.enableFeature feature.enabled flag) feature.flags
     ) features);
 
+  # FIXME: ugly hack for https://github.com/NixOS/nixpkgs/pull/389009
+  postConfigure = ''
+    substituteInPlace libtool \
+      --replace 'for search_ext in .la $std_shrext .so .a' 'for search_ext in $std_shrext .so .a'
+  '';
+
   enableParallelBuilding = true;
 
   preFixup = ''

I didn't push this one, as the package won't build anyway, for a different reason.

Along with enablePluginClamd = false; I was able to get my system to build against master. Thank you!

@rsmyth-ecmi rsmyth-ecmi mentioned this pull request Apr 12, 2025
13 tasks
phaer pushed a commit that referenced this pull request May 4, 2025
The rpath for libstdc++ was previously set to gcc's lib64 directory.
That symlink was removed in #380325, breaking the programs and libraries
distributed as binaries. Also stop using lib64 for libc, in case that
symlink will be removed sometime in the future.

Fixes #396654
@K900 K900 deleted the 2-symlink-2-hack branch July 27, 2025 10:45
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants