add Nix derivation workaround (#91)

This commit is contained in:
tersec 2024-10-17 02:59:25 +00:00 committed by GitHub
parent 44f94c3a05
commit 4afb052662
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 5 deletions

View File

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