Summary
Building eclipse-score/tooling (and likely any other repo whose Python/pip dependency graph pulls in pycairo, e.g. via rules_python's pip.parse) inside this devcontainer image fails while pip builds pycairo from source, because the image is missing pkg-config and the cairo development headers.
Reproduction
- Run the devcontainer image:
ghcr.io/eclipse-score/devcontainer:latest
- In
eclipse-score/tooling, run bazel build //...
- The build fails resolving the
pycairo pip dependency (surfaces as a rules_python pip.parse repository-rule failure, e.g. pip_rules_score_312_pycairo)
Error
Did not find pkg-config by name 'pkg-config'
Found pkg-config: NO
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency cairo found: NO
../cairo/meson.build:31:12: ERROR: Dependency lookup for cairo with method 'pkg-config' failed: Pkg-config for machine host machine not found. Giving up.
Root cause
pycairo==1.29.0 has no prebuilt wheel for this environment's Python/platform combination, so pip builds it from source via its meson build backend. That build requires pkg-config and libcairo2-dev (cairo's dev headers + pkg-config file) to locate the cairo library at build time. Neither package is installed in the devcontainer image.
Suggested fix
Add pkg-config and libcairo2-dev to the devcontainer image's apt package list (Dockerfile).
Workaround used locally
Running the following as root inside the container before the build unblocks it:
apt-get update && apt-get install -y pkg-config libcairo2-dev
Summary
Building
eclipse-score/tooling(and likely any other repo whose Python/pip dependency graph pulls inpycairo, e.g. viarules_python'spip.parse) inside this devcontainer image fails while pip buildspycairofrom source, because the image is missingpkg-configand the cairo development headers.Reproduction
ghcr.io/eclipse-score/devcontainer:latesteclipse-score/tooling, runbazel build //...pycairopip dependency (surfaces as arules_pythonpip.parserepository-rule failure, e.g.pip_rules_score_312_pycairo)Error
Root cause
pycairo==1.29.0has no prebuilt wheel for this environment's Python/platform combination, sopipbuilds it from source via itsmesonbuild backend. That build requirespkg-configandlibcairo2-dev(cairo's dev headers + pkg-config file) to locate the cairo library at build time. Neither package is installed in the devcontainer image.Suggested fix
Add
pkg-configandlibcairo2-devto the devcontainer image's apt package list (Dockerfile).Workaround used locally
Running the following as root inside the container before the build unblocks it: