]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
GHA/linux: fix `pip3 install impacket` breakage
authorViktor Szakats <commit@vsz.me>
Wed, 13 Nov 2024 22:43:49 +0000 (23:43 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 14 Nov 2024 01:14:02 +0000 (02:14 +0100)
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 #15578

.github/workflows/http3-linux.yml
.github/workflows/linux.yml

index 12e3fa18e7f57a076839055dde6febaa9af80d65..8949dea592750edbc1e6ed773f5eee1cff92b0b9 100644 (file)
@@ -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'
@@ -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
@@ -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
index 2d23058cb7e40a70d1d567b35504fd3197a02775..88b4b1bde518e9f0b1854763027c823a173f9fc6 100644 (file)
@@ -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')
@@ -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')
@@ -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' }}
@@ -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
@@ -640,7 +644,8 @@ 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')
@@ -648,6 +653,7 @@ jobs:
           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