chore: update-stage0: simplify

This commit is contained in:
Sebastian Ullrich 2022-11-20 18:05:00 +01:00 committed by Leonardo de Moura
parent 5053cb02b7
commit 9c3a283eb1
2 changed files with 8 additions and 10 deletions

View file

@ -158,7 +158,7 @@ rec {
update-stage0 =
let cTree = symlinkJoin { name = "cs"; paths = map (l: l.cTree) stdlib; }; in
writeShellScriptBin "update-stage0" ''
CSRCS=${cTree} CP_PARAMS="--dereference --no-preserve=all" ${../script/update-stage0}
CSRCS=${cTree} CP_C_PARAMS="--dereference --no-preserve=all" ${../script/update-stage0}
'';
update-stage0-commit = writeShellScriptBin "update-stage0-commit" ''
set -euo pipefail

View file

@ -2,17 +2,15 @@
set -euo pipefail
rm -r stage0 || true
for pkg in Init Lean; do
# ensure deterministic ordering
c_files="$pkg.c $(cd src; find $pkg -name '*.lean' | sed 's/\.lean/.c/' | LC_ALL=C sort | tr '\n' ' ')"
for f in $c_files; do
mkdir -p $(dirname stage0/stdlib/$f)
cp ${CP_PARAMS:-} $CSRCS/$f stage0/stdlib/$f
done
done
# don't copy untracked files
for f in $(git ls-files src); do
if [[ $f != src/lake && $f != *.lean ]]; then
[[ $f != src/lake && $f != src/Leanc.lean ]] || continue
if [[ $f == *.lean ]]; then
f=${f#src/}
f=${f%.lean}.c
mkdir -p $(dirname stage0/stdlib/$f)
cp ${CP_C_PARAMS:-} $CSRCS/$f stage0/stdlib/$f
else
mkdir -p $(dirname stage0/$f)
cp $f stage0/$f
fi