docs icon indicating copy to clipboard operation
docs copied to clipboard

[bug] Building Conan itself fails

Open gjasny opened this issue 10 months ago • 4 comments

Describe the bug

Hello,

for historical reasons we build Conan from source on all of our required architectures. Recently the builds started to fail on macOS.

I was able to create a reproducer and have it fail on a GitHub Actions Runner here with:

      self.initialize_options()
    /Users/runner/work/conan-build-issue/conan-build-issue/_pyenv/bin/python3: No module named pip

Some observations:

  • It only fails on macOS
  • Also older Conan versions that used to succeed building now fail (which makes me suspect some updated Python dependency on Pypi side)

Could you please take a look?

Thanks, Gregor

PS: Are the build recipes for the official Conan releases available somewhere?

How to reproduce it

Clone https://github.com/gjasny/conan-build-issue and run build.sh locally.

gjasny avatar Apr 30 '25 10:04 gjasny

This seems to do the trick:

+pip install --upgrade pip
 pip install -e .
 pip install pyinstaller

gjasny avatar Apr 30 '25 11:04 gjasny

Would you be able to add pip to the pyproject.toml and tighten the dependency versions to something recent here?

https://github.com/conan-io/conan/blob/f7e431f1bac9c52c60f782854e262165f75d5257/pyproject.toml#L2

gjasny avatar Apr 30 '25 11:04 gjasny

Hi @gjasny,

Yes, it looks like updating pip solves the issue.

Based on my tests here, it seems the macOS CI environment was using an older version of pip (21.x). When running pip install -e ., this older pip version used the old, deprecated setup.py develop method. For some reason, this method failed on that specific macOS setup when trying to invoke pip internally (No module named pip).

By adding python -m pip install --upgrade pip right after activating the virtual environment, you update pip to a recent version (like 25.x). As you saw, this newer pip version uses the modern build system defined in pyproject.toml for editable installs (-e), which avoids the problematic setup.py develop path entirely. The key factor driving the build method choice seems to be the pip version itself.

Would you be able to add pip to the pyproject.toml and tighten the dependency versions to something recent here?

I think we can't add pip to requires because that section lists dependencies needed by the build itself (like setuptools) to build the wheel, not the tool running the installation.

Anyway, I think this is probably something we want to document or add a comment somewhere.

Thanks a lot for the feedback and the detailed report!

czoido avatar Apr 30 '25 12:04 czoido

Moved to the docs repo, to clarify it in the docs

memsharded avatar May 05 '25 14:05 memsharded