-
Notifications
You must be signed in to change notification settings - Fork 196
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
rust/treefile: Add basearch key #1766
Conversation
We already had this logic, but it was in `libvm.sh`. Prep for using it elsewhere.
We're really using this variable to substitute `${basearch}` and find basearch-specific packages. Let's rename the variable to make that more obvious.
Add a `basearch` key to the manifest. This can be used at compose time to assert the architecture the compose is running on. Though my motivation is for the common case where it gets omitted from the input manifest and gets automatically added by rpm-ostree into `/usr/share/rpm-ostree/treefile.json` for introspection on the client. (The crucial part here is that the treefile created by rpm-ostree remains deserializable into a `TreeComposeConfig`). Closes: coreos/fedora-coreos-tracker#154
Nice! |
⚡ Test exempted: merge already tested. |
We're really using this variable to substitute `${basearch}` and find basearch-specific packages. Let's rename the variable to make that more obvious. Closes: #1766 Approved by: cgwalters
Add a `basearch` key to the manifest. This can be used at compose time to assert the architecture the compose is running on. Though my motivation is for the common case where it gets omitted from the input manifest and gets automatically added by rpm-ostree into `/usr/share/rpm-ostree/treefile.json` for introspection on the client. (The crucial part here is that the treefile created by rpm-ostree remains deserializable into a `TreeComposeConfig`). Closes: coreos/fedora-coreos-tracker#154 Closes: #1766 Approved by: cgwalters
I just learned about |
Yes, it follows the same spec as the input manifest, on which we maintain backwards compatibility. (Though actually... we just "broke" the output format recently by renaming some fields from using underscores to dashes :| ). We might stop emitting some fields and start emitting new fields as the input treefile itself changes (since we use Though this discussion makes me think maybe it wouldn't be a bad idea to start versioning the spec. |
I asked because I'd like to depend on this but at the same time I don't want to force the hand on stabilizing the whole struct. Perhaps another idea is to adopt in a read-only way https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-using_yum_variables. |
Hmm OK, are you thinking of deserializing the whole file as per the
Thinking more on this now though, I think I do understand your hesitation a bit: the treefile in the end is only an input file to the compose process. So we're abusing it a bit by using it to derive information about the system it sits on and making it part of the host API. While
I think that could work, though WDYT about just adding an entry for this in |
Discussed out-of-band: while the We thus prefer going for a new field (strawman As a sidenote, initramfs also has its own os-release (provided by dracut) which may need to be mutated by rpm-ostree. |
Is this really specific to rpm-ostree though? Aren't there use cases for getting the rpm basearch inside containers with (Actually implementing it for our container builds is a separate thing though) |
Prep for this in coreos/fedora-coreos-config#68.
Hmm, though AFAICT, |
Add a
basearch
key to the manifest. This can be used at compose timeto assert the architecture the compose is running on. Though my
motivation is for the common case where it gets omitted from the input
manifest and gets automatically added by rpm-ostree into
/usr/share/rpm-ostree/treefile.json
for introspection on the client.(The crucial part here is that the treefile created by rpm-ostree
remains deserializable into a
TreeComposeConfig
).Closes: coreos/fedora-coreos-tracker#154