respect REPO_OFFLINE when building the cookbook tool

REPO_OFFLINE=1 was already passing --offline to recipe cargo builds
but the cargo build for the repo binary itself was still hitting
crates.io. This fixes that and adds a cargo-fetch target to
pre-populate the cache while online.
This commit is contained in:
Ojus Chugh 2026-02-28 16:28:50 +05:30
parent 700101f28b
commit 4ed0a556ae
2 changed files with 14 additions and 1 deletions

View File

@ -35,11 +35,16 @@ else
$(REPO_BIN) fetch installer redoxfs
endif
CARGO_OFFLINE_FLAG=
ifeq ($(REPO_OFFLINE),1)
CARGO_OFFLINE_FLAG=--offline
endif
$(FSTOOLS_TAG): $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) build --manifest-path Cargo.toml --release --locked
$(HOST_CARGO) build --manifest-path Cargo.toml --release --locked $(CARGO_OFFLINE_FLAG)
mkdir -p $(@D)
touch $@
endif

View File

@ -39,6 +39,14 @@ else
$(REPO_BIN) fetch $(COOKBOOK_OPTS) --with-package-deps
endif
# Fetch Cargo dependencies for the cookbook tool (needed for REPO_OFFLINE=1 builds)
cargo-fetch: FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) fetch --manifest-path Cargo.toml --locked
endif
# Find recipe for one or more targets separated by comma
find.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)