My use case for Gentoo Prefix is: Use portage available in some cygwin prefix (x86_64-pc-cygwin) to merge packages required for a native windows application into a separate native windows prefix (eg. i686-msvc-winnt, think i686-w64-mingw32) on the same host machine. However, I do not want to set up a full fledged cross compilation environment, because: * the cygwin environment can execute the windows binaries just fine, * most packages I need do have better support for "native windows" already (with CBUILD == CHOST) than for "cross compilation" (with CBUILD != CHOST), * I want to use the windows prefix on the very same machine without the need to move out of some ROOT location first. Instead, I do want to use kind of a multilib build environment (CBUILD == CHOST). But beyond that we don't do multilib in Prefix, I don't want the windows packages be merged into the cygwin prefix, because the cygwin prefix is needless for the windows application runtime. Recently (bug#655326, bug#655414), due to EAPI 7, the bootstrap procedure for Gentoo Prefix turned out to be a similar use case: Portage is bootstrapped into some /prefix/tmp (stage1), with a minimal additional set of packages merged to /prefix/tmp (stage2). That /prefix/tmp portage instance then is used to create the final /prefix (stage3), with build dependencies (EAPI 7 wise) used from /prefix/tmp (stage2, BROOT), but *preferred* from /prefix (stage3, EPREFIX). In the past I used to call this situation "prefix chaining" (bug#309125, bug#509136, bug#642456), but "stacked prefix" probably is a more obvious term.
Created attachment 536500 [details, diff] 'stacked-prefix' feature, patch draft With this patch, bootstrapping Gentoo Prefix does work again by setting FEATURES='stacked-prefix' for the target EPREFIX=/prefix during stage3 while portage is running from BROOT=/prefix/tmp. For the moment, this patch is embedded in the bootstrap-prefix.sh script: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=ce515e60309e2e2c51577410b111209eec5754d0
Hi Michael, This is an interesting patch. I am surprised how short it is regarding how much it could achieve. Benda
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=96b0650dfe6ec38d1c02541d20b0adaf492032d9 commit 96b0650dfe6ec38d1c02541d20b0adaf492032d9 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2018-07-03 08:49:01 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2018-07-03 08:49:01 +0000 python-utils-r1.eclass: switch to stacked-prefix feature USE=prefix-chain now is FEATURES=stacked-prefix Bug: https://bugs.gentoo.org/658572 eclass/python-utils-r1.eclass | 54 +++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 36 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=10631c412bbc9d66b666bf178f860a9b848d9880 commit 10631c412bbc9d66b666bf178f860a9b848d9880 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2018-07-03 13:22:51 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2018-07-03 13:23:36 +0000 dev-libs/openssl: use Configure perl from PATH With stacked-prefix, EPREFIX/usr/bin/perl may not exist. But PATH should be fine anyway to find perl, no? Bug: https://bugs.gentoo.org/658572 Package-Manager: Portage-2.3.24, Repoman-2.3.6 Manifest-Sign-Key: 0x29FB0E9EC719EE20 dev-libs/openssl/Manifest | 19 +++++++++++++++++++ dev-libs/openssl/openssl-1.0.2n.ebuild | 2 +- dev-libs/openssl/openssl-1.0.2o-r6.ebuild | 2 +- dev-libs/openssl/openssl-1.1.0g-r2.ebuild | 3 +-- dev-libs/openssl/openssl-1.1.0h-r2.ebuild | 3 +-- 5 files changed, 23 insertions(+), 6 deletions(-)
It turns out that this should be activated via (implicit) USE=prefix-stack rather than via FEATURES=stacked-prefix, to allow for USE-dependencies and USE constraints, like it was before with USE=prefix-chain.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e22c4864d978f2687ee17b424991ece36816f02a commit e22c4864d978f2687ee17b424991ece36816f02a Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-25 13:18:50 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:52 +0000 package.mask: Last rite "prefix-chain" packages Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> profiles/package.mask | 6 ++++++ 1 file changed, 6 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95e7ad8baea71587377e50d84d392803a466f90e commit 95e7ad8baea71587377e50d84d392803a466f90e Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-22 14:00:50 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:51 +0000 profiles: drop prefix-chain implicit USE flag Renaming prefix-chain to prefix-stack is completed now. Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> profiles/base/make.defaults | 2 +- profiles/base/use.mask | 1 - profiles/embedded/make.defaults | 2 +- profiles/embedded/use.mask | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=84b9f582e8c8db69a3b3677de702c7cc00ac3dab commit 84b9f582e8c8db69a3b3677de702c7cc00ac3dab Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-20 09:35:34 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:51 +0000 app-portage/prefix-toolkit: new package * For any Gentoo Prefix, provides the 'startprefix' script, and should provide some 'runprefix' script later on, as inspired in Bug: https://bugs.gentoo.org/673816 * For base Gentoo Prefix (as in "not stacked"), provides the 'prefix-stack-setup' script, superseding app-portage/prefix-chain-setup, does force the prefix-stack implit USE flag in the stacked Prefix. * For stacked Gentoo Prefix (set up using 'prefix-stack-setup'), provides the toolchain wrapper, superseding sys-apps/prefix-chain-utils. Bug: https://bugs.gentoo.org/658572 Closes: https://bugs.gentoo.org/509142 Package-Manager: Portage-2.3.51, Repoman-2.3.11 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> app-portage/prefix-toolkit/metadata.xml | 8 + app-portage/prefix-toolkit/prefix-toolkit-0.ebuild | 565 +++++++++++++++++++++ 2 files changed, 573 insertions(+) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80990571f5727429f78bcd98c70c1e176d288172 commit 80990571f5727429f78bcd98c70c1e176d288172 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-22 13:43:28 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:51 +0000 sys-apps/baselayout-prefix-2.2: drop prefix-chain USE flag and patch This topic is called prefix-stack now and available with baselayout-prefix-2.6 and new app-portage/prefix-toolkit package. Bug: https://bugs.gentoo.org/658572 Package-Manager: Portage-2.3.62-prefix, Repoman-2.3.12 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> .../baselayout-prefix-2.2-r5.ebuild | 28 ++------- .../files/baselayout-2.2-prefix-chaining.patch | 67 ---------------------- 2 files changed, 5 insertions(+), 90 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c7a2936698f22bd710a3e0d9c282cfb8a1139b67 commit c7a2936698f22bd710a3e0d9c282cfb8a1139b67 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-22 13:30:38 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:50 +0000 sys-apps/baselayout-prefix: revbump Incorporate original baselayout-2.6, add patches to support prefix-guest and prefix-stack. The latter triggers the EAPI 7 bump. Bug: https://bugs.gentoo.org/658572 Package-Manager: Portage-2.3.62-prefix, Repoman-2.3.12 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> sys-apps/baselayout-prefix/Manifest | 6 + .../baselayout-prefix/baselayout-prefix-2.6.ebuild | 328 +++++++++++++++++++++ sys-apps/baselayout-prefix/metadata.xml | 9 +- 3 files changed, 340 insertions(+), 3 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9ee4ad7ae8b0226e2819727b4849aee2196c498 commit d9ee4ad7ae8b0226e2819727b4849aee2196c498 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-20 08:44:31 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 14:18:50 +0000 profiles: introduce prefix-stack implicit USE flag Will supersede the prefix-chain implicit USE flag. Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> profiles/base/make.defaults | 2 +- profiles/base/use.mask | 1 + profiles/embedded/make.defaults | 2 +- profiles/embedded/use.mask | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=beae731778eee1216ad4d94d52935617598320ae commit beae731778eee1216ad4d94d52935617598320ae Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-22 16:30:51 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 12:01:32 +0000 sys-apps/portage: replace prefix-chaining patch All the prefix-chaining patches do not apply any more. This has switched over to FEATURES=stacked-prefix, and again switched over to USE=prefix-stack. Current prefix-portage is at FEATURES=stacked-prefix, so there still is a patch necessary, although unconditionally now. Bug: https://bugs.gentoo.org/658572 Package-Manager: Portage-2.3.62-prefix, Repoman-2.3.12 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> .../files/portage-2.2.14-prefix-chaining.patch | 873 ------------------- .../files/portage-2.3.18-prefix-chaining.patch | 927 --------------------- .../files/portage-2.3.40-prefix-chaining.patch | 921 -------------------- .../files/portage-2.3.62-prefix-stack.patch | 80 ++ .../files/portage-2.3.8-prefix-chaining.patch | 927 --------------------- sys-apps/portage/metadata.xml | 1 - sys-apps/portage/portage-2.3.52.2.ebuild | 6 +- sys-apps/portage/portage-2.3.55.1.ebuild | 4 +- sys-apps/portage/portage-2.3.62-r00.1.ebuild | 271 ++++++ sys-apps/portage/portage-2.3.62.ebuild | 4 +- 10 files changed, 355 insertions(+), 3659 deletions(-) https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=954efef84a53cdbd10393fd71a37bd9cc3286ac9 commit 954efef84a53cdbd10393fd71a37bd9cc3286ac9 Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-25 11:36:26 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 12:01:32 +0000 python-utils-r1.eclass: support USE=prefix-stack Need to support FEATURES=stacked-prefix for some transition period. Better not test with 'use prefix-stack' but 'has prefix-stack ${USE}', for when the user's profile does not set IUSE_IMPLICIT=prefix-stack yet. Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> eclass/python-utils-r1.eclass | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=f8c03c3512c1f2d2b9db7ac92fe02ee5df031dce commit f8c03c3512c1f2d2b9db7ac92fe02ee5df031dce Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-03-25 11:31:18 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-03-25 11:53:50 +0000 bootstrap-prefix.sh: set USE=prefix-stack Keep FEATURES=stacked-prefix until we bumped stage1 portage as well. Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> scripts/bootstrap-prefix.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Created attachment 570716 [details, diff] from FEATURES=stacked-prefix to USE=prefix-stack The patch for prefix-portage switching to USE=prefix-portage.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=28ab1487a7154b816aa261c3118c148c7fa6f6bf commit 28ab1487a7154b816aa261c3118c148c7fa6f6bf Author: Michael Haubenwallner <haubi@gentoo.org> AuthorDate: 2019-04-25 07:10:57 +0000 Commit: Michael Haubenwallner <haubi@gentoo.org> CommitDate: 2019-04-25 07:16:53 +0000 "prefix-chain": Remove last-rited pkgs app-portage/prefix-chain-setup sys-apps/prefix-chain-utils Bug: https://bugs.gentoo.org/658572 Signed-off-by: Michael Haubenwallner <haubi@gentoo.org> app-portage/prefix-chain-setup/metadata.xml | 8 - .../prefix-chain-setup-0.6.ebuild | 223 ------------------- .../prefix-chain-setup-0.7.ebuild | 238 --------------------- profiles/package.mask | 6 - .../files/prefix-chain-wrapper.in | 83 ------- sys-apps/prefix-chain-utils/files/startprefix.in | 45 ---- sys-apps/prefix-chain-utils/metadata.xml | 8 - .../prefix-chain-utils-0.2-r7.ebuild | 64 ------ 8 files changed, 675 deletions(-)
Michael, do you have a plan to upstream the stacked prefix feature?
There is no detailed plan for how to get this upstream, but the goal still is alive - maybe additionally driven by demand like: https://archives.gentoo.org/gentoo-user/message/d4e5c6889985b3fa224a15468c241b7c