11# gno-ibc Makefile.
22#
3- # `make install-gno` runs tools/setup-stdlibs.py, which clones the pinned gno
4- # repo into a per-user cache, symlinks every package under stdlibs/ into
5- # <cache>/gnovm/ stdlibs/<module>/, regenerates the native-binding dispatch
6- # table (`go generate`), and installs the resulting `gno`, `gnodev`, and `gnokey` binaries .
3+ # `make install-gno` clones the pinned gno toolchain into a per-user cache
4+ # and installs `gno`, `gnoland`, `gnodev`, and `gnokey` from it. The IBC
5+ # crypto stdlibs (bn254, cometbls, cometblszk, keccak256, merkle, modexp)
6+ # ship in the upstream pin, so this repo no longer vendors them locally .
77#
88# Bump GNO_COMMIT in .gno-version to roll the upstream toolchain.
99
@@ -14,8 +14,8 @@ include .gno-version
1414SHELL := /bin/bash
1515.SHELLFLAGS := -o pipefail -c
1616
17- # Exported so `make install-gno GNO_COMMIT=...` propagates the override into
18- # tools/setup-stdlibs.py, which otherwise reads .gno-version directly .
17+ # Exported so `make install-gno GNO_COMMIT=...` overrides the pin from the
18+ # command line without editing .gno-version.
1919export GNO_COMMIT GNO_REPO
2020
2121GNO_CACHE := $(HOME ) /.cache/gno-ibc/gno
@@ -87,30 +87,24 @@ vendor-flags = $(if $(filter undefined,$(origin FLAGS_$(subst /,_,$(1)))),$(STD_
8787# rsync only auto-creates the leaf dest dir, so mkdir -p covers intermediates.
8888vendor-cmd = mkdir -p $(dir gno.land/$(2 ) ) && rsync $(RSYNC_BASE ) $(call vendor-flags,$(2 ) ) $(1 ) /$(2 ) / gno.land/$(2 ) /
8989
90- .PHONY : help install-gno link-stdlibs verify-gno vendor fmt test test-cover test-stdlibs test-smoke test-gnokey-query-smoke test-gnokey-qeval-smoke test-zkgm-native-refund-smoke clean-gno-cache refresh-abi-vectors refresh-zkgm-scenarios derive-sender-salt-vectors generate generate-check
90+ .PHONY : help install-gno verify-gno vendor fmt test test-cover test-smoke test-gnokey-query-smoke test-gnokey-qeval-smoke test-zkgm-native-refund-smoke clean-gno-cache refresh-abi-vectors refresh-zkgm-scenarios derive-sender-salt-vectors generate generate-check
9191
9292PROTOGEN_PKGS := gno.land/p/core/ibc/lightclients/cometbls
9393
9494COVERAGE_DIR := coverage
9595
96- # Vendored stdlib import paths, derived from stdlibs/<path>/gnomod.toml presence.
97- STDLIB_PKGS := $(patsubst stdlibs/% /gnomod.toml,% ,$(wildcard stdlibs/* /* /gnomod.toml) )
98- # Subset that ships a Go-side native binding (vs pure-gno). Detected via .go presence.
99- STDLIB_NATIVE := $(foreach p,$(STDLIB_PKGS ) ,$(if $(wildcard stdlibs/$(p ) /* .go) ,$(p ) ) )
10096# First-party gno packages. Third-party mirrors under gno.land/p/{aib,gnoswap,nt,onbloc}
10197# and gno.land/r/aib are dependency inputs only, so local and CI tests skip them.
10298USER_GNO_PKGS := $(patsubst % /gnomod.toml,./% /,$(shell find gno.land/p/core gno.land/r/core -name gnomod.toml | sort) )
10399
104100help :
105101 @echo " Targets:"
106- @echo " install-gno — vendor stdlibs/, regenerate, build+install gno + gnodev + gnokey"
107- @echo " link-stdlibs — refresh stdlib symlinks only (no rebuild)"
102+ @echo " install-gno — clone pinned gno and install gno + gnoland + gnodev + gnokey"
108103 @echo " verify-gno — assert the gno binary is on PATH"
109104 @echo " vendor — mirror sparse third_party package sub-paths into gno.land/"
110105 @echo " fmt — gofumpt -w on uncommitted .go/.gno files (modified, staged, untracked)"
111106 @echo " test — verify-gno + vendor, then run first-party gno tests"
112107 @echo " test-cover — same as test, plus -cover (needs gno PR #4241; override GNO_COMMIT)"
113- @echo " test-stdlibs — run the vendored stdlib's own .gno and .go tests"
114108 @echo " test-smoke — run only the env-prep smoke tests"
115109 @echo " test-gnokey-query-smoke — run the full gnokey smoke suite"
116110 @echo " test-gnokey-qeval-smoke — run only the gnokey maketx/qeval core smoke suite"
@@ -125,14 +119,19 @@ help:
125119 @echo " Pinned: $( GNO_REPO) @$( GNO_SHORT) (.gno-version)"
126120
127121install-gno :
128- @python3 tools/setup-stdlibs.py
129-
130- # Refresh stdlib symlinks under the cached gno checkout without rebuilding
131- # the binary. Used in CI when the binary cache hits but .gno files in
132- # stdlibs/ may have been added/removed (edits to existing files are picked
133- # up automatically since symlinks resolve to the working-tree path).
134- link-stdlibs :
135- @python3 tools/setup-stdlibs.py --link-only
122+ @if [ ! -d $( GNO_CACHE) /.git ]; then \
123+ mkdir -p $(dir $(GNO_CACHE ) ) ; \
124+ echo " >> cloning $( GNO_REPO) into $( GNO_CACHE) " ; \
125+ git clone --quiet --filter=blob:none $(GNO_REPO ) $(GNO_CACHE ) ; \
126+ fi
127+ @cd $(GNO_CACHE ) && \
128+ git cat-file -e $(GNO_COMMIT ) ^{commit} 2> /dev/null || git fetch --quiet origin; \
129+ git reset --quiet --hard; \
130+ git checkout --quiet $(GNO_COMMIT )
131+ @echo " >> installing gno @ $( GNO_SHORT) "
132+ @$(MAKE ) -C $(GNO_CACHE ) /gnovm install
133+ @$(MAKE ) -C $(GNO_CACHE ) /gno.land install.gnoland install.gnokey
134+ @$(MAKE ) -C $(GNO_CACHE ) install.gnodev
136135
137136# Initialise/update the third_party submodules, ensure sparse-checkout is set,
138137# and rsync the relevant subdirectories into the gno.land workspace paths.
@@ -156,7 +155,7 @@ verify-gno:
156155 @gno version 2>&1 | grep -q $(GNO_SHORT ) || { \
157156 gno version; \
158157 echo " ERROR: 'gno' on PATH does not match pinned commit $( GNO_SHORT) ." ; \
159- echo " Run 'make install-gno' to rebuild against the current pin + stdlibs/ ." ; \
158+ echo " Run 'make install-gno' to rebuild against the current pin." ; \
160159 exit 1; }
161160 @echo " ok: gno binary matches pinned commit $( GNO_SHORT) "
162161
@@ -188,17 +187,6 @@ test-cover: verify-gno vendor
188187 @gno test -cover -coverprofile=$(COVERAGE_DIR ) /profile.txt -v $(USER_GNO_PKGS ) 2>&1 \
189188 | tee $(COVERAGE_DIR ) /output.log
190189
191- # Stdlib sources live under stdlibs/ but their gnomod.toml declares stdlib
192- # paths, so `gno test ./stdlibs/...` would reject them as user mempackages.
193- # Test them by import path (gno) and via the cache (go).
194- test-stdlibs : verify-gno
195- @for pkg in $(STDLIB_PKGS ) ; do \
196- echo " >> gno test $$ pkg" ; \
197- gno test -v $$ pkg || exit 1; \
198- done
199- @echo " >> go test (native bindings)"
200- @cd $(GNO_CACHE ) /gnovm && go test $(addprefix ./stdlibs/,$(STDLIB_NATIVE ) )
201-
202190test-smoke : verify-gno
203191 @gno test ./gno.land/p/core/_smoke/ -v
204192
0 commit comments