reuse config/build_config.txt for all bootstrap scripts (posix + windows + ci); use build_all.bat in 1 CI, fix bug in build_all.bat (#17899)

* reuse config/build_config.txt for all bootstrap scripts (posix + windows + ci)
* ci_docs: use build_all.bat in CI (just in that pipeline) to ensure it keeps working
* fixup
* fix pre-existing bug in build_all.bat
* fixup
* cp => copy /y
* auto-generate build_all.bat, build_all.sh
* fixup
This commit is contained in:
Timothee Cour 2021-04-30 22:24:41 -07:00 • committed by GitHub
commit 1f1d85bb9c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 134 additions and 23 deletions

View file

@ -1,20 +1,29 @@
@echo off
rem build development version of the compiler; can be rerun safely
rem TODO: call nimBuildCsourcesIfNeeded or auto-generate this file (from a nim script)
rem to avoid duplication.
if not exist csources_v1 (
git clone --depth 1 https://github.com/nim-lang/csources_v1.git
rem DO NO EDIT DIRECTLY! auto-generated by `nim r tools/ci_generate.nim`
rem Build development version of the compiler; can be rerun safely
rem bare bones version of ci/funs.sh adapted for windows.
rem Read in some common shared variables (shared with other tools),
rem see https://stackoverflow.com/questions/3068929/how-to-read-file-contents-into-a-variable-in-a-batch-file
for /f "delims== tokens=1,2" %%G in (config/build_config.txt) do set %%G=%%H
SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
echo "building from csources: %nim_csources%"
if not exist %nim_csourcesDir% (
git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
)
if not exist bin\nim.exe (
cd csources_v1
git checkout a8a5241f9475099c823cfe1a5e0ca4022ac201ff
if PROCESSOR_ARCHITECTURE == AMD64 (
if not exist %nim_csources% (
cd %nim_csourcesDir%
git checkout %nim_csourcesHash%
echo "%PROCESSOR_ARCHITECTURE%"
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
SET ARCH=64
)
CALL build.bat
cd ..
copy /y bin\nim.exe %nim_csources%
)
bin\nim.exe c --skipUserCfg --skipParentCfg koch
koch.exe boot -d:release --skipUserCfg --skipParentCfg
koch.exe tools --skipUserCfg --skipParentCfg
bin\nim.exe c --skipUserCfg --skipParentCfg --hints:off koch
koch boot -d:release --skipUserCfg --skipParentCfg --hints:off
koch tools --skipUserCfg --skipParentCfg --hints:off