new variable: QUICK_AND_DIRTY_COMPILER
Don't re-build the Nim compiler multiple times until we get identical binaries, like "build_all.sh" does. Don't build any tools either. Disabled by default, useful in CI.
This commit is contained in:
parent
e2de003ce6
commit
f7c732a150
|
@ -138,6 +138,13 @@ Link PCRE, defaults to 1.
|
|||
|
||||
`make LINK_PCRE=0`
|
||||
|
||||
### QUICK_AND_DIRTY_COMPILER
|
||||
|
||||
Skip multiple Nim compiler bootstrap iterations and tool building. Useful in
|
||||
CI. Defaults to 0.
|
||||
|
||||
`make QUICK_AND_DIRTY_COMPILER=1 build-nim`
|
||||
|
||||
## Make targets
|
||||
|
||||
### build
|
||||
|
|
|
@ -76,6 +76,7 @@ build-nim: | sanity-checks
|
|||
CC=$(CC) \
|
||||
MAKE="$(MAKE)" \
|
||||
ARCH_OVERRIDE=$(ARCH_OVERRIDE) \
|
||||
QUICK_AND_DIRTY_COMPILER=$(QUICK_AND_DIRTY_COMPILER) \
|
||||
"$(CURDIR)/$(BUILD_SYSTEM_DIR)/scripts/build_nim.sh" "$(NIM_DIR)" ../Nim-csources ../nimble "$(CI_CACHE)"
|
||||
|
||||
#- for each submodule, delete checked out files (that might prevent a fresh checkout); skip dotfiles
|
||||
|
|
|
@ -112,3 +112,6 @@ CI_CACHE :=
|
|||
# bypassing the shipped Nim, usually for testing new Nim devel versions
|
||||
USE_SYSTEM_NIM := 0
|
||||
|
||||
# Skip multiple bootstrap iterations and tool building.
|
||||
QUICK_AND_DIRTY_COMPILER := 0
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ CI_CACHE="$4"
|
|||
UCPU=""
|
||||
[[ "$ARCH_OVERRIDE" == "x86" ]] && UCPU="ucpu=i686"
|
||||
[[ -z "$NIM_BUILD_MSG" ]] && NIM_BUILD_MSG="Building the Nim compiler"
|
||||
[[ -z "$QUICK_AND_DIRTY_COMPILER" ]] && QUICK_AND_DIRTY_COMPILER=0
|
||||
|
||||
# Windows detection
|
||||
if uname | grep -qiE "mingw|msys"; then
|
||||
|
@ -119,13 +120,36 @@ build_nim() {
|
|||
else
|
||||
cp -a bin/nim bin/nim_csources
|
||||
fi
|
||||
sed \
|
||||
-e 's/koch$/--warnings:off --hints:off koch/' \
|
||||
-e 's/koch boot/koch boot --warnings:off --hints:off/' \
|
||||
-e 's/koch tools/koch --stable tools --warnings:off --hints:off/' \
|
||||
build_all.sh > build_all_custom.sh
|
||||
sh build_all_custom.sh
|
||||
rm build_all_custom.sh
|
||||
if [[ "$QUICK_AND_DIRTY_COMPILER" == "0" ]]; then
|
||||
sed \
|
||||
-e 's/koch$/--warnings:off --hints:off koch/' \
|
||||
-e 's/koch boot/koch boot --warnings:off --hints:off/' \
|
||||
-e 's/koch tools/koch --stable tools --warnings:off --hints:off/' \
|
||||
build_all.sh > build_all_custom.sh
|
||||
sh build_all_custom.sh
|
||||
rm build_all_custom.sh
|
||||
else
|
||||
# Don't re-build it multiple times until we get identical
|
||||
# binaries, like "build_all.sh" does. Don't build any tools
|
||||
# either. This is all about build speed, not developer comfort.
|
||||
bin/nim_csources \
|
||||
c \
|
||||
--compileOnly \
|
||||
--nimcache:nimcache \
|
||||
-d:release \
|
||||
--skipUserCfg \
|
||||
--skipParentCfg \
|
||||
--warnings:off \
|
||||
--hints:off \
|
||||
compiler/nim.nim
|
||||
bin/nim_csources \
|
||||
jsonscript \
|
||||
--nimcache:nimcache \
|
||||
--skipUserCfg \
|
||||
--skipParentCfg \
|
||||
compiler/nim.nim
|
||||
cp -a compiler/nim bin/nim
|
||||
fi
|
||||
|
||||
# record the last commit's timestamp
|
||||
git log --pretty=format:%cd -n 1 ${GIT_TIMESTAMP_ARG} > bin/timestamp
|
||||
|
|
Loading…
Reference in New Issue