From b985e1337a6ca162a326826abae74047e60112f2 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Tue, 28 May 2024 10:53:42 -0700 Subject: [PATCH] Update Nix build to use LLVM 13 (#660) --- .github/workflows/main.yml | 2 +- default.nix | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 33e0b46f..6d9bcb3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -242,7 +242,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - nixpkgs: ['unstable', '23.05'] + nixpkgs: ['unstable', '24.05'] cuda: ['false', 'true'] steps: - uses: actions/checkout@v2.3.4 diff --git a/default.nix b/default.nix index 666d88fc..a3c140c3 100644 --- a/default.nix +++ b/default.nix @@ -1,11 +1,12 @@ { pkgs ? import { }, lib ? pkgs.lib , fetchFromGitHub ? pkgs.fetchFromGitHub, ncurses ? pkgs.ncurses , cmake ? pkgs.cmake, libxml2 ? pkgs.libxml2, symlinkJoin ? pkgs.symlinkJoin -, cudaPackages ? pkgs.cudaPackages, enableCUDA ? false }: +, cudaPackages ? pkgs.cudaPackages, enableCUDA ? false +, libpfm ? pkgs.libpfm }: let - llvmPackages = pkgs.llvmPackages_11; + llvmPackages = pkgs.llvmPackages_13; stdenv = llvmPackages.stdenv; cuda = if cudaPackages ? cudatoolkit_11 then [ cudaPackages.cudatoolkit_11 @@ -48,7 +49,9 @@ in stdenv.mkDerivation rec { src = ./.; nativeBuildInputs = [ cmake ]; - buildInputs = [ llvmMerged ncurses libxml2 ] ++ lib.optionals enableCUDA cuda; + buildInputs = [ llvmMerged ncurses libxml2 ] + ++ lib.optionals enableCUDA cuda + ++ lib.optional (!stdenv.isDarwin) libpfm; cmakeFlags = [ "-DHAS_TERRA_VERSION=0" @@ -89,7 +92,8 @@ in stdenv.mkDerivation rec { meta = with lib; { description = "A low-level counterpart to Lua"; homepage = "http://terralang.org/"; - platforms = platforms.x86_64 ++ platforms.aarch64; + # Note: Nix has removed LLVM 11, required for Linux AArch64 + platforms = platforms.x86_64 ++ platforms.darwin; # ++ platforms.aarch64; maintainers = with maintainers; [ jb55 thoughtpolice ]; license = licenses.mit; };