Skip to content

Commit a5aa1b2

Browse files
committed
simplify mina version resolution and remove support for MINA_ROOT
1 parent ca1a7cf commit a5aa1b2

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

nix/ocaml.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ let
354354
PLONK_WASM_WEB = "${pkgs.plonk_wasm}/web";
355355

356356
configurePhase = ''
357-
export MINA_ROOT="$PWD"
358357
export -f patchShebangs isScript
359358
fd . --type executable -x bash -c "patchShebangs {}"
360359
export -n patchShebangs isScript

src/lib/mina_version/normal/dune

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
(implements mina_version))
1010

1111
(rule
12-
(targets mina_version.ml)
13-
(deps
14-
(sandbox none)
15-
(:< gen.sh)
16-
(universe))
17-
(action
18-
(run bash %{<} %{targets})))
12+
(target mina_version.ml)
13+
(deps (:< gen.sh))
14+
(action (run %{<} %{target})))

src/lib/mina_version/normal/gen.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# we are nested 6 directories deep (_build/<context>/src/lib/mina_version/normal)
5-
if [ -z ${MINA_COMMIT_SHA1+x} ]; then
6-
root="${MINA_ROOT-$(git rev-parse --show-toplevel || echo ../../../../../..)}"
7-
pushd "$root" > /dev/null
8-
id="${MINA_COMMIT_SHA1-$(git rev-parse --verify HEAD || echo "<unknown>")}"
9-
popd > /dev/null
10-
else
11-
id="${MINA_COMMIT_SHA1}"
12-
fi
4+
target=$1
135

6+
id="${MINA_COMMIT_SHA1:-$(git rev-parse --verify HEAD 2>/dev/null || echo "<unknown>")}"
147
id_short="$(printf "%s" "$id" | cut -c1-8)"
158

169
{

0 commit comments

Comments
 (0)