diff --git a/toolkit/Makefile b/toolkit/Makefile index 2af1c866b9..9198808b51 100644 --- a/toolkit/Makefile +++ b/toolkit/Makefile @@ -38,6 +38,7 @@ IMAGE_CACHE_SUMMARY ?= INITRD_CACHE_SUMMARY ?= PACKAGE_ARCHIVE ?= PACKAGE_BUILD_RETRIES ?= 1 +REFRESH_WORKER_CHROOT ?= y # Set to 0 to use the number of logical CPUs. CONCURRENT_PACKAGE_BUILDS ?= 0 # Set to 0 to print all available results. diff --git a/toolkit/docs/building/building.md b/toolkit/docs/building/building.md index 0869491919..231899961e 100644 --- a/toolkit/docs/building/building.md +++ b/toolkit/docs/building/building.md @@ -52,6 +52,9 @@ - [`REBUILD_TOOLS=...`](#rebuild_tools) - [`REBUILD_TOOLS=`**`n`** *(default)*](#rebuild_toolsn-default) - [`REBUILD_TOOLS=`**`y`**](#rebuild_toolsy) + - [`REFRESH_WORKER_CHROOT=...`](#refresh_worker_chroot) + - [`REFRESH_WORKER_CHROOT=`**`n`**](#refresh_worker_chrootn) + - [`REFRESH_WORKER_CHROOT=`**`y`** *(default)*](#refresh_worker_chrooty-default) - [All Build Targets](#all-build-targets) - [Reproducing a Build](#reproducing-a-build) - [Build Summaries](#build-summaries) @@ -487,6 +490,20 @@ sudo make hydrate-rpms PACKAGE_ARCHIVE=./rpms.tar.gz > Build the go tools from source as needed. +#### `REFRESH_WORKER_CHROOT=...` + +##### `REFRESH_WORKER_CHROOT=`**`n`** + +> If exists, don't attempt to rebuild the worker chroot, even if its build script, its manifest, or the packages it consists of have been modified in the local repository. + +##### `REFRESH_WORKER_CHROOT=`**`y`** *(default)* + +> Rebuild the worker chroot every time at least one of the following has changed: +> +> - worker chroot's manifest file, +> - at least one of the RPM packages mentioned in the manifest file, or +> - the script responsible for building the chroot. + ## All Build Targets These are the useful build targets: diff --git a/toolkit/scripts/tools.mk b/toolkit/scripts/tools.mk index cf3c9f4c4f..a162931cf8 100644 --- a/toolkit/scripts/tools.mk +++ b/toolkit/scripts/tools.mk @@ -135,16 +135,18 @@ worker_chroot_manifest = $(TOOLCHAIN_MANIFESTS_DIR)/$(worker_manifest_name) # the exact path of the required rpm # Outputs: $(RPMS_DIR)//..rpm sed_regex_full_path = 's`(.*\.([^\.]+)\.rpm)`$(toolchain_rpms_dir)/\2/\1`p' -sed_regex_arch_only = 's`(.*\.([^\.]+)\.rpm)`\2`p' worker_chroot_rpm_paths := $(shell sed -nr $(sed_regex_full_path) < $(worker_chroot_manifest)) worker_chroot_deps := \ $(worker_chroot_manifest) \ $(worker_chroot_rpm_paths) \ - $(toolchain_rpms) \ $(PKGGEN_DIR)/worker/create_worker_chroot.sh +ifeq ($(REFRESH_WORKER_CHROOT),y) $(chroot_worker): $(worker_chroot_deps) +else +$(chroot_worker): +endif $(PKGGEN_DIR)/worker/create_worker_chroot.sh $(BUILD_DIR)/worker $(worker_chroot_manifest) $(toolchain_rpms_dir) $(LOGS_DIR) validate-chroot: $(go-validatechroot) $(chroot_worker)