Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Sat, 02 Jul 2022 17:58:33
Message-Id: 1656782521.3085a0a30f8439efeb3178a852af00109d29fcad.grobian@gentoo
1 commit: 3085a0a30f8439efeb3178a852af00109d29fcad
2 Author: Tom Gillespie <tgbugs <AT> gmail <DOT> com>
3 AuthorDate: Fri Jun 17 08:10:50 2022 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 2 17:22:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=3085a0a3
7
8 bootstrap-prefix.sh fixes for stage1 cygwin bash and python failures
9
10 bootstrap_gnu --disable-readline seems to work and seems to be needed
11 on cygwin now for bash 5.1 and cygwin-3.3.5-341
12
13 bootstrap_python update patches to use cygwin python39 patch set for
14 3.9.9 and source from their releases since only older versions are on
15 github and their gitweb does not support downloading snapshots,
16 requiring git, which makes it unsuitable for bootstrapping
17
18 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
19
20 scripts/bootstrap-prefix.sh | 46 ++++++++++++++++++++++++++++++++-------------
21 1 file changed, 33 insertions(+), 13 deletions(-)
22
23 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
24 index 2a28478970..aecca9d3e2 100755
25 --- a/scripts/bootstrap-prefix.sh
26 +++ b/scripts/bootstrap-prefix.sh
27 @@ -946,10 +946,8 @@ bootstrap_gnu() {
28 export ac_cv_path_POD2MAN=no
29
30 # Darwin9 in particular doesn't compile when using system readline,
31 - # but we don't need any groovy input at all, so just disable it,
32 - # except for Cygwin, where the patch above would fail to compile
33 - [[ ${PN} == "bash" && ${CHOST} != *-cygwin* ]] \
34 - && myconf="${myconf} --disable-readline"
35 + # but we don't need any groovy input handling at all, so just disable it
36 + [[ ${PN} == "bash" ]] && myconf="${myconf} --disable-readline"
37
38 # On e.g. musl systems bash will crash with a malloc error if we use
39 # bash' internal malloc, so disable it during it this stage
40 @@ -1059,16 +1057,37 @@ bootstrap_python() {
41
42 case ${CHOST} in
43 (*-*-cygwin*)
44 - # apply patches from cygwinports much like the ebuild does
45 - local gitrev pf pn
46 - gitrev="71f2ac2444946c97d892be3892e47d2a509e0e96" # python36 3.6.8
47 - efetch "https://github.com/cygwinports/python36/archive/${gitrev}.tar.gz" \
48 - || return 1
49 - gzip -dc "${DISTDIR}"/${gitrev}.tar.gz | tar -xf -
50 - [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1
51 + local gitrev cygpyver pf pn patch_folder ffail
52 +
53 + # try github first, if that fails, it means that cygwin has not
54 + # archived that repo yet
55 + # ideally the version of python used by bootstrap would be one
56 + # that cygwin has packaged if we don't do exact matches on the
57 + # version then some patches may not apply cleanly
58 +
59 + ffail=0
60 + gitrev="42494e325a050ba03638568d7318f8f0075e25fb"
61 + efetch "https://github.com/cygwinports/python39/archive/${gitrev}.tar.gz" \
62 + || ffail=1
63 + if [[ -z ${ffail} ]]; then
64 + gzip -dc "${DISTDIR}"/"${gitrev}.tar.gz" | tar -xf -
65 + [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1
66 + patch_folder="python39-${gitrev}"
67 + else
68 + cygpyver="3.9.9-1"
69 + efetch "https://mirrors.kernel.org/sourceware/cygwin/x86_64/release/python39/python39-${cygpyver}-src.tar.xz" \
70 + || return 1
71 + xz -dc "${DISTDIR}"/"python39-${cygpyver}-src.tar.xz" | tar -xf -
72 + [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1
73 + patch_folder="python39-${cygpyver}.src"
74 + ffail=0
75 + fi
76 + [[ ${ffail} == 0 ]] || return 1
77 +
78 for pf in $(
79 sed -ne '/PATCH_URI="/,/"/{s/.*="//;s/".*$//;p}' \
80 - < python36-${gitrev}/python3.cygport
81 + < "${patch_folder}/python39.cygport" \
82 + | grep -v rpm-wheels | grep -v revert-bpo
83 ); do
84 pf="python36-${gitrev}/${pf}"
85 for pn in {1..2} fail; do
86 @@ -1076,7 +1095,8 @@ bootstrap_python() {
87 eerror "failed to apply ${pf}"
88 return 1
89 fi
90 - patch -N -p${pn} -i "${pf}" --dry-run >/dev/null 2>&1 || continue
91 + patch -N -p${pn} -i "${pf}" --dry-run >/dev/null 2>&1 \
92 + || continue
93 echo "applying (-p${pn}) ${pf}"
94 patch -N -p${pn} -i "${pf}" || return 1
95 break