From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CFAE915802F for ; Fri, 24 Feb 2023 18:52:04 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0EF85E0932; Fri, 24 Feb 2023 18:52:04 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DCDF9E0932 for ; Fri, 24 Feb 2023 18:52:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1AF45340E5B for ; Fri, 24 Feb 2023 18:52:03 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6CDDC8BA for ; Fri, 24 Feb 2023 18:52:01 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1677264714.6e13b67bf6821221fbb9c006fd975329bf1f991b.sam@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 6e13b67bf6821221fbb9c006fd975329bf1f991b X-VCS-Branch: master Date: Fri, 24 Feb 2023 18:52:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: af39f4a1-c122-45a5-942e-b58ce95c7558 X-Archives-Hash: 71e699292bc525f28d1b88990f60b30b commit: 6e13b67bf6821221fbb9c006fd975329bf1f991b Author: Peter Foley pefoley com> AuthorDate: Fri Feb 24 04:29:08 2023 +0000 Commit: Sam James gentoo org> CommitDate: Fri Feb 24 18:51:54 2023 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6e13b67b More fixes for python bootstrap on cygwin After more testing, it appears that the previous logic to set MAJMIN was broken because CHOST wasn't defined yet. In addition, the failed attempt to fetch from github was breaking patching. Given that 3.8 is the last version actually in cygwinports, just rip out all that logic. Signed-off-by: Peter Foley pefoley.com> Closes: https://github.com/gentoo/prefix/pull/20 Signed-off-by: Sam James gentoo.org> scripts/bootstrap-prefix.sh | 54 ++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index ce939bfaf5..c82cb4c1a8 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -715,7 +715,7 @@ bootstrap_portage() { local tmpportdir=${ROOT}/tmp/${PORTDIR#${ROOT}} [[ -e "${tmpportdir}" ]] || ln -s "${PORTDIR}" "${tmpportdir}" - for d in "${ROOT}"/tmp/usr/lib/python${PYTHONMAJMIN}; do + for d in "${ROOT}"/tmp/usr/lib/python$(python_ver); do [[ -e ${d}/portage ]] || ln -s "${ROOT}"/tmp/usr/lib/portage/lib/portage ${d}/portage [[ -e ${d}/_emerge ]] || ln -s "${ROOT}"/tmp/usr/lib/portage/lib/_emerge ${d}/_emerge done @@ -997,11 +997,13 @@ bootstrap_gnu() { einfo "${A%.tar.*} successfully bootstrapped" } -if [[ ${CHOST} == *-cygwin* ]] ; then -PYTHONMAJMIN=3.9 # keep this number in line with PV below for stage1,2 -else -PYTHONMAJMIN=3.10 # keep this number in line with PV below for stage1,2 -fi +python_ver() { + if [[ ${CHOST} == *-cygwin* ]] ; then + echo 3.9 # keep this number in line with PV below for stage1,2 + else + echo 3.10 # keep this number in line with PV below for stage1,2 + fi +} bootstrap_python() { if [[ ${CHOST} == *-cygwin* ]] ; then @@ -1032,32 +1034,18 @@ bootstrap_python() { case ${CHOST} in (*-*-cygwin*) - local gitrev cygpyver pf pn patch_folder ffail + local cygpyver pf pn patch_folder - # try github first, if that fails, it means that cygwin has not - # archived that repo yet # ideally the version of python used by bootstrap would be one # that cygwin has packaged if we don't do exact matches on the # version then some patches may not apply cleanly - ffail=0 - gitrev="42494e325a050ba03638568d7318f8f0075e25fb" - efetch "https://github.com/cygwinports/python39/archive/${gitrev}.tar.gz" \ - || ffail=1 - if [[ -z ${ffail} ]]; then - gzip -dc "${DISTDIR}"/"${gitrev}.tar.gz" | tar -xf - - [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 - patch_folder="python39-${gitrev}" - else - cygpyver="3.9.9-1" - efetch "https://mirrors.kernel.org/sourceware/cygwin/x86_64/release/python39/python39-${cygpyver}-src.tar.xz" \ - || return 1 - xz -dc "${DISTDIR}"/"python39-${cygpyver}-src.tar.xz" | tar -xf - - [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 - patch_folder="python39-${cygpyver}.src" - ffail=0 - fi - [[ ${ffail} == 0 ]] || return 1 + cygpyver="3.9.9-1" + efetch "https://mirrors.kernel.org/sourceware/cygwin/x86_64/release/python39/python39-${cygpyver}-src.tar.xz" \ + || return 1 + xz -dc "${DISTDIR}"/"python39-${cygpyver}-src.tar.xz" | tar -xf - + [[ ${PIPESTATUS[*]} == '0 0' ]] || return 1 + patch_folder="python39-${cygpyver}.src" for pf in $( sed -ne '/PATCH_URI="/,/"/{s/.*="//;s/".*$//;p}' \ @@ -1916,7 +1904,7 @@ bootstrap_stage2() { GCC_MAKE_TARGET=all \ OVERRIDE_CXXFLAGS="${CPPFLAGS} -O2 -pipe" \ TPREFIX="${ROOT}" \ - PYTHON_COMPAT_OVERRIDE=python${PYTHONMAJMIN} \ + PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ emerge_pkgs --nodeps ${pkg} || return 1 if [[ "${pkg}" == *sys-devel/llvm* || ${pkg} == *sys-devel/clang* ]] ; @@ -1995,7 +1983,7 @@ bootstrap_stage3() { for pef in python{,3} python{,3}-config ; do rm -f "${ROOT}"/tmp/usr/bin/${pef} [[ ${pef} == *-config ]] && ppf=-config || ppf= - ( cd "${ROOT}"/tmp/usr/bin && ln -s python${PYTHONMAJMIN}${ppf} ${pef} ) + ( cd "${ROOT}"/tmp/usr/bin && ln -s python$(python_ver)${ppf} ${pef} ) done get_libdir() { @@ -2173,15 +2161,15 @@ bootstrap_stage3() { # setup for a scenario where python doesn't live in the target # prefix and no helpers are available ( cd "${ROOT}"/usr/bin && test ! -e python && \ - ln -s "${ROOT}"/tmp/usr/bin/python${PYTHONMAJMIN} ) + ln -s "${ROOT}"/tmp/usr/bin/python$(python_ver) ) # in addition, avoid collisions - rm -Rf "${ROOT}"/tmp/usr/lib/python${PYTHONMAJMIN}/site-packages/clang + rm -Rf "${ROOT}"/tmp/usr/lib/python$(python_ver)/site-packages/clang # Try to get ourself out of the mud, bug #575324 EXTRA_ECONF="--disable-compiler-version-checks $(rapx '--disable-lto --disable-bootstrap')" \ GCC_MAKE_TARGET=$(rapx all) \ MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \ - PYTHON_COMPAT_OVERRIDE=python${PYTHONMAJMIN} \ + PYTHON_COMPAT_OVERRIDE=python$(python_ver) \ pre_emerge_pkgs --nodeps ${compiler} || return 1 # Undo libgcc_s.so path of stage2 @@ -2193,7 +2181,7 @@ bootstrap_stage3() { # need special care, it depends on texinfo, #717786 pre_emerge_pkgs --nodeps sys-apps/gawk || return 1 - ( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python${PYTHONMAJMIN} ) + ( cd "${ROOT}"/usr/bin && test ! -e python && rm -f python$(python_ver) ) # Use $ROOT tools where possible from now on. if [[ $(readlink "${ROOT}"/bin/sh) == "${ROOT}/tmp/"* ]] ; then rm -f "${ROOT}"/bin/sh