Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[berkeley] feat: fix scripts to use different paths if mina is a submodule of o1js #14239

Closed
13 changes: 11 additions & 2 deletions src/lib/crypto/kimchi_backend/common/gen_version.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/usr/bin/env bash
set -e -o pipefail
if [ -z ${MARLIN_REPO_SHA+x} ]; then
marlin_submodule_dir=$(git submodule status | grep proof-systems | sed 's/^[-\ ]//g' | cut -d ' ' -f 2)
marlin_repo_sha=$(cd $marlin_submodule_dir && git rev-parse --short=8 --verify HEAD)
# Check for the existence of the 'mina' submodule
git_root=$(git rev-parse --show-toplevel)
mina_submodule=$(git submodule status | grep "mina" || true)

if [[ -n "$mina_submodule" ]]; then
marlin_submodule_dir=$(git -C "$git_root/src/mina" submodule status | grep proof-systems | sed 's/^[-\ ]//g' | cut -d ' ' -f 2)
marlin_repo_sha=$(git -C "$git_root/src/mina/$marlin_submodule_dir" rev-parse --short=8 --verify HEAD)
else
marlin_submodule_dir=$(git submodule status | grep proof-systems | sed 's/^[-\ ]//g' | cut -d ' ' -f 2)
marlin_repo_sha=$(git -C "$marlin_submodule_dir" rev-parse --short=8 --verify HEAD)
fi
else
marlin_repo_sha=$(cut -b -8 <<< "$MARLIN_REPO_SHA")
fi
Expand Down
7 changes: 6 additions & 1 deletion src/lib/mina_version/normal/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ pushd "$root" > /dev/null
if [[ -e .git ]] && ! git diff --quiet; then id="[DIRTY]$id"; fi
commit_date="${MINA_COMMIT_DATE-$(git show HEAD -s --format="%cI" || echo "<unknown>")}"

pushd src/lib/crypto/proof-systems > /dev/null
mina_submodule=$(git submodule status | grep "mina" || true)
if [[ -n "$mina_submodule" ]]; then
pushd src/mina/src/lib/crypto/proof-systems > /dev/null
else
pushd src/lib/crypto/proof-systems > /dev/null
fi
marlin_commit_id="${MARLIN_COMMIT_ID-$(git rev-parse --verify HEAD || echo "<unknown>")}"
marlin_commit_id_short="$(printf '%s' "$marlin_commit_id" | cut -c1-8)"
if [[ -e .git ]] && ! git diff --quiet; then marlin_commit_id="[DIRTY]$marlin_commit_id"; fi
Expand Down
2 changes: 1 addition & 1 deletion src/libp2p_ipc/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(library
(name libp2p_ipc)
(public_name libp2p_ipc)
(flags -w -53)
(flags -w -53-55)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair question! Nix fails while building libnp2p_ipcs, ignoring warning 55 while building src/libp2p_ipcs/libp2p_ipcs_capnp.ml seems to fix it. See this internal discussion for more details.

(inline_tests (flags -verbose -show-counts))
(libraries
;; opam libraries
Expand Down