Browse Source

Merge cookbook's own examples into fcos-dev.ign

`make fcos-vm` builds build/fcos-dev.ign but never merged the current
project's own *-examples.ign, even though it was listed as a prerequisite
and staged into butane's -d dir. The generated .bu only referenced what
was passed to default-butane-spec.sh, and -examples was appended to the
dependencies but never to $(PROJECT_NAME). Units gated on config that
ships only as an example (e.g. ConditionPathExists) therefore stayed
inactive on a fresh dev VM.

Introduce a SELF variable so the dev spec includes the project's own
examples while the test spec is left unchanged. base is filtered out of
DEPS for its own build, so base-examples is not duplicated.

Fixes #4

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pull/5/head
Nicolas Massé 2 days ago
parent
commit
673a57c48a
  1. 8
      scripts/common.mk

8
scripts/common.mk

@ -472,12 +472,14 @@ $(TOP_LEVEL_DIR)/build/local.ign: $(TOP_LEVEL_DIR)/local.bu
.INTERMEDIATE: build/fcos-dev.bu build/fcos-test.bu .INTERMEDIATE: build/fcos-dev.bu build/fcos-test.bu
# Generate the Butane specs for development and testing by merging the current project's spec with those of the dependencies. # Generate the Butane specs for development and testing by merging the current project's spec with those of the dependencies.
# The development spec also includes the examples of the dependencies. # The development spec also includes the examples of the current project and of its dependencies.
# Whereas the testing spec only includes the main specs of the dependencies. # Whereas the testing spec only includes the main specs of the current project and of its dependencies.
build/fcos-dev.bu build/fcos-test.bu: DEPS := $(if $(filter-out base,$(PROJECT_NAME)),base $(DEPENDENCIES),$(DEPENDENCIES)) build/fcos-dev.bu build/fcos-test.bu: DEPS := $(if $(filter-out base,$(PROJECT_NAME)),base $(DEPENDENCIES),$(DEPENDENCIES))
build/fcos-dev.bu: DEPS := $(DEPS) $(addsuffix -examples,$(DEPS)) build/fcos-dev.bu: DEPS := $(DEPS) $(addsuffix -examples,$(DEPS))
build/fcos-test.bu: SELF := $(PROJECT_NAME)
build/fcos-dev.bu: SELF := $(PROJECT_NAME) $(PROJECT_NAME)-examples
build/fcos-dev.bu build/fcos-test.bu: %.bu: Makefile $(SCRIPTS_DIR)/default-butane-spec.sh build build/fcos-dev.bu build/fcos-test.bu: %.bu: Makefile $(SCRIPTS_DIR)/default-butane-spec.sh build
$(SCRIPTS_DIR)/default-butane-spec.sh $(PROJECT_NAME) $(DEPS) > $@ $(SCRIPTS_DIR)/default-butane-spec.sh $(SELF) $(DEPS) > $@
# Generate the final Fedora CoreOS ignition files (dev & test) by merging the Butane spec with the local and project-specific ignition files, as well as those of the dependencies. # Generate the final Fedora CoreOS ignition files (dev & test) by merging the Butane spec with the local and project-specific ignition files, as well as those of the dependencies.
build/fcos-dev.ign: $(TOP_LEVEL_DIR)/build/local.ign build/$(PROJECT_NAME).ign build/$(PROJECT_NAME)-examples.ign $(DEPENDENCIES_IGNITION_EXAMPLES_FILES) build/fcos-dev.ign: $(TOP_LEVEL_DIR)/build/local.ign build/$(PROJECT_NAME).ign build/$(PROJECT_NAME)-examples.ign $(DEPENDENCIES_IGNITION_EXAMPLES_FILES)

Loading…
Cancel
Save