SDK: drop python3.8 bootstrap workarounds - make_chroot: drop the python-exec rewrite. The bootstrap SDK is python3.13-only, so python-exec already points at python3.13. - make_chroot: also drop the ._unmerge_ cleanup. The bootstrap SDK already has the current portage, so portage no longer replaces itself. - chroot_version_hooks: make 228 a no-op. Its purge is no longer needed, but SDKs record chroot version 228, so the file has to stay. BUG=b/582685887 TEST=presubmit RELEASE_NOTE=None Change-Id: I9a5c84a6eeee26b5a5859ef5f0b80c95806f580e Reviewed-on: https://cos-review.googlesource.com/c/third_party/platform/crosutils/+/239407 Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com> Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
diff --git a/chroot_version_hooks.d/228_purge_py38_sdk b/chroot_version_hooks.d/228_purge_py38_sdk index 9a81dd2..9cc4770 100644 --- a/chroot_version_hooks.d/228_purge_py38_sdk +++ b/chroot_version_hooks.d/228_purge_py38_sdk
@@ -10,23 +10,8 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# Clean up python packages dropped from the SDK as part of moving the SDK -# from python3.8 to python3.13 (b/582685887). These do not work on -# python3.13 and nothing in the SDK depends on them anymore. `gsutil` in the -# chroot now resolves to chromite/bin/gsutil. -pkgs=( - dev-python/future - dev-python/gcs-oauth2-boto-plugin - dev-python/google-apitools - dev-python/google-reauth-python - dev-python/keyring - dev-python/oauth2client - dev-python/pyshark - dev-python/python-evdev - dev-python/secretstorage - net-misc/gsutil -) -mapfile -t installed_pkgs < <(qlist -eICS "${pkgs[@]}" || :) -if [[ ${#installed_pkgs[@]} -gt 0 ]]; then - sudo emerge --rage -q "${installed_pkgs[@]}" -fi +# This hook is used to unmerge python packages dropped from the +# 3.8 to 3.13 python transition. Newer SDKs and bootstrap SDKs +# only ship 3.13, so there is nothing left to remove. The file +# has to stay since the SDKs record chroot version 228 and +# chromite needs a hook for the newest recorded version.
diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 7d6a7c0..5c8adcf 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh
@@ -211,18 +211,6 @@ if [[ "${FLAGS_skip_chroot_upgrade}" -eq "${FLAGS_FALSE}" ]]; then info "Updating portage" early_enter_chroot emerge -uNv --quiet --ignore-world portage - - # The seed SDK's python-exec config prefers python3.8, but portage was - # just rebuilt for the SDK's PYTHON_TARGETS (python3.13 only). Point - # python-exec at python3.13 so scripts with a python3 shebang (chromite - # tools, install hooks) can import portage. - early_enter_chroot sed -i -e '$a python3.13' \ - -e '/^-\{0,1\}python[0-9.]*$/d' /etc/python-exec/python-exec.conf - - # Portage replacing itself can leave the old instance's FEATURES=ipc FIFO - # behind under ._unmerge_. RBE refuses to upload named pipes from the - # build's exec root, which fails the job after the SDK is built. - early_enter_chroot rm -rf /var/tmp/portage/._unmerge_ fi # Add chromite into python path. for python_path in "${FLAGS_chroot}/usr/lib/"python*.*; do