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

rubyPackages.iconv, v8: fix build with clang 16 #265307

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

reckenrode
Copy link
Contributor

Description of changes

Second batch of fixes for staging-next #263535.

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/)
  • 23.11 Release Notes (or backporting 23.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.

Fix incompatible function pointer conversion errors.
@reckenrode reckenrode requested a review from marsam as a code owner November 3, 2023 20:37
@reckenrode reckenrode changed the title perlPackages.Gtk2, scheme48, smpeg, stfl: fix build with clang 16 rubyPackages.iconv, v8: fix build with clang 16 Nov 3, 2023
@reckenrode reckenrode marked this pull request as draft November 3, 2023 21:14
@reckenrode
Copy link
Contributor Author

Setting to draft while I troubleshoot an issue I encountered while doing a rebuild.

@reckenrode reckenrode marked this pull request as ready for review November 3, 2023 22:14
@reckenrode
Copy link
Contributor Author

Marking ready after successfully rebuilding locally.

This was taken from NixOS#264091 to use in the interim before that PR lands
(sometime after the release of 23.11). It allows different versions of
clang to link the same libc++, allowing dependencies to be linked when
they are built with a different version of clang than the stdenv.
The version of v8 in nixpkgs fails to build due to
`-Wenum-constexpr-conversion` errors. Since this will be made a hard
error in later versions of clang, use clang 15 to build v8.
@reckenrode reckenrode force-pushed the clang16-fixes-batch2 branch from 18b192d to 2c4e2d8 Compare November 4, 2023 03:39
@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Nov 4, 2023
@reckenrode
Copy link
Contributor Author

@wegank I added the adapter and updated the PR to use it.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 4, 2023
@wegank wegank merged commit 023d20a into NixOS:staging-next Nov 4, 2023
22 of 23 checks passed
in
overrideCC stdenv (stdenv.cc.override {
inherit libcxx;
extraPackages = [ cxxabi pkgs.pkgsTargetTarget."llvmPackages_${lib.versions.major llvmLibcxxVersion}".compiler-rt ];
Copy link
Contributor

Choose a reason for hiding this comment

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

Does pkgs.pkgsTargetTarget work for you for any cross-cases? I tried pkgsLLVM.asciidoc-full and it fails the eval as:

nix build --no-link -f. pkgsLLVM.asciidoc-full
error:
       error: attribute 'llvmPackages_13' missing

       at pkgs/stdenv/adapters.nix:86:32:

           85|       inherit libcxx;
           86|       extraPackages = [ cxxabi pkgs.pkgsTargetTarget."llvmPackages_${lib.versions.major llvmLibcxxVersion}".compiler-rt ];
             |                                ^
           87|     });

It looks like pkgsTargetTarget is always empty for cross-compilers. On the contrast the following seems to work:

--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -83,7 +83,10 @@ rec {
     in
     overrideCC stdenv (stdenv.cc.override {
       inherit libcxx;
-      extraPackages = [ cxxabi pkgs.pkgsTargetTarget."llvmPackages_${lib.versions.major llvmLibcxxVersion}".compiler-rt ];
+      extraPackages = [
+        cxxabi
+        pkgs.buildPackages.targetPackages."llvmPackages_${lib.versions.major llvmLibcxxVersion}".compiler-rt
+      ];
     });

   # Override the setup script of stdenv.  Useful for testing new

Copy link
Contributor

Choose a reason for hiding this comment

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

Proposed the change as #279463

@reckenrode reckenrode deleted the clang16-fixes-batch2 branch July 25, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: ruby 6.topic: stdenv Standard environment 10.rebuild-darwin: 11-100 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants