-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor all code that builds csources (#17815)
* refactor all code that builds csources * fixup * nim_csourcesDir_v0 + nim_csourcesDir * remove deprecated, unused scripts from ci/ * reuse nimCsourcesHash in ci * simplify CI pipelines by reusing nimBuildCsourcesIfNeeded * simplify ci_docs.yml by reusing nimBuildCsourcesIfNeeded * cleanup * use csources_v1 as destination dir * fixup * remove pushCsources * address comment: remove build.sh support for now * fixup
- Loading branch information
1 parent
dbb0534
commit dce0b3b
Showing
22 changed files
with
137 additions
and
340 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,16 @@ | ||
#! /bin/sh | ||
|
||
# build development version of the compiler; can be rerun safely. | ||
# arguments can be passed, e.g. `--os freebsd` | ||
# arguments can be passed, e.g.: | ||
# CC=gcc ucpu=amd64 uos=darwin | ||
|
||
set -u # error on undefined variables | ||
set -e # exit on first error | ||
|
||
echo_run(){ | ||
echo "$*" | ||
"$@" | ||
} | ||
. ci/funs.sh | ||
nimBuildCsourcesIfNeeded "$@" | ||
|
||
[ -d csources ] || echo_run git clone -q --depth 1 https://github.com/nim-lang/csources.git | ||
|
||
nim_csources=bin/nim_csources | ||
|
||
build_nim_csources_via_script(){ | ||
echo_run cd csources | ||
echo_run sh build.sh "$@" | ||
} | ||
|
||
build_nim_csources(){ | ||
# avoid changing dir in case of failure | ||
( | ||
if [ $# -ne 0 ]; then | ||
# some args were passed (e.g.: `--cpu i386`), need to call build.sh | ||
build_nim_csources_via_script "$@" | ||
else | ||
# no args, use multiple Make jobs (5X faster on 16 cores: 10s instead of 50s) | ||
makeX=make | ||
unamestr=$(uname) | ||
if [ "$unamestr" = 'FreeBSD' ]; then | ||
makeX=gmake | ||
fi | ||
nCPU=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null || 1) | ||
which $makeX && echo_run $makeX -C csources -j $((nCPU + 2)) -l $nCPU || build_nim_csources_via_script | ||
fi | ||
) | ||
# keep $nim_csources in case needed to investigate bootstrap issues | ||
# without having to rebuild from csources | ||
echo_run cp bin/nim $nim_csources | ||
} | ||
|
||
[ -f $nim_csources ] || echo_run build_nim_csources "$@" | ||
|
||
# Note: if fails, may need to `cd csources && git pull` | ||
# Note: if fails, may need to update csourcesAny manually | ||
echo_run bin/nim c --skipUserCfg --skipParentCfg koch | ||
|
||
echo_run ./koch boot -d:release --skipUserCfg --skipParentCfg | ||
echo_run ./koch tools --skipUserCfg --skipParentCfg # Compile Nimble and other tools. | ||
|
Oops, something went wrong.