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
  1. jamesob commented at 4:40 pm on March 8, 2022: member
    I tripped on this error when attempting to do Guix builds for macOS from a debian host.
  2. doc: guix: add lzma python tip
    I tripped on this error when attempting to do Guix builds for macOS
    from a debian host.
    ce5a0c7583
  3. DrahtBot added the label Scripts and tools on Mar 8, 2022
  4. luke-jr commented at 6:32 pm on March 8, 2022: member
    Why would you have to reinstall Python? Debian doesn’t compile it, so shouldn’t the package be the same regardless?
  5. jamesob commented at 6:46 pm on March 8, 2022: member
    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.
  6. 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.

  7. jamesob commented at 6:49 pm on March 9, 2022: member
    haha okay, well this comment would’ve probably saved me fifteen minutes but I guess it’s out of scope. Will close.
  8. jamesob closed this on Mar 9, 2022

  9. 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.

  10. 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!

  11. DrahtBot locked this on Mar 9, 2023

github-metadata-mirror

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-09-29 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me