|
1 | 1 | #!/usr/bin/env bash
|
2 |
| -# used in Travis CI and AppVeyor scripts |
3 |
| - |
4 |
| -# Copyright (c) 2018-2020 Status Research & Development GmbH. Licensed under |
| 2 | +# Copyright (c) 2018-2024 Status Research & Development GmbH. Licensed under |
5 | 3 | # either of:
|
6 | 4 | # - Apache License, version 2.0
|
7 | 5 | # - MIT license
|
8 | 6 | # at your option. This file may not be copied, modified, or distributed except
|
9 | 7 | # according to those terms.
|
10 | 8 |
|
11 |
| -set -e |
| 9 | +set -eo pipefail |
12 | 10 |
|
13 | 11 | # NIM_COMMIT could be a (partial) commit hash, a tag, a branch name, etc. Empty by default.
|
14 | 12 | NIM_COMMIT_HASH="" # full hash for NIM_COMMIT, retrieved in "nim_needs_rebuilding()"
|
@@ -121,7 +119,14 @@ build_nim() {
|
121 | 119 | # Otherwise, when updating from pre-v2.0.10 to v2.0.10 or later,
|
122 | 120 | # https://github.com/nim-lang/Nim/issues/24173 occurs. Simulates
|
123 | 121 | # https://github.com/nim-lang/Nim/pull/24189 as a workaround.
|
124 |
| - rm -rf dist/checksums |
| 122 | + # |
| 123 | + # When building Nimbus from a Nix derivation which adds this as part of |
| 124 | + # a preBuild phase, do not use this hack, because it's both unnecessary |
| 125 | + # and prevents Nim from building. |
| 126 | + NIX_BUILD_TOP="${NIX_BUILD_TOP:-}" |
| 127 | + if [[ "${NIX_BUILD_TOP}" != "/build" ]]; then |
| 128 | + rm -rf dist/checksums |
| 129 | + fi |
125 | 130 |
|
126 | 131 | if grep -q skipIntegrityCheck koch.nim; then
|
127 | 132 | # Run Nim buildchain, with matching dependency versions
|
|
0 commit comments