Skip to content

Commit ae6b414

Browse files
committed
[TEMP] Pull in regex apt/pip fix from sonic-net#28144 to unblock CI
TEMPORARY: pulls the build-infra fix from sonic-net#28144 (author: yijingyan2) to unblock this PR's CI. The shared 'Build sonic image' stage currently fails on ALL platforms with: Cannot uninstall regex 2024.11.6 ... no RECORD file was found for regex hint: The package was installed by debian because python3-regex is apt-installed without a pip RECORD, so pip cannot upgrade it when the sonic-utilities wheel (via docker-image-py) requires a newer regex. This is unrelated to this PR's docker-sonic-vs changes. DROP THIS COMMIT on the next rebase once sonic-net#28144 has merged into master. Original-change-by: yijingyan2 Ref: sonic-net#28144 Signed-off-by: securely1g <securely1g@users.noreply.github.com>
1 parent 2818c7d commit ae6b414

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

files/build_templates/sonic_debian_extension.j2

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,12 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in
224224
install_pip_package {{sonic_yang_mgmt_py3_wheel_path}}
225225

226226
# Install some dependencies for pyangbind
227-
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install python3-lxml python3-regex
227+
# python3-regex is intentionally NOT installed here. The Debian apt package
228+
# (python3-regex) installs into dist-packages without a pip RECORD file, so pip
229+
# cannot uninstall/upgrade it later. When a downstream wheel (e.g. sonic-utilities
230+
# via docker-image-py) requires a newer regex, pip fails with "uninstall-no-record-file".
231+
# Let pip own regex instead: it is pulled in transitively by pyangbind below.
232+
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install python3-lxml
228233

229234
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install pyangbind==0.8.7
230235
sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 uninstall -y enum34

sonic-slave-trixie/Dockerfile.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ RUN apt-get remove -y libnl-3-200
546546

547547
RUN eatmydata apt-get -y build-dep openssh
548548

549+
# Let pip own these (avoid apt vs pip no-RECORD uninstall conflicts)
550+
RUN eatmydata apt-get remove -y python3-regex || true
551+
549552
# Build fix for ARM64 and ARMHF /etc/debian_version
550553
{%- if CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" %}
551554
RUN eatmydata apt upgrade -y base-files libc-bin=$(dpkg-query -W -f '${Version}' libc-bin)

0 commit comments

Comments
 (0)