[dev] Adding a switch to skip chroot rebuilds (#1622)

This commit is contained in:
Pawel Winogrodzki 2021-11-04 23:33:38 -07:00 коммит произвёл GitHub
Родитель ab48ab7a32
Коммит 2a065b97fc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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:

Просмотреть файл

@ -135,16 +135,18 @@ worker_chroot_manifest = $(TOOLCHAIN_MANIFESTS_DIR)/$(worker_manifest_name)
# the exact path of the required rpm
# Outputs: $(RPMS_DIR)/<arch>/<name>.<arch>.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)