Skip to content

Force components to be generated after seeding/updating. - #35

Open
gouttegd wants to merge 2 commits into
mainfrom
build-components-after-seeding
Open

gouttegd wants to merge 2 commits into
mainfrom
build-components-after-seeding

Conversation

@gouttegd

Copy link
Copy Markdown
Collaborator

When a repository is seeded, for all configured components a dummy placeholder file is created -- this is necessary because the components are imported by the edit file, so they need to exist and be importable.

When seeding a new repository, it can be safely assumed that the edit file will be edited at some point after seeding, and this will naturally cause the generated-at-seed-time components to be considered outdated and therefore automatically rebuilt when calling make all_components (or any other target that depends on components, such as prepare_release).

But when a pre-existing ontology is updated in place to add a new component, the user may expect that the automatically geneated placeholder file will be automatically replaced by the actual component simply by running make all_components. This will not happen, however, because from Make's point of view the component file is up-to-date.

Make is strictly speaking correct, and the appropriate command to use is rather make recreate-components, which will force rebuilding (in fact in this case, build for the first time) the newly added component.

But it is difficult to argue that such a behaviour is correct from the ODK's point of view. The component file may be up-to-date as far as Make is concerned, but it is in fact not -- it has never been built once.

The workaround for this is to automatically create the $(TMPDIR)/stamp-component-{{ component.filename }} file when seeding, and to do that after the placeholder component file is itself created. This will force Make to consider that the component file is outdated, since the stamp file will be more recent.

See information-artifact-ontology/ontology-metadata#210 (comment)

When a repository is seeded, for all configured components a dummy
placeholder file is created -- this is necessary because the components
are imported by the edit file, so they need to exist and be importable.

When seeding a new repository, it can be safely assumed that the edit
file will be edited at some point after seeding, and this will naturally
cause the generated-at-seed-time components to be considered outdated
and therefore automatically rebuilt when calling `make all_components`
(or any other target that depends on components, such as
`prepare_release`).

But when a pre-existing ontology is updated in place to add a new
component, the user may expect that the automatically geneated
placeholder file will be automatically replaced by the actual component
simply by running `make all_components`. This will not happen, however,
because from Make's point of view the component file is up-to-date.

Make is strictly speaking correct, and the appropriate command to use is
rather `make recreate-components`, which will force rebuilding (in fact
in this case, build for the first time) the newly added component.

But it is difficult to argue that such a behaviour is correct from the
ODK's point of view. The component file may be up-to-date as far as Make
is concerned, but it is in fact not -- it has never been built once.

The workaround for this is to automatically create the
`$(TMPDIR)/stamp-component-{{ component.filename }}` file when seeding,
and to do that _after_ the placeholder component file is itself created.
This will force Make to consider that the component file is outdated,
since the stamp file will be more recent.

See information-artifact-ontology/ontology-metadata#210 (comment)
@gouttegd gouttegd self-assigned this Sep 25, 2026
The seeding process will now create stamp files in the src/ontology/tmp
directory, but such files must not be committed when the repository is
seeded for the first time.
@gouttegd
gouttegd force-pushed the build-components-after-seeding branch from 179d4b4 to df33094 Compare September 25, 2026 08:11
@gouttegd
gouttegd requested a review from matentzn September 25, 2026 08:36
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.

1 participant