Commit cdefc40e authored by Peter Waller's avatar Peter Waller
Browse files

llvmPackages.*: Expose git rev through pkg.src.rev



Also exposes owner, repo, and other attributes available on the original
monorepoSrc. These attributes were previously hidden behind a
runCommand that consumes monorepoSrc and hides this information away.

```
$ nix eval --raw .#llvmPackages_18.llvm.src.rev
llvmorg-18.1.8

$ nix eval --raw .#llvmPackages_git.llvm.src.rev
0e8555d4dbfdfeddc01dc2ecf9a9b6e804f7b645
```

Signed-off-by: default avatarPeter Waller <p@pwaller.net>
parent 6011527f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ runCommand "llvm-binutils-${version}"
  passthru = {
    isLLVM = true;
    inherit targetPrefix;
    inherit llvm lld;
  };
}
  (''
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
  inherit version patches;

  # Blank llvm dir just so relative path works
  src = runCommand "bolt-src-${finalAttrs.version}" { } (
  src = runCommand "bolt-src-${finalAttrs.version}" { inherit (monorepoSrc) passthru; } (
    ''
      mkdir $out
    ''
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ let
  pname = "clang";

  src' = if monorepoSrc != null then
    runCommand "${pname}-src-${version}" {} (''
    runCommand "${pname}-src-${version}" { inherit (monorepoSrc) passthru; } (''
      mkdir -p "$out"
    '' + lib.optionalString (lib.versionAtLeast release_version "14") ''
      cp -r ${monorepoSrc}/cmake "$out"
+2 −1
Original line number Diff line number Diff line
@@ -53,10 +53,11 @@ rec {
          else
            "llvmorg-${releaseInfo.version}";
      in
      fetchFromGitHub {
      fetchFromGitHub rec {
        owner = "llvm";
        repo = "llvm-project";
        inherit rev sha256;
        passthru = { inherit owner repo rev; };
      };

}
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ let
      apple-sdk.override { enableBootstrap = true; };

  src' = if monorepoSrc != null then
    runCommand "${baseName}-src-${version}" {} (''
    runCommand "${baseName}-src-${version}" { inherit (monorepoSrc) passthru; } (''
      mkdir -p "$out"
    '' + lib.optionalString (lib.versionAtLeast release_version "14") ''
      cp -r ${monorepoSrc}/cmake "$out"
Loading