Avoid compiling cookbook on host

This commit is contained in:
Wildan M 2026-01-02 18:09:17 +07:00
parent 83d3149d7f
commit b007d20f92
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
2 changed files with 13 additions and 6 deletions

View File

@ -3,7 +3,7 @@
fstools: $(FSTOOLS_TAG) $(FSTOOLS)
# These tools run inside Podman if it is used, or on the host if Podman is not used
$(FSTOOLS): $(CONTAINER_TAG)
$(FSTOOLS): | prefix $(CONTAINER_TAG) $(FSTOOLS_TAG)
ifeq ($(PODMAN_BUILD),1)
ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
@ -14,12 +14,11 @@ else
rm -rf $@ $@.partial
mkdir -p $@.partial
ln -s ../../recipes $@.partial/recipes
$(MAKE) fstools_fetch PODMAN_BUILD=$(SKIP_CHECK_TOOLS)
# Install cookbook, installer, and redoxfs for host (may be outside of podman container)
# Compile installer and redoxfs for host (may be outside of podman container)
cd $@.partial && \
export CARGO_TARGET_DIR=../$@-target && \
$(HOST_CARGO) install --root . --path ../.. --locked && \
env -u RUSTUP_TOOLCHAIN ./bin/repo fetch installer redoxfs && \
$(HOST_CARGO) install --root . --path recipes/core/installer/source $(INSTALLER_FEATURES) && \
$(HOST_CARGO) install --root . --path recipes/core/redoxfs/source $(REDOXFS_FEATURES)
@ -27,11 +26,19 @@ else
touch $@
endif
$(FSTOOLS_TAG): $(FSTOOLS)
fstools_fetch: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
./target/release/repo fetch installer redoxfs
endif
$(FSTOOLS_TAG):
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else
$(HOST_CARGO) build --manifest-path Cargo.toml --release --locked
mkdir -p $(@D)
touch $@
endif

View File

@ -1,6 +1,6 @@
# Configuration file for recipe commands
$(REPO_TAG): prefix $(FILESYSTEM_CONFIG) | $(FSTOOLS_TAG) $(CONTAINER_TAG)
$(REPO_TAG): prefix $(FILESYSTEM_CONFIG) | $(FSTOOLS) $(FSTOOLS_TAG) $(CONTAINER_TAG)
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else