-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
refactor all code that builds csources #17815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ae9029e
refactor all code that builds csources
timotheecour 30ce12b
fixup
timotheecour 4b02251
fixup
timotheecour f13cd07
fixup
timotheecour 8c17dae
nim_csourcesDir_v0 + nim_csourcesDir
timotheecour 4a554eb
fixup
timotheecour 36b9bdd
fixup
timotheecour 91c7a91
remove deprecated, unused scripts from ci/
timotheecour 5141707
reuse nimCsourcesHash in ci
timotheecour 5726d2a
simplify CI pipelines by reusing nimBuildCsourcesIfNeeded
timotheecour 0ce7561
simplify ci_docs.yml by reusing nimBuildCsourcesIfNeeded
timotheecour a425aa6
cleanup
timotheecour c4669c9
use csources_v1 as destination dir
timotheecour 71c933d
fixup
timotheecour 3ff54b9
remove pushCsources
timotheecour 0d761f3
address comment: remove build.sh support for now
timotheecour aea3225
fixup
timotheecour File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.