-
Notifications
You must be signed in to change notification settings - Fork 198
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
Container image fails to build with 32-bit RPMs #4609
Comments
This issue seems to be specifically when a package of the same name but different architectures (x86_64 and i686, in this case) are installed together in a container image. |
I am also experiencing this, when trying to encapsulate a CentOS 9 container with both 64-bit and 32-bit glibc packages installed:
This doesn't happen when running The error seems to be coming from here: rpm-ostree/src/libpriv/rpmostree-refts.cxx Line 172 in 5dd7dc9
I'd hazard a guess that it's being called from here: rpm-ostree/rust/src/container.rs Line 278 in 5dd7dc9
|
Forgot to mention, I'm using rpm-ostree 2024.4 on CentOS Stream 9:
|
Hey @antheas , I see in #4953 you mentioned that you had patched your |
I just commented out the check. As this part of the code does not have the reach to know what is the architecture of each package, it can not be implemented properly. Therefore, it will always fail when there are two packages with the same name and different architecture. This check is only valid when there is a package in the list twice, which 1) can not happen (?) and 2) will error out anyway because of duplicate files. As such I would remove the check. Perhaps there should be extra logic to error out properly when there are duplicate files. Since I also faced an issue with the lutris dependencies, I think From c3787d4b13aed3a25aa358d98f027ddda6304f3a Mon Sep 17 00:00:00 2001
From: antheas <git@antheas.dev>
Date: Thu, 9 May 2024 21:56:29 +0200
Subject: [PATCH] skip multiple packages check to avoid 32bit packages breaking
---
src/libpriv/rpmostree-refts.cxx | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/libpriv/rpmostree-refts.cxx b/src/libpriv/rpmostree-refts.cxx
index 46f63621..cf83bae2 100644
--- a/src/libpriv/rpmostree-refts.cxx
+++ b/src/libpriv/rpmostree-refts.cxx
@@ -165,16 +165,17 @@ RpmTs::package_meta (const rust::Str name) const
{
// TODO: Somehow we get two `libgcc-8.5.0-10.el8.x86_64` in current RHCOS, I don't
// understand that.
- if (retval != nullptr)
- {
- auto nevra = header_get_nevra (h);
- g_autofree char *buf
- = g_strdup_printf ("Multiple installed '%s' (%s, %s)", name_c.c_str (),
- retval->nevra ().c_str (), nevra.c_str ());
- throw std::runtime_error (buf);
- }
+ // if (retval != nullptr)
+ // {
+ // auto nevra = header_get_nevra (h);
+ // g_autofree char *buf
+ // = g_strdup_printf ("Multiple installed '%s' (%s, %s)", name_c.c_str (),
+ // retval->nevra ().c_str (), nevra.c_str ());
+ // throw std::runtime_error (buf);
+ // }
retval = std::make_unique<PackageMeta> (h);
+ break;
}
if (retval == nullptr)
g_assert_not_reached ();
--
2.45.0 |
Thanks for the very informative insight @antheas ! Perhaps @cgwalters may also have some ideas here for the long-term solution. Maybe it is as simple as removing this check if it is redundant and not necessary. |
Actually I take that back, part of the error is the nevra. So potentially a solution is refactoring the check to cut out the version and keep name, architecture. Just don't know if it's worth fixing instead of removing.
|
I was planning on doing a patch to throw the error only if the architecture is the same (by doing some ugliness with I think it would be OK to drop the check entirely. RPM itself has built-in protections against duplicate packages being installed, so I think that if RPM allowed it to happen, it's reasonable to assume that it's valid. It appears that the layer chunking is done on the basis of I intend to prepare a patch that removes the check, and if it works well, I will submit it as a pull request. |
I went through all this and I can say it's a bit of a moot point. I have a patchset for rpm ostree that fixes the 32 bit bugs so that you can reprocess an image that contains 32 bit packages. However, creating a commit with rpm ostree will a lot of the time not be possible because there are multiple packages that of the same lib own the same /etc file, which causes rpm-ostree to panic. Normal dnf would just overwrite the file I decided to just strip rpm-ostree entirely and use ostree-rs-ext directly to repackage an oci image into an ostree commit here: It works a lot better and saves a lot more space than rpm-ostree itself without any of these bugs. However, I'm dealing with a lot of permissions issues that happen because folder permissions and owners get stripped during the processing of the container. I managed to get it into a point where it boots and works perfectly. However, when moving it to a GitHub Ubuntu action it broke again (sddm panics) and I'm looking into fixing that. The git history for that repo contains the patch set for rpm ostree (which doesn't fix it panicking for duplicate etc files during committing treefiles; but does for rechunking) |
@antheas Hm, do you have any more detail about what goes wrong with |
Yes, the library Probably happens because the hash of the file in both packages is different, otherwise OSTree would check it out once I suppose. Happens before creating the commit, after the commit container-encapsulate (both as part of the image command and standalone) runs correctly. |
@antheas I see. I can confirm that installing both 32 bit and 64 bit versions of unixODBC is still a problem with my patch:
I suppose this must only work when the files that the 32-bit and 64-bit versions of packages have in common are identical? i.e. it works fine with glibc. Given that, I'm not sure if this issue should actually be closed when my patch is merged, or if the maintainers would prefer to keep it open, or if a new issue specifically about packages that have identically-named but different-in-content files between architectures should be opened. I'm also not sure how that situation is supposed to work on non-ostree based systems; do you just end up with the version of the file from whatever architecture was installed most recently? It smells like trouble and nondeterminism. If the two architectures expect two different things to be installed in the same place, it seems like it would potentially problematic to have them both installed anywhere, ostree or no ostree. |
@antheas Would you happen to be familiar with any other packages that have that sort of issue, aside from unixODBC? |
Unfortunately I don't know of any other packages, as wine-core brings this dependency. And if it's removed its gone. There might be other packages if unixOCBD is not included in there I don't think this will ever cause an error. The difference might just be permissions or an extra comment As for it causing indeterministic behavior, that's up to rpm-ostree's design I think /etc files are a special area. Most package managers error out on duplicate files but I've never had it happen on /etc. So I assume you get the last architecture installed? |
Well, I had a couple theories, but ended up shooting them both down.
So, kind of out of ideas about why glibc is fine but unixODBC is not. One thing that I noticed is that the specfile for glibc calls out all of its
I thought maybe rpm-ostree was not interpreting the glob, but I haven't yet found any part of rpm-ostree's code that treats files differently if they are %config or not, and I'm not sure that there actually is one. I'm also not sure if the glob in the specfile is actually still in play by the time you've got a binary RPM, or if everything is fully resolved to actual paths by then - the |
Host system details
I am on Fedora Workstation 38 trying to build Fedora Silverblue 38.
Actual behavior:
Expected behavior:
Steps to reproduce it
I first encountered this issue trying to install Steam from RPMFusion. I have simplified being able to reproduce this by only installing the 32-bit
NetworkManager-libnm
package that is a dependency ofsteam
.Building to a local tree repository (not a container image) works.
Commands:
Output:
Building a container image does NOT work.
Commands:
Output:
Additional info:
A lot of 32-bit issues with
rpm-ostree compose tree
were addressed a few years ago. I wonder if the same fixes need to be applied torpm-ostree compose image
.#3161
Would you like to work on the issue?
I am not familiar enough with the internals of rpm-ostree to be able to work on this myself.
The text was updated successfully, but these errors were encountered: