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

Command line includes don't work when coming from a git submodule #59

Open
riuriuriu opened this issue Aug 20, 2021 · 5 comments
Open

Comments

@riuriuriu
Copy link

Running:

kas build myboard.yml:mysubmodule/mirrors.yml

Results in error:

ERROR    - All concatenated config files must belong to the same repository or all must be outside of versioning control

The file mysubmodule/mirrors.yml truly isn't from the same Repo but also isn't handled by KAS. It is just a git submodule and is nowhere mentioned in myboard.yml. Shouldn't KAS allow to use it?

The use case is that we have shared KAS include files which set common source mirrors, sstate-cache, build server options and others. And it would be nice to be able to set them on the command line to be able to choose certain configs dynamically.

The ideal way would be to have KAS check out the git repo with common kas files and still be able to reference them from the command line. But the documentation says that's prohibited. My current work-around is to share them with a git submodule which isn't handled by KAS. But as mentioned above, KAS refuses to include files from it which is really strange.

@jan-kiszka
Copy link
Collaborator

The command line include mechanism is not able to handle files from repos referenced in the main config file. There is e.g. no syntax to express that. But as you may have another repo already lying around, checked out on a previous run, referencing an include from there could work by chance - but not on clean rebuilds. That's why we check for such cases and prevent surprises.

Now, having the includes in a git submodule of the top-level repo would practically work (if you tell your users to perform a submodule checkout as well). If you can find a way to detect that case, we can relax the check.

@jan-kiszka
Copy link
Collaborator

Still relevant?

@fmoessbauer
Copy link
Member

Just found this issue by accident. We internally have basically the same use-case with a kas library (to share common config and extension points like sstate, mirrors, etc...) . The current workaround is to first checkout with kas, then manually copy the shared config into the top repo and then include via the CLI.

@riuriuriu Maybe you should get involved in the discussion about the conditional includes. This solves part of it by introducing a new mechanism to handle includes based on environment variables. And it also works cross-repo in a single kas invocation.

@CramBL
Copy link

CramBL commented Oct 23, 2024

Just found this issue by accident. We internally have basically the same use-case with a kas library (to share common config and extension points like sstate, mirrors, etc...) . The current workaround is to first checkout with kas, then manually copy the shared config into the top repo and then include via the CLI.

@riuriuriu Maybe you should get involved in the discussion about the conditional includes. This solves part of it by introducing a new mechanism to handle includes based on environment variables. And it also works cross-repo in a single kas invocation.

* RFC https://groups.google.com/g/kas-devel/c/ToygLPhvpvE

* Reference implementation https://github.com/fmoessbauer/kas/tree/fm/cond-includes-v1

We also have the same need and employ the same workaround

@fmoessbauer
Copy link
Member

I just sent a potential fix to the ML. Please involve yourself in https://groups.google.com/g/kas-devel/c/nK33kamBSfY

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

No branches or pull requests

4 participants