Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build cmake if package versioneer is installed #171

Closed
bennuttall opened this issue Jul 29, 2021 · 10 comments · Fixed by #175
Closed

Cannot build cmake if package versioneer is installed #171

bennuttall opened this issue Jul 29, 2021 · 10 comments · Fixed by #175

Comments

@bennuttall
Copy link

I tried to build cmake and I experienced this error:

File "setup.py", line 33, in <module>
      version=versioneer.get_version(),
  AttributeError: module 'versioneer' has no attribute 'get_version'

I have the library versioneer installed it's importing that. But the versioneer module doesn't have a get_version() function.

I discovered is that import versioneer in cmake's setup.py does not intend to import this library, it is supposed to import a file called versioneer.py.

Unfortunately this means you can't build cmake if you have the library versioneer installed.

FYI I discovered this as it was reported that recent versions of cmake were missing from the piwheels index. The issue was reported here: piwheels/packages#227

@mayeut
Copy link
Contributor

mayeut commented Jul 31, 2021

Unfortunately this means you can't build cmake if you have the library versioneer installed.

This should work well with build isolation. How is the wheel built ? where can we see logs ?
There's #143 to move from the custom versioneer script to setuptools_scm but that's on hold for now.

@bennuttall
Copy link
Author

Build log is here: https://paste.debian.net/1206146/

@mayeut
Copy link
Contributor

mayeut commented Jul 31, 2021

Thanks for the log. Unfortunately, it does not show how pip is invoked & I guess something in there might help us reproduce/understand the issue before fixing it (& check it's fixed).

@bennuttall
Copy link
Author

bennuttall commented Jul 31, 2021

The pip command we run is:

pip3 wheel cmake==3.21.1 --wheel-dir=wheel_dir --log=logfile--no-deps --no-cache-dir --no-binary=cmake --prefer-binary --exists-action=w --no-python-version-warning --disable-pip-version-check --index-url=https://pypi.python.org/simple --extra-index-url=https://www.piwheels.org/simple

as per https://github.com/piwheels/piwheels/blob/master/piwheels/slave/builder.py#L439

@mayeut
Copy link
Contributor

mayeut commented Jul 31, 2021

The pip command we run is

Thanks.

I could not reproduce with:

pip wheel -v cmake==3.21.1 --wheel-dir=wheel_dir --log=logfile --no-deps --no-cache-dir --no-binary=cmake --prefer-binary --exists-action=w --no-python-version-warning --disable-pip-version-check

but I could with the following which I suspected:

pip wheel -v cmake==3.21.1 --wheel-dir=wheel_dir --log=logfile --no-deps --no-cache-dir --no-binary=cmake --prefer-binary --exists-action=w --no-python-version-warning --disable-pip-version-check --no-build-isolation

============

with the following pip.conf

[global]
no-build-isolation = false

or the following environment variable

PIP_NO_BUILD_ISOLATION=false
 pip wheel -v cmake==3.21.1 --wheel-dir=wheel_dir --log=logfile --no-deps --no-cache-dir --no-binary=cmake --prefer-binary --exists-action=w --no-python-version-warning --disable-pip-version-check

fails as well which suggest one or the other is probably used on your builder.
It's worth noting that the behavior of either this conf or environment variable is opposite what it should be c.f. pypa/pip#5735 so if your builder does indeed set one or the other, is that the expected behavior ?

I will nevertheless fix the issue for "--no-build-isolation" builds now that I can reproduce/verify it.

@bennuttall
Copy link
Author

Thanks, I've tested building from github and it worked 👍

@mayeut
Copy link
Contributor

mayeut commented Aug 1, 2021

cmake 3.21.1.post1 is now available on PyPI with this fix.

@bennuttall
Copy link
Author

Thanks! It's building now (will work through the ABIs one-by-one): https://www.piwheels.org/project/cmake/

(I built the last few versions myself and imported them)

@JanLahmann
Copy link

Thank you to both of you, @bennuttall and @mayeut !
FYI: I'm using this as part of a project that is building a functional model of the IBM Quantum Computer, based on Qiskit (IBM Quantum software framework), a Raspberry Pi and a 3D printed housing: http://rasqberry.org

@bennuttall
Copy link
Author

bennuttall commented Aug 1, 2021

Built successfully for all ABIs now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants