From 50fc6d5f4106c600c2d5fd35f464fb6b64a2ac7d Mon Sep 17 00:00:00 2001 From: Jiuyang Liu Date: Sat, 16 Dec 2023 00:35:30 +0800 Subject: [PATCH] use nixpkgs circt --- flake.nix | 8 ++------ overlay.nix | 33 +++++++++------------------------ 2 files changed, 11 insertions(+), 30 deletions(-) diff --git a/flake.nix b/flake.nix index b67d5102236..183a3bbeea1 100644 --- a/flake.nix +++ b/flake.nix @@ -4,15 +4,11 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/master"; flake-utils.url = "github:numtide/flake-utils"; - circtSrc = { - url = "git+https://github.com/llvm/circt?submodules=1&shallow=1"; - flake = false; - }; }; - outputs = { self, nixpkgs, flake-utils, circtSrc }@inputs: + outputs = { self, nixpkgs, flake-utils }@inputs: let - overlay = import ./overlay.nix circtSrc ; + overlay = import ./overlay.nix; in flake-utils.lib.eachDefaultSystem (system: diff --git a/overlay.nix b/overlay.nix index da090bc8946..87130e83bf2 100644 --- a/overlay.nix +++ b/overlay.nix @@ -1,4 +1,4 @@ -circtSrc: final: prev: +final: prev: { mill = (prev.mill.overrideAttrs (oldAttrs: rec { version = "0.11.5"; @@ -26,29 +26,14 @@ circtSrc: final: prev: espresso = final.callPackage ./nix/espresso.nix { }; circt = prev.circt.overrideAttrs (old: rec { - version = circtSrc.shortRev; - cmakeFlags = [ - "-DBUILD_SHARED_LIBS=ON" - "-DLLVM_ENABLE_BINDINGS=OFF" - "-DLLVM_ENABLE_OCAMLDOC=OFF" - "-DLLVM_BUILD_EXAMPLES=OFF" - "-DLLVM_OPTIMIZED_TABLEGEN=ON" - "-DLLVM_ENABLE_PROJECTS=mlir" - "-DLLVM_EXTERNAL_PROJECTS=circt" - "-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=.." - "-DCIRCT_LLHD_SIM_ENABLED=OFF" - ]; - src = circtSrc; - preConfigure = '' - find ./test -name '*.mlir' -exec sed -i 's|/usr/bin/env|${final.coreutils}/bin/env|g' {} \; - substituteInPlace cmake/modules/GenVersionFile.cmake --replace "unknown git version" "git version ${version}" - ''; - installPhase = '' - runHook preInstall - mkdir -p $out - CMAKE_INSTALL_PREFIX=$out cmake --build . --target install --config Release - runHook postInstall - ''; + version = "nightly"; + src = final.fetchFromGitHub { + owner = "llvm"; + repo = "circt"; + rev = "57372957e8365b34ca469299b8c864d830e836a1"; + sha256 = "sha256-gExhWkhVhIpTKRCfF26pZnrcrf//ASQJDxEKbYc570s="; + fetchSubmodules = true; + }; }); llvm-lit = final.callPackage ./nix/llvm-lit.nix { };