Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document components design rules #637

Open
matentzn opened this issue Jul 27, 2022 · 2 comments
Open

Document components design rules #637

matentzn opened this issue Jul 27, 2022 · 2 comments
Milestone

Comments

@matentzn
Copy link
Contributor

  1. A component make target MUST NOT, directly or indirectly, depend on any ODK generated files/make targets, in particular not: imports, seeds, merged source files and other components.
  2. In the case you do have a logical dependency, you have to manage the dependency yourself by 1) generating the dependency with make first and 2) using the generated file in the make target of the dependent file (i.e. the component) without having an explicit make dependency.
@matentzn matentzn added this to the 1.3.3 milestone Nov 13, 2022
@jamesamcl
Copy link

What's the justification for these rules?

@gouttegd
Copy link
Contributor

@udp: Avoiding circular dependencies.

For example, generating the import modules requires, among other steps, extracting the “seed” file. That extraction in turn requires both the -edit file and all the declared components.

If a component was dependent on an import module, you would end up in a situation where you would need to generate the imports before you can make the component, but you would need the component before you can generate the imports.

Forbidding custom components from depending on other Make targets allows us to assume that such a conundrum cannot happen.

@matentzn matentzn modified the milestones: 1.5, 1.6 Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants