Skip to content

Commit f23d01c

Browse files
authored
Merge pull request #4502 from vvbandeira/bump-pip-in-dev-image
fix(deps): raise pip before the hashed lock install
2 parents 19480a2 + f6e8939 commit f23d01c

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎docker/Dockerfile.dev‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ WORKDIR /tmp/installer/etc
99

1010
COPY DependencyInstaller.sh .
1111
COPY requirements-common_lock.txt .
12+
COPY requirements-pip_lock.txt .
1213

1314
COPY InstallerOpenROAD.sh \
1415
/tmp/installer/tools/OpenROAD/etc/DependencyInstaller.sh

‎etc/DependencyInstaller.sh‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,31 @@ _installPipCommon() {
3939
source /opt/rh/rh-python38/enable
4040
set -u
4141
fi
42-
local lockfile
42+
local lockfile piplock
4343
lockfile="${_script_dir}/requirements-common_lock.txt"
44+
piplock="${_script_dir}/requirements-pip_lock.txt"
4445
if [[ "$OSTYPE" == "darwin"* ]]; then
4546
if [[ "$EUID" -eq 0 ]]; then
4647
echo "Error: Do NOT run with sudo."
4748
exit 1
4849
fi
4950
if [[ -n "${VIRTUAL_ENV:-}" ]]; then
50-
pip3 install --no-cache-dir -r "$lockfile"
51+
python3 -m pip install --no-cache-dir -r "$lockfile"
5152
else
5253
echo "Error: Activate a virtual environment on macOS."
5354
exit 1
5455
fi
5556
else
57+
# pip before 23.3 fails --require-hashes on requirements-common_lock.txt:
58+
# it does not match an extras-bearing pin such as
59+
# googleapis-common-protos[grpc]==X against a plain request for the same
60+
# package. Raise pip first, from its own hashed lock.
5661
if [[ $(id -u) == 0 ]]; then
57-
pip3 install --no-cache-dir -r "$lockfile"
62+
python3 -m pip install --no-cache-dir --upgrade --require-hashes -r "$piplock"
63+
python3 -m pip install --no-cache-dir -r "$lockfile"
5864
else
59-
pip3 install --no-cache-dir --user -r "$lockfile"
65+
python3 -m pip install --no-cache-dir --user --upgrade --require-hashes -r "$piplock"
66+
python3 -m pip install --no-cache-dir --user -r "$lockfile"
6067
fi
6168
fi
6269
}

‎etc/DockerTag.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if [[ "$@" == "-dev" ]]; then
99
"./Dockerfile"
1010
"./etc/DependencyInstaller.sh"
1111
"./etc/requirements-common_lock.txt"
12+
"./etc/requirements-pip_lock.txt"
1213
"./tools/OpenROAD/etc/DependencyInstaller.sh"
1314
)
1415
cat "${file_list[@]}" | sha256sum | awk '{print substr($1, 1, 6)}'

‎etc/requirements-pip_lock.txt‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# pip bootstrap for etc/DependencyInstaller.sh. Kept out of
3+
# requirements-common_lock.txt because it must install with the old pip.
4+
# To update: pick a version, then take both hashes from
5+
# https://pypi.org/pypi/pip/<version>/json
6+
#
7+
pip==25.2 \
8+
--hash=sha256:578283f006390f85bb6282dffb876454593d637f5d1be494b5202ce4877e71f2 \
9+
--hash=sha256:6d67a2b4e7f14d8b31b8b52648866fa717f45a1eb70e83002f4331d07e953717

0 commit comments

Comments
 (0)