Skip to content

Commit

Permalink
add Nix derivation workaround (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Oct 17, 2024
1 parent 44f94c3 commit 4afb052
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions scripts/build_nim.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env bash
# used in Travis CI and AppVeyor scripts

# Copyright (c) 2018-2020 Status Research & Development GmbH. Licensed under
# Copyright (c) 2018-2024 Status Research & Development GmbH. Licensed under
# either of:
# - Apache License, version 2.0
# - MIT license
# at your option. This file may not be copied, modified, or distributed except
# 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_HASH="" # full hash for NIM_COMMIT, retrieved in "nim_needs_rebuilding()"
Expand Down Expand Up @@ -121,7 +119,14 @@ build_nim() {
# 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/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
# Run Nim buildchain, with matching dependency versions
Expand Down

0 comments on commit 4afb052

Please sign in to comment.