Skip to content

Commit

Permalink
[nix] bump everything
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Jul 30, 2024
1 parent 92e5311 commit ec0c831
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 46 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 38 additions & 32 deletions nix/pkgs/buddy-mlir.nix
Original file line number Diff line number Diff line change
@@ -1,49 +1,52 @@
{ cmake, ninja, python3, llvmPackages_16, fetchFromGitHub, fetchpatch }:
# Use clang instead of gcc to build
llvmPackages_16.stdenv.mkDerivation {
{ cmake, ninja, python3, llvmPackages_17, fetchFromGitHub, fetchpatch }:
let
stdenv = llvmPackages_17.stdenv;
bintools = llvmPackages_17.bintools;

buddy-llvm = fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
rev = "6c59f0e1b0fb56c909ad7c9aad4bde37dc006ae0";
hash = "sha256-bMJJ2q1hSh7m0ewclHOmIe7lOHv110rz/P7D3pw8Uiw=";
};
in
stdenv.mkDerivation {
pname = "buddy-mlir";
version = "unstable-2023-08-28";

srcs = [
# Using git submodule to obtain the llvm source is really slow.
# So here I use GitHub archive to download the sources.
(fetchFromGitHub {
owner = "llvm";
repo = "llvm-project";
rev = "8f966cedea594d9a91e585e88a80a42c04049e6c";
sha256 = "sha256-g2cYk3/iyUvmIG0QCQpYmWj4L2H4znx9KbuA5TvIjrc=";
})
(fetchFromGitHub {
owner = "buddy-compiler";
repo = "buddy-mlir";
rev = "7b420a7c23604de2153b919132a7909f30b2cefb";
sha256 = "sha256-m1eabnPo2XXaw7MREt8j9ORQXUvVuWawpJrt2mi/wzM=";
})
];
sourceRoot = "llvm-project";
version = "unstable-2024-07-18";

src = fetchFromGitHub {
owner = "buddy-compiler";
repo = "buddy-mlir";
rev = "ec8a17969b645f0a0c1a822ffb04192b236b5c88";
hash = "sha256-3ecxei/nkx8sjgVkeQvZMaxr1CQXwhTz8aY1e0I3zBA=";
};
unpackPhase = ''
sourceArray=($srcs)
cp -r ''${sourceArray[0]} llvm-project
cp -r ''${sourceArray[1]} buddy-mlir
# We can only use one-step build now...buddy-mlir have bad build system that always
# assume the build artifacts are inside of the LLVM sources. And it also relies on
# some LLVM Cpp source that are configured to be installed by default.
cp -r ${buddy-llvm} llvm-project
cp -r $src buddy-mlir
# Directories copied from nix store are read only
chmod -R u+w llvm-project buddy-mlir
'';
sourceRoot = "llvm-project";

nativeBuildInputs = [ cmake ninja python3 bintools ];

prePatch = "pushd $NIX_BUILD_TOP/buddy-mlir";
prePatch = "pushd ../buddy-mlir";
patches = [
(fetchpatch {
url = "https://github.com/buddy-compiler/buddy-mlir/pull/193.patch";
sha256 = "sha256-scj3jtxrUGLBpHsQRoYYJ8ijqJ22pRu9RU2k7EPe95A=";
})
url = "https://github.com/buddy-compiler/buddy-mlir/pull/357.patch";
hash = "sha256-ysPcHAkrFJDtHmWVo35Wz6ullIGsP1EedYdJCq4fRX4=";
})
];
postPatch = "popd";

nativeBuildInputs = [ cmake ninja python3 llvmPackages_16.bintools ];

cmakeDir = "../llvm";
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DLLVM_INSTALL_UTILS=ON"
"-DLLVM_ENABLE_PROJECTS=mlir"
"-DLLVM_TARGETS_TO_BUILD=host;RISCV"
"-DLLVM_ENABLE_ASSERTIONS=ON"
Expand All @@ -53,5 +56,8 @@ llvmPackages_16.stdenv.mkDerivation {
"-DLLVM_EXTERNAL_BUDDY_MLIR_SOURCE_DIR=../../buddy-mlir"
];

checkTarget = "check-mlir check-buddy";
passthru.llvm = buddy-llvm;

# No need to do check, and it also takes too much time to finish.
doCheck = false;
}
8 changes: 4 additions & 4 deletions nix/t1/_sources/generated.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"chisel": {
"cargoLocks": null,
"date": "2024-07-25",
"date": "2024-07-26",
"extract": null,
"name": "chisel",
"passthru": null,
Expand All @@ -53,11 +53,11 @@
"name": null,
"owner": "chipsalliance",
"repo": "chisel",
"rev": "73e96ea5db53ad176e6a9011fc42c888c901d7e2",
"sha256": "sha256-VvK0NfvXh4oHn2rj2OWTe1zpONt6ReyvhMGDxa3ikE4=",
"rev": "96cc1b7cef892f2dcc65c9dbc85517542a77d412",
"sha256": "sha256-iccWL14hdJ02GbKuQ6PBnylpB61s4JuMw1T/M5ZHqUo=",
"type": "github"
},
"version": "73e96ea5db53ad176e6a9011fc42c888c901d7e2"
"version": "96cc1b7cef892f2dcc65c9dbc85517542a77d412"
},
"chisel-interface": {
"cargoLocks": null,
Expand Down
8 changes: 4 additions & 4 deletions nix/t1/_sources/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
};
chisel = {
pname = "chisel";
version = "73e96ea5db53ad176e6a9011fc42c888c901d7e2";
version = "96cc1b7cef892f2dcc65c9dbc85517542a77d412";
src = fetchFromGitHub {
owner = "chipsalliance";
repo = "chisel";
rev = "73e96ea5db53ad176e6a9011fc42c888c901d7e2";
rev = "96cc1b7cef892f2dcc65c9dbc85517542a77d412";
fetchSubmodules = false;
sha256 = "sha256-VvK0NfvXh4oHn2rj2OWTe1zpONt6ReyvhMGDxa3ikE4=";
sha256 = "sha256-iccWL14hdJ02GbKuQ6PBnylpB61s4JuMw1T/M5ZHqUo=";
};
date = "2024-07-25";
date = "2024-07-26";
};
chisel-interface = {
pname = "chisel-interface";
Expand Down
2 changes: 1 addition & 1 deletion nix/t1/omreader.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ let
./../../common.sc
];
};
millDepsHash = "sha256-vrxTqskAH7H598ZWRC/+KAXOQlQ6f+gL9c0hvD25xOM=";
millDepsHash = "sha256-DQeKTqf+MES5ubORu+SMJEiqpOCXsS7VgxUnSqG12Bs=";
nativeBuildInputs = [ submodules.setupHook ];
};

Expand Down
2 changes: 1 addition & 1 deletion nix/t1/t1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let
./../../common.sc
];
};
millDepsHash = "sha256-vrxTqskAH7H598ZWRC/+KAXOQlQ6f+gL9c0hvD25xOM=";
millDepsHash = "sha256-DQeKTqf+MES5ubORu+SMJEiqpOCXsS7VgxUnSqG12Bs=";
nativeBuildInputs = [ submodules.setupHook ];
};

Expand Down
2 changes: 1 addition & 1 deletion script/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let
./build.sc
];
};
millDepsHash = "sha256-89K7QEq3k50gvs4sbXu7rHajC4tmnQCqB4m5ybBTn6k=";
millDepsHash = "sha256-IXQURecgch/8xUvVefC9fhPP0YCSNp/KwbG8bjRJBwY=";
};

passthru.withLsp = self.overrideAttrs (old: {
Expand Down

0 comments on commit ec0c831

Please sign in to comment.