Skip to content

Commit

Permalink
GHA/linux: fix pip3 install impacket breakage
Browse files Browse the repository at this point in the history
An upstream update `impacket` pip package started requiring `blinker`.
An older version is shipping with Ubuntu, causing this on install:
```
  Attempting uninstall: blinker
    Found existing installation: blinker 1.7.0
ERROR: Cannot uninstall blinker 1.7.0, RECORD file not found. Hint: The package was installed by debian.
```

Fix it by switching to venv and install everything separate from the
system.

The overhead is the same as using `pip --ignore-installed`, which also
installs everything from scratch.

The 3rd option is to uninstall the system `python3-blinker` package, but
it was the slowest.

Closes curl#15578
  • Loading branch information
vszakats committed Nov 14, 2024
1 parent 04b9054 commit 2638570
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/http3-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ jobs:
libtasn1-6-dev libidn2-0-dev gawk gperf libtss2-dev dns-root-data bison gtk-doc-tools \
texinfo texlive texlive-extra-utils autopoint libev-dev \
apache2 apache2-dev libnghttp2-dev vsftpd
python3 -m venv $HOME/venv
echo 'CC=gcc-12' >> $GITHUB_ENV
echo 'CXX=g++-12' >> $GITHUB_ENV
name: 'install prereqs'
Expand Down Expand Up @@ -501,12 +502,14 @@ jobs:
- name: 'install test prereqs'
run: |
sudo python3 -m pip install --break-system-packages -r tests/requirements.txt
source $HOME/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
- name: 'run tests'
env:
TFLAGS: "${{ matrix.build.tflags }}"
run: |
source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target test-ci
else
Expand All @@ -515,13 +518,15 @@ jobs:
- name: 'install pytest prereqs'
run: |
sudo python3 -m pip install --break-system-packages -r tests/http/requirements.txt
source $HOME/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest'
env:
TFLAGS: "${{ matrix.build.tflags }}"
CURL_CI: github
run: |
source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target curl-pytest-ci
else
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ jobs:
libtool autoconf automake pkgconf ninja-build stunnel4 \
libpsl-dev libbrotli-dev libzstd-dev \
${{ matrix.build.install_packages }}
python3 -m venv $HOME/venv
name: 'install prereqs'

- if: contains(matrix.build.name, 'i686')
Expand All @@ -301,6 +302,7 @@ jobs:
libtool autoconf automake pkgconf stunnel4 \
libpsl-dev:i386 libbrotli-dev:i386 libzstd-dev:i386 \
${{ matrix.build.install_packages }}
python3 -m venv $HOME/venv
name: 'install prereqs'

- if: contains(matrix.build.install_steps, 'pytest')
Expand Down Expand Up @@ -616,7 +618,8 @@ jobs:
- name: 'install test prereqs'
if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.container == null }}
run: |
sudo python3 -m pip install --break-system-packages -r tests/requirements.txt
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
python3 -m pip install -r tests/requirements.txt
- name: 'run tests'
if: ${{ matrix.build.install_steps != 'skipall' && matrix.build.install_steps != 'skiprun' }}
Expand All @@ -631,6 +634,7 @@ jobs:
TFLAGS+=' ~2077 ~2078' # valgrind errors
fi
fi
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
else
Expand All @@ -640,14 +644,16 @@ jobs:
- name: 'install pytest prereqs'
if: contains(matrix.build.install_steps, 'pytest')
run: |
sudo python3 -m pip install --break-system-packages -r tests/http/requirements.txt
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
python3 -m pip install -r tests/http/requirements.txt
- name: 'run pytest'
if: contains(matrix.build.install_steps, 'pytest')
env:
TFLAGS: "${{ matrix.build.tflags }}"
CURL_CI: github
run: |
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
if [ -n '${{ matrix.build.generate }}' ]; then
cmake --build . --verbose --target curl-pytest-ci
else
Expand Down

0 comments on commit 2638570

Please sign in to comment.