Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
eca7678
refactor: avoid non-compiler headers in `lean.h`
Kha Oct 11, 2021
1e17936
fix: libleanshared.so needs rpath too
Kha Oct 13, 2021
7837196
feat: String.replace
Kha Oct 18, 2021
a466320
feat: bundling LLVM on Linux
Kha Sep 8, 2021
7f1e357
fix: actually install all bundled files
Kha Oct 22, 2021
48cf118
fix: leanc: discard internal flag when using external compiler
Kha Oct 22, 2021
a8ea782
chore: CI: no more need for binary patching
Kha Oct 22, 2021
fc6cf90
chore: CI: list archive contents & sizes
Kha Oct 22, 2021
46f3c29
feat: use custom, more minimal LLVM build
Kha Oct 27, 2021
23b99c4
feat: link external dependencies statically again
Kha Oct 28, 2021
6f53739
chore: gc libleanshared sections
Kha Oct 28, 2021
f8ccdab
chore: append licenses of LLVM & glibc
Kha Oct 28, 2021
b72b04e
chore: update lean-llvm
Kha Nov 5, 2021
4a8229b
chore: split LICENSE again
Kha Nov 5, 2021
c906567
fix: leanc: drop empty arguments
Kha Nov 5, 2021
9d67d4e
fix: use old nixpkgs for glibc only
Kha Nov 5, 2021
4f01665
chore: update lean-llvm
Kha Nov 7, 2021
73489c9
chore: install license
Kha Nov 7, 2021
427cee6
feat: reimplement `assert` without system headers
Kha Nov 7, 2021
c9fbac0
feat: upload .tar.zst and .zip for every platform
Kha Nov 7, 2021
c38a789
fix: Linux: bundle zlib
Kha Nov 7, 2021
f5e69bd
fix: actually link against GMP statically
Kha Nov 8, 2021
d9e4111
perf: strip LLVM binaries
Kha Nov 8, 2021
b36e253
chore: fix `leanc.sh -v`
Kha Nov 9, 2021
1d5c478
chore: avoid C++ warning
Kha Nov 9, 2021
7344f8c
chore: fix foreign test on macOS, again
Kha Nov 9, 2021
6a0938b
chore: ci: fix List Install Tree
Kha Nov 9, 2021
3523431
fix: build with mingw-clang64 clang
Kha Oct 22, 2021
3c50bc0
feat: bundle LLVM on Windows
Kha Oct 22, 2021
bc2e2bd
chore: do not use bundled compiler for foreign test
Kha Nov 11, 2021
485d4a9
feat: bundle LLVM on macOS
Kha Oct 22, 2021
9c3300b
chore: CI: check test binary as well
Kha Nov 15, 2021
3755750
chore: CI: even shorter install tree listing
Kha Nov 15, 2021
2a2598f
chore: add missing LICENSES
Kha Nov 15, 2021
e9e2793
chore: final cleanup?
Kha Nov 15, 2021
54e1bb8
chore: remove LICENSE header that confused GitHub
Kha Nov 15, 2021
ca65330
chore: remove redundant cmake `install` directive
Kha Nov 17, 2021
d922fa1
fix: restore macOS compile flags
Kha Nov 17, 2021
ed3edeb
chore: add GMP license for now
Kha Nov 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 39 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ jobs:
strategy:
matrix:
include:
# portable release build: link most libraries statically and use channel with older glibc (2.27; LLVM 7)
# portable release build: use channel with older glibc (2.27)
- name: Linux release
os: ubuntu-latest
release: true
shell: nix-shell --arg pkgs "import (fetchTarball \"channel:nixos-19.03\") {{}}" --argstr llvmPackages latest --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
prepare-llvm: script/prepare-llvm-linux.sh lean-llvm*
binary-check: ldd -v
- name: Linux
os: ubuntu-latest
check-stage3: true
Expand All @@ -44,13 +47,19 @@ jobs:
shell: bash -euxo pipefail {0}
# Mojave, oldest maintained version as of 2021
CMAKE_OPTIONS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14
llvm-url: https://github.com/leanprover/lean-llvm/releases/download/13.0.0/lean-llvm-x86_64-apple-darwin.tar.zst
prepare-llvm: script/prepare-llvm-macos.sh lean-llvm*
binary-check: otool -L
- name: Windows
os: windows-2022
release: true
shell: msys2 {0}
CMAKE_OPTIONS: -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
CMAKE_OPTIONS: -G "Unix Makefiles"
# for reasons unknown, interactivetests are flaky on Windows
CTEST_OPTIONS: --repeat until-pass:2
llvm-url: https://github.com/leanprover/lean-llvm/releases/download/13.0.0/lean-llvm-x86_64-w64-windows-gnu.tar.zst
prepare-llvm: script/prepare-llvm-mingw.sh lean-llvm*
binary-check: ldd
# complete all jobs
fail-fast: false
name: ${{ matrix.name }}
Expand All @@ -73,11 +82,12 @@ jobs:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
install: make python mingw-w64-x86_64-cmake mingw-w64-x86_64-clang mingw-w64-x86_64-ccache git unzip diffutils binutils
msystem: clang64
install: make python mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-ccache git zip unzip diffutils binutils tree mingw-w64-clang-x86_64-zstd tar
if: matrix.os == 'windows-2022'
- name: Install Brew Packages
run: |
brew install ccache
brew install ccache tree zstd coreutils
if: matrix.os == 'macos-latest'
- name: Cache
uses: actions/cache@v2
Expand All @@ -100,74 +110,50 @@ jobs:
run: |
mkdir build
cd build
OPTIONS=
OPTIONS=()
[[ -z '${{ matrix.llvm-url }}' ]] || wget -q ${{ matrix.llvm-url }}
[[ -z '${{ matrix.prepare-llvm }}' ]] || eval "OPTIONS+=($(../${{ matrix.prepare-llvm }}))"
if [[ $GITHUB_EVENT_NAME == 'schedule' && -n '${{ matrix.release }}' && -n '${{ secrets.PUSH_NIGHTLY_TOKEN }}' ]]; then
git remote add nightly https://foo:'${{ secrets.PUSH_NIGHTLY_TOKEN }}'@github.com/${{ github.repository_owner }}/lean4-nightly.git
git fetch nightly --tags
LEAN_VERSION_STRING="nightly-$(date -u +%F)"
# do nothing if commit already has a different tag
if [[ $(git name-rev --name-only --tags --no-undefined HEAD 2> /dev/null || echo $LEAN_VERSION_STRING) == $LEAN_VERSION_STRING ]]; then
OPTIONS=-DLEAN_SPECIAL_VERSION_DESC=$LEAN_VERSION_STRING
OPTIONS+=(-DLEAN_SPECIAL_VERSION_DESC=$LEAN_VERSION_STRING)
echo "LEAN_VERSION_STRING=$LEAN_VERSION_STRING" >> $GITHUB_ENV
fi
fi
cmake .. ${{ matrix.CMAKE_OPTIONS }} $OPTIONS
# contortion to support empty OPTIONS with old macOS bash
cmake .. ${{ matrix.CMAKE_OPTIONS }} ${OPTIONS[@]+"${OPTIONS[@]}"} -DLEAN_INSTALL_PREFIX=$PWD/..
make -j4
# de-Nix-ify binaries
- name: Patch
if: matrix.name == 'Linux release'
make install
- name: Check Binaries
run: ${{ matrix.binary-check }} lean-*/bin/* || true
- name: List Install Tree
run: |
cd build/stage1
for f in lib/lean/libleanshared.so bin/lean bin/leanpkg bin/leanc bin/lake; do
cp -n $(ldd "$f" | cut -f3 -d' ' | grep -Ev 'libc|lean') lib/ || true
if [[ "$f" == bin/* ]]; then
patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 --set-rpath '$ORIGIN/../lib:$ORIGIN/../lib/lean' $f
else
# library: use executable RPATH
patchelf --remove-rpath $f
fi
ldd $f
done
ls -l lib/
- name: Patch
if: matrix.name == 'macOS'
run: |
cd build/stage1
cp /usr/local/opt/gmp/lib/libgmp.* lib/
for f in lib/lean/libleanshared.dylib bin/lean bin/leanpkg bin/leanc bin/lake; do
for lib in $(otool -L $f | tail -n +2 | cut -d' ' -f1); do
# copy Homebrew dependencies
if [[ "$lib" == /usr/local/opt/* ]]; then cp -n "$lib" lib/ || true; fi
[[ "$lib" == /usr/lib/* ]] || install_name_tool -change "$lib" "@rpath/$(basename $lib)" $f
done
otool -L $f
done
ls -l lib/
- name: Patch
if: matrix.name == 'Windows'
run: |
cd build/stage1
cp $(ldd bin/lean.exe | cut -f3 -d' ' | grep mingw) bin/
ldd bin/lean.exe
ls -l bin/
- name: Test Binary without Nix Shell
if: matrix.name != 'Windows'
shell: bash {0}
run: |
build/stage1/bin/lean -h
# omit contents of Init/, ...
tree --du -h lean-* | grep -E ' (Init|Std|Lean|Lake|LICENSE|[a-z])'
- name: Pack
run: cd build/stage1; cpack
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.release }}
run: |
dir=$(echo lean-*)
mkdir pack
which zstd
tar cf - $dir | zstd -T0 --no-progress -19 -o pack/$dir.tar.zst
zip -r pack/$dir.zip $dir
- uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.name }}
path: build/stage1/lean-*
path: lean-*
- name: Lean stats
run: |
build/stage1/bin/lean --stats src/Lean.lean
- name: Test
run: |
cd build/stage1
ctest -j4 --output-on-failure --timeout 300 ${{ matrix.CTEST_OPTIONS }} < /dev/null
- name: Check Test Binary
run: ${{ matrix.binary-check }} tests/compiler/534.lean.out
- name: Build Stage 2
run: |
cd build
Expand Down Expand Up @@ -195,7 +181,7 @@ jobs:
uses: softprops/action-gh-release@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') && matrix.release }}
with:
files: build/stage1/lean-*
files: pack/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Nightly Release
Expand Down Expand Up @@ -223,7 +209,7 @@ jobs:
with:
body_path: diff.md
prerelease: true
files: build/stage1/lean-*
files: pack/*
tag_name: ${{ env.LEAN_VERSION_STRING }}
repository: ${{ github.repository_owner }}/lean4-nightly
env:
Expand Down
Loading