Skip to content

Commit

Permalink
build: Force pip install to not check for already installed module
Browse files Browse the repository at this point in the history
This previously broke distro package builds when they happened with the
`cockpit-bridge` package installed:

```
Processing ./tmp/wheel/cockpit-0-py3-none-any.whl
Installing collected packages: cockpit
  Attempting uninstall: cockpit
    Found existing installation: cockpit 311
ERROR: Cannot uninstall cockpit 311, RECORD file not found. Hint: The package was installed by debian.
```

This is a `pip` bug (pypa/pip#3063), work
around it with `--ignore-installed`.
  • Loading branch information
martinpitt committed Feb 27, 2024
1 parent 37fc642 commit d56ad0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ install-python:
@# wheel-based installation with .dist-info.
@# This needs to work on RHEL8 up through modern Fedora, offline, with
@# system packages available to the build.
python3 -m pip install --no-index --force-reinstall --root='$(DESTDIR)/' --prefix='$(prefix)' \
@# See https://github.com/pypa/pip/issues/3063 for --ignore-installed
python3 -m pip install --no-index --force-reinstall --ignore-installed --root='$(DESTDIR)/' --prefix='$(prefix)' \
"$$(python3 '$(srcdir)'/src/build_backend.py --wheel '$(srcdir)' tmp/wheel)"
mkdir -p $(DESTDIR)$(libexecdir)
mv -t $(DESTDIR)$(libexecdir) $(DESTDIR)$(bindir)/cockpit-askpass
Expand Down

0 comments on commit d56ad0b

Please sign in to comment.