diff options
Diffstat (limited to 'pkgs/development/compilers/llvm/git/default.nix')
-rw-r--r-- | pkgs/development/compilers/llvm/git/default.nix | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index c995845fb6b38..464c405dc0606 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -19,9 +19,9 @@ # LLVM release information; specify one of these but not both: , gitRelease ? { version = "19.0.0-git"; - rev = "cebf77fb936a7270c7e3fa5c4a7e76216321d385"; - rev-version = "19.0.0-unstable-2024-04-07"; - sha256 = "sha256-616tscgsiFgHQcXW4KzK5srrudYizQFnJVM6K0qRf+I="; + rev = "78ee473784e5ef6f0b19ce4cb111fb6e4d23c6b2"; + rev-version = "19.0.0-unstable-2024-06-12"; + sha256 = "sha256-oLVMwWjo6Nt8ZsTnDTfoiM5U0+1lVIc1NO+4qBNYlzs="; } # i.e.: # { @@ -44,7 +44,7 @@ # to you to make sure that the LLVM repo given matches the release configuration # specified. , monorepoSrc ? null -}: +}@args: assert lib.assertMsg @@ -56,15 +56,17 @@ assert let monorepoSrc' = monorepoSrc; in let - inherit (import ../common/common-let.nix { inherit lib gitRelease officialRelease; }) releaseInfo; - inherit (releaseInfo) release_version version; - - inherit (import ../common/common-let.nix { inherit lib fetchFromGitHub release_version gitRelease officialRelease monorepoSrc'; }) llvm_meta monorepoSrc; + metadata = rec { + # Import releaseInfo separately to avoid infinite recursion + inherit (import ../common/common-let.nix { inherit lib gitRelease officialRelease; }) releaseInfo; + inherit (releaseInfo) release_version version; + inherit (import ../common/common-let.nix { inherit lib fetchFromGitHub gitRelease release_version officialRelease monorepoSrc'; }) llvm_meta monorepoSrc; + }; tools = lib.makeExtensible (tools: let - callPackage = newScope (tools // { inherit stdenv cmake ninja libxml2 python3 release_version version monorepoSrc buildLlvmTools; }); - major = lib.versions.major release_version; + callPackage = newScope (tools // args // metadata); + major = lib.versions.major metadata.release_version; mkExtraBuildCommands0 = cc: '' rsrc="$out/resource-root" mkdir "$rsrc" @@ -138,7 +140,6 @@ in let # Just like the `llvm-lit-cfg` patch, but for `polly`. ./llvm/polly-lit-cfg-add-libs-to-dylib-path.patch ]; - inherit llvm_meta; }; # `llvm` historically had the binaries. When choosing an output explicitly, @@ -156,7 +157,6 @@ in let libllvmLibdir = "${tools.libllvm.lib}/lib"; }) ]; - inherit llvm_meta; }; clang-unwrapped = tools.libclang; @@ -205,15 +205,12 @@ in let patches = [ ./lld/gnu-install-dirs.patch ]; - inherit llvm_meta; }; - mlir = callPackage ../common/mlir { - inherit llvm_meta; - }; + mlir = callPackage ../common/mlir {}; lldb = callPackage ../common/lldb.nix { - src = callPackage ({ runCommand }: runCommand "lldb-src-${version}" {} '' + src = callPackage ({ runCommand }: runCommand "lldb-src-${metadata.version}" {} '' mkdir -p "$out" cp -r ${monorepoSrc}/cmake "$out" cp -r ${monorepoSrc}/lldb "$out" @@ -237,7 +234,6 @@ in let && !stdenv.targetPlatform.isAarch64 && (lib.versionOlder darwin.apple_sdk.sdk.version "11.0") ) ./lldb/cpu_subtype_arm64e_replacement.patch; - inherit llvm_meta; }; # Below, is the LLVM bootstrapping logic. It handles building a @@ -340,13 +336,11 @@ in let # Has to be in tools despite mostly being a library, # because we use a native helper executable from a # non-cross build in cross builds. - libclc = callPackage ../common/libclc.nix { - inherit buildLlvmTools; - }; + libclc = callPackage ../common/libclc.nix {}; }); libraries = lib.makeExtensible (libraries: let - callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake ninja libxml2 python3 release_version version monorepoSrc; }); + callPackage = newScope (libraries // buildLlvmTools // args // metadata); in { compiler-rt-libc = callPackage ../common/compiler-rt { @@ -360,7 +354,6 @@ in let # See: https://github.com/NixOS/nixpkgs/pull/194634#discussion_r999829893 # ../common/compiler-rt/armv7l-15.patch ]; - inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic) then overrideCC stdenv buildLlvmTools.clangNoCompilerRtWithLibc else stdenv; @@ -377,7 +370,6 @@ in let # See: https://github.com/NixOS/nixpkgs/pull/194634#discussion_r999829893 # ../common/compiler-rt/armv7l-15.patch ]; - inherit llvm_meta; stdenv = if stdenv.hostPlatform.useLLVM or false then overrideCC stdenv buildLlvmTools.clangNoCompilerRt else stdenv; @@ -400,12 +392,10 @@ in let # https://github.com/llvm/llvm-project/issues/64226 ./libcxx/0001-darwin-10.12-mbstate_t-fix.patch ]; - inherit llvm_meta; stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx; }; libunwind = callPackage ../common/libunwind { - inherit llvm_meta; stdenv = overrideCC stdenv buildLlvmTools.clangNoLibcxx; }; @@ -414,9 +404,8 @@ in let ./openmp/fix-find-tool.patch ./openmp/run-lit-directly.patch ]; - inherit llvm_meta targetLlvm; }; }); noExtend = extensible: lib.attrsets.removeAttrs extensible [ "extend" ]; -in { inherit tools libraries release_version; } // (noExtend libraries) // (noExtend tools) +in { inherit tools libraries; inherit (metadata) release_version; } // (noExtend libraries) // (noExtend tools) |