From 93ebe44ac34a3d3c36dd790780076255fd895c19 Mon Sep 17 00:00:00 2001 From: Madoura Date: Sun, 3 Dec 2023 18:25:44 -0600 Subject: [PATCH] rocmPackages_5: pin stdenv to GCC 12 Try reverting this on a future ROCm release. Addresses: https://github.com/NixOS/nixpkgs/issues/271943 --- pkgs/development/rocm-modules/5/default.nix | 9 +++++++-- .../development/rocm-modules/5/llvm/default.nix | 17 +++++++++-------- .../5/llvm/stage-1/clang-unwrapped.nix | 5 +++-- .../rocm-modules/5/llvm/stage-1/lld.nix | 5 +++-- .../rocm-modules/5/llvm/stage-1/llvm.nix | 2 +- .../rocm-modules/5/llvm/stage-1/runtimes.nix | 3 ++- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/pkgs/development/rocm-modules/5/default.nix b/pkgs/development/rocm-modules/5/default.nix index d5f1c2678c4e1..6814825b2f9b3 100644 --- a/pkgs/development/rocm-modules/5/default.nix +++ b/pkgs/development/rocm-modules/5/default.nix @@ -1,4 +1,5 @@ -{ callPackage +{ gcc12Stdenv # FIXME: Try removing this with a new ROCm release https://github.com/NixOS/nixpkgs/issues/271943 +, callPackage , recurseIntoAttrs , symlinkJoin , fetchFromGitHub @@ -73,10 +74,11 @@ in rec { # Broken, too many errors rdc = callPackage ./rdc { inherit rocmUpdateScript rocm-smi rocm-runtime; + stdenv = gcc12Stdenv; # stdenv = llvm.rocmClangStdenv; }; - rocm-docs-core = python3Packages.callPackage ./rocm-docs-core { }; + rocm-docs-core = python3Packages.callPackage ./rocm-docs-core { stdenv = gcc12Stdenv; }; ## ROCm-Developer-Tools ## hip-common = callPackage ./hip-common { @@ -107,17 +109,20 @@ in rec { rocprofiler = callPackage ./rocprofiler { inherit rocmUpdateScript clr rocm-core rocm-thunk rocm-device-libs roctracer rocdbgapi rocm-smi hsa-amd-aqlprofile-bin; inherit (llvm) clang; + stdenv = gcc12Stdenv; }; # Needs GCC roctracer = callPackage ./roctracer { inherit rocmUpdateScript rocm-device-libs rocm-runtime clr; + stdenv = gcc12Stdenv; }; # Needs GCC rocgdb = callPackage ./rocgdb { inherit rocmUpdateScript; elfutils = elfutils.override { enableDebuginfod = true; }; + stdenv = gcc12Stdenv; }; rocdbgapi = callPackage ./rocdbgapi { diff --git a/pkgs/development/rocm-modules/5/llvm/default.nix b/pkgs/development/rocm-modules/5/llvm/default.nix index 9226fb87802c7..9c8919165a516 100644 --- a/pkgs/development/rocm-modules/5/llvm/default.nix +++ b/pkgs/development/rocm-modules/5/llvm/default.nix @@ -1,4 +1,5 @@ -{ stdenv +{ # stdenv FIXME: Try changing back to this with a new ROCm release https://github.com/NixOS/nixpkgs/issues/271943 + gcc12Stdenv , callPackage , rocmUpdateScript , wrapBintoolsWith @@ -12,18 +13,18 @@ let ## Stage 1 ## # Projects - llvm = callPackage ./stage-1/llvm.nix { inherit rocmUpdateScript; }; - clang-unwrapped = callPackage ./stage-1/clang-unwrapped.nix { inherit rocmUpdateScript llvm; }; - lld = callPackage ./stage-1/lld.nix { inherit rocmUpdateScript llvm; }; + llvm = callPackage ./stage-1/llvm.nix { inherit rocmUpdateScript; stdenv = gcc12Stdenv; }; + clang-unwrapped = callPackage ./stage-1/clang-unwrapped.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; + lld = callPackage ./stage-1/lld.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; # Runtimes - runtimes = callPackage ./stage-1/runtimes.nix { inherit rocmUpdateScript llvm; }; + runtimes = callPackage ./stage-1/runtimes.nix { inherit rocmUpdateScript llvm; stdenv = gcc12Stdenv; }; ## Stage 2 ## # Helpers bintools-unwrapped = callPackage ./stage-2/bintools-unwrapped.nix { inherit llvm lld; }; bintools = wrapBintoolsWith { bintools = bintools-unwrapped; }; - rStdenv = callPackage ./stage-2/rstdenv.nix { inherit llvm clang-unwrapped lld runtimes bintools; }; + rStdenv = callPackage ./stage-2/rstdenv.nix { inherit llvm clang-unwrapped lld runtimes bintools; stdenv = gcc12Stdenv; }; in rec { inherit llvm @@ -40,8 +41,8 @@ in rec { ## Stage 3 ## # Helpers - clang = callPackage ./stage-3/clang.nix { inherit llvm lld clang-unwrapped bintools libc libunwind libcxxabi libcxx compiler-rt; }; - rocmClangStdenv = overrideCC stdenv clang; + clang = callPackage ./stage-3/clang.nix { inherit llvm lld clang-unwrapped bintools libc libunwind libcxxabi libcxx compiler-rt; stdenv = gcc12Stdenv; }; + rocmClangStdenv = overrideCC gcc12Stdenv clang; # Projects clang-tools-extra = callPackage ./stage-3/clang-tools-extra.nix { inherit rocmUpdateScript llvm clang-unwrapped; stdenv = rocmClangStdenv; }; diff --git a/pkgs/development/rocm-modules/5/llvm/stage-1/clang-unwrapped.nix b/pkgs/development/rocm-modules/5/llvm/stage-1/clang-unwrapped.nix index 113313f4e0665..5a61732ffd2d4 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-1/clang-unwrapped.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-1/clang-unwrapped.nix @@ -1,10 +1,11 @@ -{ callPackage +{ stdenv +, callPackage , rocmUpdateScript , llvm }: callPackage ../base.nix rec { - inherit rocmUpdateScript; + inherit stdenv rocmUpdateScript; targetName = "clang-unwrapped"; targetDir = "clang"; extraBuildInputs = [ llvm ]; diff --git a/pkgs/development/rocm-modules/5/llvm/stage-1/lld.nix b/pkgs/development/rocm-modules/5/llvm/stage-1/lld.nix index a7b042eabfe65..5ca8bca25a338 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-1/lld.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-1/lld.nix @@ -1,10 +1,11 @@ -{ callPackage +{ stdenv +, callPackage , rocmUpdateScript , llvm }: callPackage ../base.nix rec { - inherit rocmUpdateScript; + inherit stdenv rocmUpdateScript; buildMan = false; # No man pages to build targetName = "lld"; targetDir = targetName; diff --git a/pkgs/development/rocm-modules/5/llvm/stage-1/llvm.nix b/pkgs/development/rocm-modules/5/llvm/stage-1/llvm.nix index 51959ec8bc325..82bd55411a246 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-1/llvm.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-1/llvm.nix @@ -4,7 +4,7 @@ }: callPackage ../base.nix { - inherit rocmUpdateScript; + inherit stdenv rocmUpdateScript; requiredSystemFeatures = [ "big-parallel" ]; isBroken = stdenv.isAarch64; # https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344 } diff --git a/pkgs/development/rocm-modules/5/llvm/stage-1/runtimes.nix b/pkgs/development/rocm-modules/5/llvm/stage-1/runtimes.nix index 5f6f278ab10e4..0364a02e6e59b 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-1/runtimes.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-1/runtimes.nix @@ -1,11 +1,12 @@ { lib +, stdenv , callPackage , rocmUpdateScript , llvm }: callPackage ../base.nix rec { - inherit rocmUpdateScript; + inherit stdenv rocmUpdateScript; buildDocs = false; buildMan = false; buildTests = false;