Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{libllvm,isl,libiberty,libmpc}: fix references to /usr/bin/uname on native FreeBSD #356763

Open
wants to merge 4 commits into
base: staging
Choose a base branch
from

Conversation

rhelmot
Copy link
Contributor

@rhelmot rhelmot commented Nov 17, 2024

We've all heard this story before. Old versions of gnu config scripts hardcode the /usr/bin/uname filename in the FreeBSD build system code path. Upgrade them so this stops happening. See #313496 for context.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • x86_64-freebsd
  • 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.

@rhelmot rhelmot added the 6.topic: bsd Running or building packages on BSD label Nov 17, 2024
@github-actions github-actions bot added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label Nov 17, 2024
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux-stdenv This PR causes stdenv to rebuild labels Nov 18, 2024
@wegank wegank added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Nov 19, 2024
@sternenseemann
Copy link
Member

Seems okay to me, but maybe it's wiser to add updateAutotoolsGnuConfigScriptsHook to stdenv's extraNativeBuildInputs by default like we use for Linux? I would expect that this nuclear option would work better overall for a platform with a limited number of maintainers.

@rhelmot
Copy link
Contributor Author

rhelmot commented Nov 19, 2024

That would be really excellent! I was told explicitly to not do that when I submitted my first draft of the FreeBSD stdenv rewrite :)

pkgs/development/compilers/llvm/common/llvm/default.nix Outdated Show resolved Hide resolved
@@ -14,6 +14,12 @@ stdenv.mkDerivation {

postUnpack = "sourceRoot=\${sourceRoot}/libiberty";

# needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native
# updateAutotoolsGnuConfigScriptsHook doesn't seem to work here
Copy link
Member

Choose a reason for hiding this comment

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

updateAutotoolsGnuConfigScriptsHook only looks in ., so instead of using sourceRoot to change directory after unpackPhase we would need to cd in preConfigure to make it work…

Alternatively we could make the directory configurable in the setup hook 🤔

@sternenseemann
Copy link
Member

sternenseemann commented Nov 20, 2024

That would be really excellent! I was told explicitly to not do that when I submitted my first draft of the FreeBSD stdenv rewrite :)

Interesting, what was the reasoning given? FTR, #237968 added it for Linux. I think the inclusion in the Linux stdenv also actively reduces the amount of packages that explicitly request it.

I also don't necessarily like running the hook by default, but given that we do it for Linux already…

@rhelmot
Copy link
Contributor Author

rhelmot commented Nov 20, 2024

#311760 (comment)

The logic is that it will be impossible to remove later.

@wegank wegank removed 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: bsd Running or building packages on BSD 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 501+ 10.rebuild-darwin: 5001+ 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ 10.rebuild-linux-stdenv This PR causes stdenv to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants