Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Tue, 29 Jan 2019 15:59:10
Message-Id: 1548772977.9e84e77e779219d209a2474a7f04bfcd81212e6a.haubi@gentoo
1 commit: 9e84e77e779219d209a2474a7f04bfcd81212e6a
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 28 20:22:42 2019 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 29 14:42:57 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=9e84e77e
7
8 bootstrap-prefix.sh: selectively use stacked-prefix
9
10 Use stacked prefix only up to before merging sys-apps/portage itself
11 with dependencies, even for RAP now.
12 Closes: https://bugs.gentoo.org/676096
13
14 Signed-off-by: Michael Haubenwallner <haubi <AT> gentoo.org>
15
16 scripts/bootstrap-prefix.sh | 55 +++++++++++++++++++++++++++++++--------------
17 1 file changed, 38 insertions(+), 17 deletions(-)
18
19 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
20 index d74a35372d..f5be868d77 100755
21 --- a/scripts/bootstrap-prefix.sh
22 +++ b/scripts/bootstrap-prefix.sh
23 @@ -1736,12 +1736,22 @@ bootstrap_stage3() {
24 # PORTAGE_OVERRIDE_EPREFIX as BROOT is needed.
25 PREROOTPATH="${ROOT}"$(echo /{,tmp/}{usr/,}{,lib/llvm/{10,9,8,7,6,5}/}{s,}bin | sed "s, ,:${ROOT},g") \
26 EPREFIX="${ROOT}" PORTAGE_TMPDIR="${PORTAGE_TMPDIR}" \
27 - PORTAGE_OVERRIDE_EPREFIX="$(rapx "${ROOT}" "${ROOT}"/tmp)" \
28 - FEATURES="${FEATURES} force-prefix $(rapx "" stacked-prefix)" \
29 + FEATURES="${FEATURES} force-prefix" \
30 EMERGE_LOG_DIR="${ROOT}"/var/log \
31 do_emerge_pkgs "$@"
32 }
33
34 + with_stack_emerge_pkgs() {
35 + FEATURES="${FEATURES} stacked-prefix" \
36 + PORTAGE_OVERRIDE_EPREFIX="${ROOT}/tmp" \
37 + emerge_pkgs "$@"
38 + }
39 +
40 + without_stack_emerge_pkgs() {
41 + PORTAGE_OVERRIDE_EPREFIX="${ROOT}" \
42 + emerge_pkgs "$@"
43 + }
44 +
45 # Some packages fail to properly depend on sys-apps/texinfo.
46 # We don't really need that package, so we fake it instead,
47 # explicitly emerging it later on will overwrite the fakes.
48 @@ -1751,13 +1761,6 @@ bootstrap_stage3() {
49 fi
50
51 if is-rap ; then
52 - # Bug 655414. Copy portage global config from stage2
53 - # to stage3.
54 - if [[ ! -d "${ROOT}"/usr/share/portage ]]; then
55 - mkdir -p "${ROOT}"/usr/share
56 - cp -a "${ROOT}"{/tmp,}/usr/share/portage
57 - fi
58 -
59 # We need ${ROOT}/usr/bin/perl to merge glibc.
60 if [[ ! -x "${ROOT}"/usr/bin/perl ]]; then
61 # trick "perl -V:apiversion" check of glibc-2.19.
62 @@ -1779,7 +1782,7 @@ bootstrap_stage3() {
63 )
64
65 BOOTSTRAP_RAP=yes \
66 - emerge_pkgs --nodeps "${pkgs[@]}" || return 1
67 + with_stack_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
68 grep -q 'apiversion=9999' "${ROOT}"/usr/bin/perl && rm "${ROOT}"/usr/bin/perl
69
70 pkgs=(
71 @@ -1791,7 +1794,7 @@ bootstrap_stage3() {
72 RAP_DLINKER=$(echo "${ROOT}"/$(get_libdir)/ld*.so.[0-9])
73 export LDFLAGS="-L${ROOT}/usr/$(get_libdir) -Wl,--dynamic-linker=${RAP_DLINKER}"
74 BOOTSTRAP_RAP=yes \
75 - emerge_pkgs --nodeps "${pkgs[@]}" || return 1
76 + with_stack_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
77
78 # remove stage2 ld so that stage3 ld is used by stage2 gcc.
79 [[ -f ${ROOT}/tmp/usr/${CHOST}/bin/ld ]] && mv ${ROOT}/tmp/usr/${CHOST}/bin/ld{,.stage2}
80 @@ -1809,7 +1812,7 @@ bootstrap_stage3() {
81 ${linker}
82 )
83
84 - emerge_pkgs --nodeps "${pkgs[@]}" || return 1
85 + with_stack_emerge_pkgs --nodeps "${pkgs[@]}" || return 1
86 fi
87
88 # On some hosts, gcc gets confused now when it uses the new linker,
89 @@ -1843,9 +1846,12 @@ bootstrap_stage3() {
90 EXTRA_ECONF="--disable-compiler-version-checks $(rapx --disable-lto)" \
91 MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \
92 PYTHON_COMPAT_OVERRIDE=python2.7 \
93 - emerge_pkgs --nodeps ${compiler} || return 1
94 + with_stack_emerge_pkgs --nodeps ${compiler} || return 1
95 # undo libgcc_s.so path of stage2
96
97 + # now we have the compiler right there
98 + unset CXX CPPFLAGS LDFLAGS
99 +
100 # On Darwin we have llvm-3.5 at this point, which provides nm.
101 # However for some reason this nm doesn't quite get it on newer
102 # platforms at least, resulting in bugs like #598336. To cater for
103 @@ -1864,7 +1870,10 @@ bootstrap_stage3() {
104 export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin"
105
106 # get a sane bash, overwriting tmp symlinks
107 - emerge_pkgs "" "app-shells/bash" || return 1
108 + with_stack_emerge_pkgs "" "app-shells/bash" || return 1
109 +
110 + # now we have a shell right there
111 + unset CONFIG_SHELL
112
113 # Build portage and dependencies.
114 pkgs=(
115 @@ -1884,7 +1893,7 @@ bootstrap_stage3() {
116 # OSX, confusing the buildsystem
117 ac_cv_c_decl_report=warning \
118 TIME_T_32_BIT_OK=yes \
119 - emerge_pkgs "" "${pkgs[@]}" || return 1
120 + with_stack_emerge_pkgs "" "${pkgs[@]}" || return 1
121
122 if [[ ! -x "${ROOT}"/sbin/openrc-run ]]; then
123 echo "We need openrc-run at ${ROOT}/sbin to merge rsync." \
124 @@ -1899,11 +1908,23 @@ bootstrap_stage3() {
125 sys-devel/gettext
126 sys-apps/portage
127 )
128 +
129 + # Bug 655414, 676096.
130 + # Enough packages emerged using stacked-prefix with tmp/ as base prefix
131 + # to allow for sys-apps/portage itself and dependencies without any
132 + # dependency into tmp/ now.
133 + # Portage does search it's global config using PORTAGE_OVERRIDE_EPREFIX,
134 + # so we need to provide it there - emerging portage itself is expected
135 + # to finally overwrite it.
136 + if [[ ! -d "${ROOT}"/usr/share/portage ]]; then
137 + mkdir -p "${ROOT}"/usr/share
138 + cp -a "${ROOT}"{/tmp,}/usr/share/portage
139 + fi
140 +
141 USE="ssl" \
142 - emerge_pkgs "" "${pkgs[@]}" || return 1
143 + without_stack_emerge_pkgs "" "${pkgs[@]}" || return 1
144
145 # Switch to the proper portage.
146 - unset CONFIG_SHELL CXX CPPFLAGS LDFLAGS
147 hash -r
148
149 # Update the portage tree.