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

doc: guix: add lzma python tip #24504

Closed
wants to merge 1 commit into from

Conversation

jamesob
Copy link
Member

@jamesob jamesob commented Mar 8, 2022

I tripped on this error when attempting to do Guix builds for macOS
from a debian host.

I tripped on this error when attempting to do Guix builds for macOS
from a debian host.
@luke-jr
Copy link
Member

luke-jr commented Mar 8, 2022

Why would you have to reinstall Python? Debian doesn't compile it, so shouldn't the package be the same regardless?

@jamesob
Copy link
Member Author

jamesob commented Mar 8, 2022

When building the shared libs (--enable-shared), if the lzma header is missing Python apparently just skips it. I build my Python from source so I'm not sure how this might work with Debian packaging.

@laanwj
Copy link
Member

laanwj commented Mar 9, 2022

I'm kind of confused here. How does installing headers make a Python package appear? Only if you build Python afterward?

I think it would be better to handle this as a required build check/dependency, e.g. through the conventional requirements.txt system.

Specific instructions related to building Python from source is out of scope for this document, i think, as it's definitely not a specific need here. You only need a Python with the lzma package.

@jamesob
Copy link
Member Author

jamesob commented Mar 9, 2022

haha okay, well this comment would've probably saved me fifteen minutes but I guess it's out of scope. Will close.

@jamesob jamesob closed this Mar 9, 2022
@jamesob
Copy link
Member Author

jamesob commented Mar 9, 2022

Just for posterity...

All Python installations ship with the lzma.py file below, but (I guess) if you compile Python without having the lzma headers installed, you don't get the .so file alongside it:

% ls /usr/local/lib/python3.10/*lzma*
/usr/local/lib/python3.10/_lzma.cpython-39-x86_64-linux-gnu.so  /usr/local/lib/python3.10/lzma.py

which then causes the following import to fail:

% grep _lzma /usr/local/lib/python3.10/lzma.py
from _lzma import *
from _lzma import _encode_filter_properties, _decode_filter_properties

I don't know why Python builds don't require the lzma headers if this is part of the standard library, but apparently you can have a "valid" Python installation built from source (as I did) that lacks this shared object file.

@JeremyRubin
Copy link
Contributor

concept ack

if you can figure out the minimal set of optional things required to build the python we need, that would be awesome. there are probably some things you got lucky on!

we could even add a python-check script to ensure we have all the components not erroring.

this is a good first step!

@bitcoin bitcoin locked and limited conversation to collaborators Mar 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants