Skip to content

Commit fc3c82b

Browse files
authored
chore: denixify stage0-updater workflow (#8452)
This PR lets the stage0 autoupdater build lean using the `cmake` infrastructure, not the deprecated nix infrastructure.
1 parent 8fc94c5 commit fc3c82b

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

.github/workflows/update-stage0.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,34 +40,24 @@ jobs:
4040
run: |
4141
git config --global user.name "Lean stage0 autoupdater"
4242
git config --global user.email "<>"
43-
# Would be nice, but does not work yet:
44-
# https://github.com/DeterminateSystems/magic-nix-cache/issues/39
45-
# This action does not run that often and building runs in a few minutes, so ok for now
46-
#- if: env.should_update_stage0 == 'yes'
47-
# uses: DeterminateSystems/magic-nix-cache-action@v2
48-
- if: env.should_update_stage0 == 'yes'
49-
name: Restore Build Cache
50-
uses: actions/cache/restore@v4
51-
with:
52-
path: nix-store-cache
53-
key: Nix Linux-nix-store-cache-${{ github.sha }}
54-
# fall back to (latest) previous cache
55-
restore-keys: |
56-
Nix Linux-nix-store-cache
57-
- if: env.should_update_stage0 == 'yes'
58-
name: Further Set Up Nix Cache
59-
shell: bash -euxo pipefail {0}
60-
run: |
61-
# Nix seems to mutate the cache, so make a copy
62-
cp -r nix-store-cache nix-store-cache-copy || true
6343
- if: env.should_update_stage0 == 'yes'
6444
name: Install Nix
6545
uses: DeterminateSystems/nix-installer-action@main
66-
with:
67-
extra-conf: |
68-
substituters = file://${{ github.workspace }}/nix-store-cache-copy?priority=10&trusted=true https://cache.nixos.org
46+
- name: Open Nix shell once
47+
if: env.should_update_stage0 == 'yes'
48+
run: true
49+
shell: 'nix develop -c bash -euxo pipefail {0}'
50+
- name: Set up NPROC
51+
if: env.should_update_stage0 == 'yes'
52+
run: |
53+
echo "NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)" >> $GITHUB_ENV
54+
shell: 'nix develop -c bash -euxo pipefail {0}'
55+
- if: env.should_update_stage0 == 'yes'
56+
run: cmake --preset release
57+
shell: 'nix develop -c bash -euxo pipefail {0}'
6958
- if: env.should_update_stage0 == 'yes'
70-
run: nix run .#update-stage0-commit
59+
run: make -j$NPROC -C build/release update-stage0-commit
60+
shell: 'nix develop -c bash -euxo pipefail {0}'
7161
- if: env.should_update_stage0 == 'yes'
7262
run: git show --stat
7363
- if: env.should_update_stage0 == 'yes' && github.event_name == 'push'

stage0/src/stdlib_flags.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include "util/options.h"
22

3+
// test
4+
35
namespace lean {
46
options get_default_options() {
57
options opts;

0 commit comments

Comments
 (0)