Conversation
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)
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
force-pushed
the
build-components-after-seeding
branch
from
September 25, 2026 08:11
179d4b4 to
df33094
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asprepare_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)