Skip to content

build: fix generator deps and simplify Makefile.am - #177

Merged
giuseppe merged 4 commits into
containers:mainfrom
kolyshkin:fix-generator-deps
Oct 12, 2026
Merged

giuseppe merged 4 commits into
containers:mainfrom
kolyshkin:fix-generator-deps

Conversation

@kolyshkin

@kolyshkin kolyshkin commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

A few build system fixes and cleanups, one per commit:

  • The stamps driving the generation only depended on json_common.{c,h},
    so a change to generate.py or to the modules it imports did not
    trigger anything -- the tree kept the sources produced by the previous
    version of the generator until someone cleaned it by hand. The
    generator sources are now prerequisites of every stamp.

  • Every generated source and header was listed twice: in SOURCE_FILES,
    and again in a hand-written rule tying it to a stamp. The two lists had
    drifted apart (runtime_spec_schema_config_zos.h was missing from the
    stamp rules). The stamp prerequisites are now derived from per-generator
    variables, so the lists are stated once.

  • The per-test _SOURCES / _LDADD blocks only restated automake
    defaults; LDADD is now set once.

Net effect on Makefile.am: -140 lines. make check and make distcheck
pass, and the intermediate commits build and test individually.

@kolyshkin
kolyshkin force-pushed the fix-generator-deps branch 2 times, most recently from af0b4e9 to ad718ed Compare September 10, 2026 20:29
@kolyshkin kolyshkin changed the title build: rebuild the generated sources when the generator changes build: fix generator deps and simplify Makefile.am Sep 10, 2026
@kolyshkin

Copy link
Copy Markdown
Collaborator Author

@giuseppe PTAL

@giuseppe

Copy link
Copy Markdown
Member

Sorry I've missed these for so long. There are merge conflicts, please merge once fixed

The stamps that drive the generation only depend on json_common.{c,h},
so a change to generate.py or to the modules it imports does not trigger
anything: make reports there is nothing to be done, the tree keeps the
sources generated by the previous version of the generator, and the
change appears to have no effect until someone cleans the tree by hand.

Add the generator sources to the prerequisites of every stamp.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
The empty line in the middle of the src/image_spec_stamp recipe is
harmless but confusing; remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Every generated source and header was listed twice: once in SOURCE_FILES,
and once more in a hand-written rule tying it to the stamp of the
generator run that produces it. The two lists drifted apart --
runtime_spec_schema_config_zos.h was missing from the stamp rules
entirely, and only the $(HEADER_FILES): %.h: %.c rule kept it building.

Split SOURCE_FILES into one variable per generator run and derive the
stamp prerequisites from those, headers included. The lists are now
stated once, and a file added to a group cannot be forgotten in the
rules.

The $(HEADER_FILES): %.h: %.c rule becomes redundant: every header now
depends on its stamp directly.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Automake defaults prog_SOURCES to the program name with a .c suffix, and
prog_LDADD to LDADD, so the per-test blocks only restated the defaults.

Set LDADD once and drop them, along with TESTS_LDADD.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@kolyshkin

Copy link
Copy Markdown
Collaborator Author

Sorry I've missed these for so long.

You and me both... I totally forgot.

There are merge conflicts, please merge once fixed

No merge button for me here ¯\_(ツ)_/¯

@giuseppe
giuseppe merged commit 3918f56 into containers:main Oct 12, 2026
7 checks passed
@giuseppe

Copy link
Copy Markdown
Member

No merge button for me here ¯\_(ツ)_/¯

added now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants