From ec0c83118d36dab0a7556c28a94fd6429be0c33a Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Sun, 28 Jul 2024 20:11:29 +0800 Subject: [PATCH] [nix] bump everything --- flake.lock | 6 +-- nix/pkgs/buddy-mlir.nix | 70 ++++++++++++++++++---------------- nix/t1/_sources/generated.json | 8 ++-- nix/t1/_sources/generated.nix | 8 ++-- nix/t1/omreader.nix | 2 +- nix/t1/t1.nix | 2 +- script/default.nix | 2 +- 7 files changed, 52 insertions(+), 46 deletions(-) diff --git a/flake.lock b/flake.lock index bb3c3ea19..3cbb118ca 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1714253743, - "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "lastModified": 1722062969, + "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", "type": "github" }, "original": { diff --git a/nix/pkgs/buddy-mlir.nix b/nix/pkgs/buddy-mlir.nix index 67db0c240..8bd03422f 100644 --- a/nix/pkgs/buddy-mlir.nix +++ b/nix/pkgs/buddy-mlir.nix @@ -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" @@ -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; } diff --git a/nix/t1/_sources/generated.json b/nix/t1/_sources/generated.json index 041aaf641..1ee4005d3 100644 --- a/nix/t1/_sources/generated.json +++ b/nix/t1/_sources/generated.json @@ -41,7 +41,7 @@ }, "chisel": { "cargoLocks": null, - "date": "2024-07-25", + "date": "2024-07-26", "extract": null, "name": "chisel", "passthru": null, @@ -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, diff --git a/nix/t1/_sources/generated.nix b/nix/t1/_sources/generated.nix index 21acd89f9..e5ae53b50 100644 --- a/nix/t1/_sources/generated.nix +++ b/nix/t1/_sources/generated.nix @@ -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"; diff --git a/nix/t1/omreader.nix b/nix/t1/omreader.nix index ae2c1e499..6f61febe4 100644 --- a/nix/t1/omreader.nix +++ b/nix/t1/omreader.nix @@ -38,7 +38,7 @@ let ./../../common.sc ]; }; - millDepsHash = "sha256-vrxTqskAH7H598ZWRC/+KAXOQlQ6f+gL9c0hvD25xOM="; + millDepsHash = "sha256-DQeKTqf+MES5ubORu+SMJEiqpOCXsS7VgxUnSqG12Bs="; nativeBuildInputs = [ submodules.setupHook ]; }; diff --git a/nix/t1/t1.nix b/nix/t1/t1.nix index 89dd7de5a..7e1d75680 100644 --- a/nix/t1/t1.nix +++ b/nix/t1/t1.nix @@ -41,7 +41,7 @@ let ./../../common.sc ]; }; - millDepsHash = "sha256-vrxTqskAH7H598ZWRC/+KAXOQlQ6f+gL9c0hvD25xOM="; + millDepsHash = "sha256-DQeKTqf+MES5ubORu+SMJEiqpOCXsS7VgxUnSqG12Bs="; nativeBuildInputs = [ submodules.setupHook ]; }; diff --git a/script/default.nix b/script/default.nix index 65f992c92..cb8e69732 100644 --- a/script/default.nix +++ b/script/default.nix @@ -30,7 +30,7 @@ let ./build.sc ]; }; - millDepsHash = "sha256-89K7QEq3k50gvs4sbXu7rHajC4tmnQCqB4m5ybBTn6k="; + millDepsHash = "sha256-IXQURecgch/8xUvVefC9fhPP0YCSNp/KwbG8bjRJBwY="; }; passthru.withLsp = self.overrideAttrs (old: {