diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1ede85eb2..512abe240c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Linux release os: ubuntu-latest release: true - shell: nix-shell --arg glibc "(import (fetchTarball \"channel:nixos-19.03\") {{}}).glibc" --run "bash -euxo pipefail {0}" + shell: nix-shell --arg pkgsDist "import (fetchTarball \"channel:nixos-19.03\") {{}}" --run "bash -euxo pipefail {0}" llvm-url: https://github.com/leanprover/lean-llvm/releases/download/13.0.0/lean-llvm-x86_64-linux-gnu.tar.zst - name: Linux os: ubuntu-latest diff --git a/script/prepare-llvm-linux.sh b/script/prepare-llvm-linux.sh index 43086958a6..c54c7f7759 100755 --- a/script/prepare-llvm-linux.sh +++ b/script/prepare-llvm-linux.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -uo pipefail -# run from root build directory (from inside nix-shell or otherwise defining GLIBC/GMP) as in +# run from root build directory (from inside nix-shell or otherwise defining GLIBC/ZLIB/GMP) as in # ``` # eval cmake ../.. $(../../script/prepare-llvm-linux.sh ~/Downloads/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz) # ``` @@ -14,9 +14,10 @@ CP="cp -d" # preserve symlinks # a C compiler! $CP $(realpath llvm/bin/clang) stage1/bin/clang # a linker! -$CP llvm/bin/{lld,ld.lld} stage1/bin/ +$CP llvm/bin/{ld.lld,lld} stage1/bin/ # dependencies of the above $CP llvm/lib/lib{clang-cpp,LLVM}*.so* stage1/lib/ +$CP $ZLIB/lib/libz.so* stage1/lib/ # lean.h dependencies $CP llvm/lib/clang/*/include/{std*,__std*,limits}.h stage1/include/clang # ELF dependencies, must be put there for `--sysroot` diff --git a/shell.nix b/shell.nix index 73d2625e63..6d5bb1de6e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,6 @@ let flakePkgs = (import ./default.nix).packages.${builtins.currentSystem}; -in { pkgs ? flakePkgs.nixpkgs, llvmPackages ? null, glibc ? pkgs.glibc }: +in { pkgs ? flakePkgs.nixpkgs, pkgsDist ? pkgs, llvmPackages ? null }: # use `shell` as default (attribs: attribs.shell // attribs) rec { shell = pkgs.mkShell.override { @@ -13,8 +13,9 @@ in { pkgs ? flakePkgs.nixpkgs, llvmPackages ? null, glibc ? pkgs.glibc }: hardeningDisable = [ "all" ]; # more convenient `ctest` output CTEST_OUTPUT_ON_FAILURE = 1; - GMP = pkgs.gmp.override { withStatic = true; }; - GLIBC = glibc; + GMP = pkgsDist.gmp.override { withStatic = true; }; + GLIBC = pkgsDist.glibc; + ZLIB = pkgsDist.zlib; shellHook = '' export LEAN_SRC_PATH="$PWD/src" '';