Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,32 +53,6 @@ LIBP2P_HELPER_SIG := $(shell cd src/app/libp2p_helper ; find . -type f -print0
help: ## Display this help information
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


########################################
.PHONY: add-o1labs-opam-repo
add-o1labs-opam-repo:
opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git

.PHONY: prepare
prepare: add-o1labs-opam-repo
@echo "Preparing the environment and installing dependencies..."
@# Check Go installation and version
@command -v go >/dev/null 2>&1 || { echo >&2 "Error: Go is not installed. Please install Go before continuing. You can use gvm to install the appropriate Go environment."; exit 1; }
@GO_VERSION=$$(go version | awk '{print $$3}' | sed 's/go//'); \
GO_MOD_PATH="src/app/libp2p_helper/src/go.mod"; \
REQUIRED_GO_VERSION=$$(grep -E "^go [0-9]+\.[0-9]" $$GO_MOD_PATH | awk '{print $$2}'); \
if ! printf '%s\n%s\n' "$$REQUIRED_GO_VERSION" "$$GO_VERSION" | sort -V | head -n1 | grep -q "^$$REQUIRED_GO_VERSION$$"; then \
echo "Error: Go version $$GO_VERSION is not compatible. Required version is $$REQUIRED_GO_VERSION or newer (only minor)."; \
exit 1; \
fi; \
echo "Go version $$GO_VERSION detected (requirement: $$REQUIRED_GO_VERSION or newer (only minor))"
opam switch import --switch mina --yes opam.export
eval $(opam env --switch=mina --set-switch)
chmod +x scripts/pin-external-packages.sh
./scripts/pin-external-packages.sh
@echo "Environment prepared. You can now run 'make build' to build the project."


########################################
## Code

Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/stages/1-build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ARG OPAM_VERSION=2.3.0
# `nix flake update opam-repository`).
# - scripts/update_opam_switch.sh
ARG OPAM_REPOSITORY_COMMIT=08d8c16c16dc6b23a5278b06dff0ac6c7a217356
ARG O1LABS_OPAM_REPOSITORY_COMMIT=dd90c5c72b7b7caeca3db3224b2503924deea08a
ARG O1LABS_OPAM_REPOSITORY_COMMIT=da14ce5463751e5b5b9ac565d8d37e04b4c1edc5

# Golang version number used to detemine tarball name
ARG GO_VERSION=1.19.11
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
inputs.describe-dune.inputs.nixpkgs.follows = "nixpkgs";
inputs.describe-dune.inputs.flake-utils.follows = "utils";

inputs.o1-opam-repository.url = "github:o1-labs/opam-repository/dd90c5c72b7b7caeca3db3224b2503924deea08a";
inputs.o1-opam-repository.url = "github:o1-labs/opam-repository/da14ce5463751e5b5b9ac565d8d37e04b4c1edc5";
inputs.o1-opam-repository.flake = false;

# The version must be the same as the version used in:
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-opam-switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ocaml_version=4.14.2
# `nix flake update opam-repository`).
# - scripts/update_opam_switch.sh
OPAM_REPOSITORY_COMMIT=08d8c16c16dc6b23a5278b06dff0ac6c7a217356
O1LABS_OPAM_REPOSITORY_COMMIT=dd90c5c72b7b7caeca3db3224b2503924deea08a
O1LABS_OPAM_REPOSITORY_COMMIT=da14ce5463751e5b5b9ac565d8d37e04b4c1edc5

if [[ -d _opam ]]; then
read -rp "Directory '_opam' exists and will be removed. You can also bypass the check by setting the variable BYPASS_OPAM_SWITCH_UPDATE to any value. Continue? [y/N] " \
Expand Down