From ba02bf50b9d37ab9fa5511b8aebbbbb09b3b203f Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 21 Apr 2021 07:41:33 +0200 Subject: [PATCH] CIs: attempt to use csources_v1 (#16282) * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting (cherry picked from commit a9b62de8956af50424767408bbe30631c63b331b) --- .builds/freebsd.yml | 2 +- .github/workflows/ci_docs.yml | 4 ++-- azure-pipelines.yml | 2 +- ci/build.bat | 2 +- ci/build.sh | 2 +- ci/nsis_build.bat | 2 +- compiler/vmgen.nim | 2 +- lib/pure/os.nim | 2 ++ lib/std/monotimes.nim | 2 +- lib/std/wrapnils.nim | 4 ++-- 10 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml index 6898a80fdc..443be798a9 100644 --- a/.builds/freebsd.yml +++ b/.builds/freebsd.yml @@ -15,7 +15,7 @@ environment: tasks: - setup: | cd Nim - git clone --depth 1 -q https://github.com/nim-lang/csources.git + git clone --depth 1 -q https://github.com/nim-lang/csources_v1.git csources gmake -C csources -j $(sysctl -n hw.ncpu) bin/nim c --skipUserCfg --skipParentCfg koch echo 'export PATH=$HOME/Nim/bin:$PATH' >> $HOME/.buildenv diff --git a/.github/workflows/ci_docs.yml b/.github/workflows/ci_docs.yml index d8d46b1d85..4eae68d008 100644 --- a/.github/workflows/ci_docs.yml +++ b/.github/workflows/ci_docs.yml @@ -59,7 +59,7 @@ jobs: id: csources-version shell: bash run: | - sha=$(git ls-remote https://github.com/nim-lang/csources master | cut -f 1) + sha=$(git ls-remote https://github.com/nim-lang/csources_v1 master | cut -f 1) echo "::set-output name=sha::$sha" - name: 'Get prebuilt csources from cache' @@ -73,7 +73,7 @@ jobs: if: steps.csources-cache.outputs.cache-hit != 'true' uses: actions/checkout@v2 with: - repository: nim-lang/csources + repository: nim-lang/csources_v1 path: csources - name: 'Build 1-stage compiler from csources' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a4881f029c..5176abc038 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,7 +53,7 @@ jobs: - checkout: self fetchDepth: 1 - - bash: git clone --depth 1 https://github.com/nim-lang/csources + - bash: git clone --depth 1 https://github.com/nim-lang/csources_v1 csources displayName: 'Checkout Nim csources' - task: NodeTool@0 diff --git a/ci/build.bat b/ci/build.bat index cdce8d3d29..2227168e56 100644 --- a/ci/build.bat +++ b/ci/build.bat @@ -2,7 +2,7 @@ REM Some debug info echo "Running on %CI_RUNNER_ID% (%CI_RUNNER_DESCRIPTION%) with tags %CI_RUNNER_TAGS%." gcc -v -git clone --depth 1 https://github.com/nim-lang/csources.git +git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources cd csources call build64.bat cd .. diff --git a/ci/build.sh b/ci/build.sh index 6321fffba8..a89d011edc 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -1,7 +1,7 @@ sh ci/deps.sh # Build from C sources. -git clone --depth 1 https://github.com/nim-lang/csources.git +git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources cd csources sh build.sh cd .. diff --git a/ci/nsis_build.bat b/ci/nsis_build.bat index 4806810d7f..12aff1b724 100644 --- a/ci/nsis_build.bat +++ b/ci/nsis_build.bat @@ -25,7 +25,7 @@ Rem Build csources koch csources -d:release || exit /b rem Grab C sources and nimsuggest -git clone --depth 1 https://github.com/nim-lang/csources.git +git clone --depth 1 https://github.com/nim-lang/csources_v1.git csources set PATH=%CD%\bin;%PATH% diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 25e59b448b..6c2e25db6c 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -16,7 +16,7 @@ # types that use the 'node' field; the reason is that slots are # re-used in a register based VM. Example: # -#..code-block:: nim +#.. code-block:: nim # let s = a & b # no matter what, create fresh node # s = a & b # no matter what, keep the node # diff --git a/lib/pure/os.nim b/lib/pure/os.nim index c150f3af94..47e48e3801 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -943,6 +943,8 @@ proc expandTilde*(path: string): string {. ## Windows: this is still supported despite Windows platform not having this ## convention; also, both ``~/`` and ``~\`` are handled. ## + ## **Warning**: `~bob` and `~bob/` are not yet handled correctly. + ## ## See also: ## * `getHomeDir proc <#getHomeDir>`_ ## * `getConfigDir proc <#getConfigDir>`_ diff --git a/lib/std/monotimes.nim b/lib/std/monotimes.nim index f819cbc8d1..3922937f49 100644 --- a/lib/std/monotimes.nim +++ b/lib/std/monotimes.nim @@ -74,7 +74,7 @@ when defined(js): system.`+`(a, b) {.pop.} -elif defined(posix): +elif defined(posix) and not defined(osx): import posix elif defined(windows): diff --git a/lib/std/wrapnils.nim b/lib/std/wrapnils.nim index b9eb707901..e902c6125a 100644 --- a/lib/std/wrapnils.nim +++ b/lib/std/wrapnils.nim @@ -1,6 +1,6 @@ ## This module allows chains of field-access and indexing where the LHS can be nil. ## This simplifies code by reducing need for if-else branches around intermediate values -## that maybe be nil. +## that may be nil. ## ## Note: experimental module and relies on {.experimental: "dotOperators".} ## Unstable API. @@ -82,7 +82,7 @@ template `[]`*(a: Wrapnil): untyped = else: default(T) -import std/macros +import macros proc replace(n: NimNode): NimNode = if n.kind == nnkPar: