Example with "iperf" and the "threads" USE flag. On a binary server, I compile "iperf" with "threads" not set. On a host that uses that binary server, I do "emerge -g iperf" and the binary from the server is fetched. I now set the "threads" USE flag on both machines. On the binary server, "emerge -uDN world" leads to the package being recompiled, with "threads" set. On the host, "emerge -guDN world" leads to the package being recompiled, with "threads" set. Only if I remove the iperf tbz2 from /usr/portage/packages is the "changed" binary fetched from the server. It's as if the host does not know there is a "changed" binary available that matches the changed requirements. For me, this is currently blocking the use of Portage as a tool to maintain a wide range of setups: if I modify the profile (common to server and host) and update the server and then the host, the host will not fetch the binary but attempt a recompile (not only impossible, since it has no access to the internet to fetch the sources, but also undesired because of the compile time) Note: an emerge -GuDN does not update anything on the host, not from binary, not from ebuild. Portage: 2.1.6.4 Reproducible: Always Steps to Reproduce:
When using the new protocol, it is supposed to replace the local binary package with the remote one if you use -G. However, the -N option will cause the remote package to be rejected if you it's flags are not a perfect match for your local USE settings. Make sure that you have PORTAGE_BINHOST variable pointing to the directory which corresponds to $PKGDIR on the remote host (not the All/ subdirectory). This is necessary in order for the new protocol to work. If it's pointing at the All/ subdirectory then it will use the old protocol which does not support the behavior that you want. Please post output for the following commands: emerge -pvN iperf emerge -pvg iperf emerge -pvG iperf
Om the host: PORTAGE_BINHOST="ftp://10.11.10.66/AutoDistro/Compiled" On the server, /AutoDistro/Compiled is a directory with package categories as directories and a Packages file, no All directory (2.1.6.4 is the only Portage version that was ever installed on both machines). On the host, the following output is produced: (iperf is installed from binary with -threads, now attempting to update with your commands) # emerge -pvN iperf These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-misc/iperf-2.0.2 USE="ipv6 threads* -debug" 229 kB # emerge -pvg iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 threads* -debug" Total: 1 package (1 reinstall), Size of downloads: 0 kB # emerge -pvG iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 threads* -debug" Total: 1 package (1 reinstall), Size of downloads: 0 kB
The 3 commands I have incorrectly put in the comment above are *after deleting* the -threads binary from the host, which I did to check what would happen then. The problem I report seems to be caused when a "wrong" binary is available locally. Here is the output of the 3 commands in that case: # emerge -pvN iperf These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-misc/iperf-2.0.2 USE="ipv6 threads* -debug" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB # emerge -pvg iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 -debug -threads" Total: 1 package (1 reinstall), Size of downloads: 0 kB # emerge -pvG iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 -debug -threads" Total: 1 package (1 reinstall), Size of downloads: 0 kB
(In reply to comment #3) > # emerge -pvG iperf > > These are the packages that would be merged, in order: > > Calculating dependencies... done! > [binary R ] net-misc/iperf-2.0.2 USE="ipv6 -debug -threads" > > Total: 1 package (1 reinstall), Size of downloads: 0 kB > It seems as if the package on the server does not have the threads flag enabled. Please post the entry for that package from the ftp://10.11.10.66/AutoDistro/Compiled/Packages file. There should be a local cached copy located at /var/cache/edb/binhost/10.11.10.66/AutoDistro/Compiled/Packages. Also, please verify that the locally cached copy is identical to the remote version.
And again I have overlooked something. I hope you can still take me seriously :) Indeed, the server had the -threads version installed and packaged. I have corrected this and now the host tells me: # emerge -pvN iperf These are the packages that would be merged, in order: Calculating dependencies... done! [ebuild R ] net-misc/iperf-2.0.2 USE="ipv6 threads* -debug" 0 kB Total: 1 package (1 reinstall), Size of downloads: 0 kB # emerge -pvg iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 -debug -threads" Total: 1 package (1 reinstall), Size of downloads: 0 kB # emerge -pvG iperf These are the packages that would be merged, in order: Calculating dependencies... done! [binary R ] net-misc/iperf-2.0.2 USE="ipv6 -debug -threads" Total: 1 package (1 reinstall), Size of downloads: 0 kB I check the server Packages file, it says. CPV: net-misc/iperf-2.0.2 DEPEND: virtual/libc DESC: tool to measure IP bandwidth using UDP or TCP IUSE: ipv6 threads debug KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd LICENSE: as-is MD5: c436fb8a24e35f6baa879ae3bfe7436a MTIME: 1236164521 RDEPEND: virtual/libc SHA1: 5c8966f059411c8f449a181ca41683434d71bcb1 SIZE: 48733 USE: ipv6 threads REPO: gentoo The host Packages file says: CPV: net-misc/iperf-2.0.2 DEPEND: virtual/libc DESC: tool to measure IP bandwidth using UDP or TCP IUSE: ipv6 threads debug KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd LICENSE: as-is MD5: ca75d085c23d817cd04568333d4559ee MTIME: 1236098145 RDEPEND: virtual/libc SHA1: 42d955fecb9c0a07ae4a34d7145b17eb847c8d9a SIZE: 47397 USE: ipv6 REPO: gentoo The server Packages file cached on the host says: CPV: net-misc/iperf-2.0.2 DEPEND: virtual/libc DESC: tool to measure IP bandwidth using UDP or TCP IUSE: ipv6 threads debug KEYWORDS: amd64 hppa ~ppc ppc64 x86 ~x86-fbsd LICENSE: as-is MD5: c436fb8a24e35f6baa879ae3bfe7436a MTIME: 1236164521 RDEPEND: virtual/libc SHA1: 5c8966f059411c8f449a181ca41683434d71bcb1 SIZE: 48733 USE: ipv6 threads REPO: gentoo
Created attachment 183929 [details, diff] fix remote metadata to override local metadata for --getbinpkgonly If this patch is saved as /tmp/getbinpkgonly.patch then it can be applied as follows: patch /usr/lib/portage/pym/portage/dbapi/bintree.py /tmp/getbinpkgonly.patch
Thanks, I'll try it tomorrow morning (CET). Two questions: - will the patch make it into an official release? - is there a reason for doing it for -G and not for -g?
(In reply to comment #7) > - will the patch make it into an official release? Yes. I'm planning to release it in 2.2_rc24 this weekend, and in 2.1.6.8 the following week. > - is there a reason for doing it for -G and not for -g? I guess we can assume that the user always wants to prefer remote package instances when --getbinpkg is enabled, so I'll make it do that in any case.
Created attachment 183943 [details, diff] fix remote metadata to override local metadata for --getbinpkg This does the same thing as the previous patch and also enables the same behavior for --getbinpkg.
This is fixed in 2.2_rc24 which is in package.mask. I'll close this bug when it's also released in 2.1.6.8.
This is released in 2.1.6.8.