The last stage of rpm packaging is copying a clean final copy of all the files that will be shipped in an arborescence under a %{buildroot} prefix.
%{buildroot}
That is the deployment tree that is operated on to compute the actual requires and provides rpm will generate.
As a consequence of this rpm design we can not change:
%{buildroot}/something
something
/something
Since golist is used to compute provides and requires for Go sources, and those sources can include absolute symlinks, and will continue to prefer absolute symlinks over relative symlinks because relative symlinks are quite hard to get right, golist needs to learn to work in prefix mode:
Is this not all handled when in BUILD? Or is something changing as to when golist is called?
BUILD
golist
I don't remember where the files end up (under BUILD or BUILDROOT) and I may have mixed up the rpm variable representing rpm's last stage staging directory.
BUILDROOT
The basic point is that for Requires/Provides we are not calling golist explicitly, rpm is doing it in generator mode. And the filesystem tree rpm is operating in generator mode is a mirror of the target FHS structure, except / is replaced by a prefix directory.
Requires
Provides
/
That breaks absolute symlinks (they are already pointing to / not the prefix directory), so anything that walks the directory structure like golist needs to have special code for computing the correct symlink target in Requires/Provides generator mode. ie “the symlink is pointing to /foo/bar but I’m in prefix mode so the actual target is probably /prefix/foo/bar/”
/foo/bar
/prefix/foo/bar/
This could probably be made better rpm upstream side by making Requires/Provides on a container that fakes the root properly, but rpm was designed before containers existed and getting the containing logic right is hard .
Ok, I found a workaround. Let’s focus on still broken things for now
Metadata Update from @nim: - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.