doc: guix: add lzma python tip #24504
pull jamesob wants to merge 1 commits into bitcoin:master from jamesob:2022-03-xcode-extract-doc changing 1 files +7 −0-
jamesob commented at 4:40 pm on March 8, 2022: memberI tripped on this error when attempting to do Guix builds for macOS from a debian host.
-
doc: guix: add lzma python tip
I tripped on this error when attempting to do Guix builds for macOS from a debian host.
-
DrahtBot added the label Scripts and tools on Mar 8, 2022
-
luke-jr commented at 6:32 pm on March 8, 2022: memberWhy would you have to reinstall Python? Debian doesn’t compile it, so shouldn’t the package be the same regardless?
-
jamesob commented at 6:46 pm on March 8, 2022: memberWhen 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 commented at 11:26 am on March 9, 2022: member
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 commented at 6:49 pm on March 9, 2022: memberhaha okay, well this comment would’ve probably saved me fifteen minutes but I guess it’s out of scope. Will close.
-
jamesob closed this on Mar 9, 2022
-
jamesob commented at 6:56 pm on March 9, 2022: member
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:0% ls /usr/local/lib/python3.10/*lzma* 1/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:
0% grep _lzma /usr/local/lib/python3.10/lzma.py 1from _lzma import * 2from _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 commented at 8:00 pm on March 9, 2022: 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!
-
DrahtBot locked this on Mar 9, 2023
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me