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

readme: add Python3 library dependency #69

Closed
wants to merge 1 commit into from

Conversation

Manawyrm
Copy link
Contributor

@Manawyrm Manawyrm commented Dec 2, 2024

libfdt (subproject) requires Python3 development headers to
compile its pylibfdt bindings.

@@ -106,7 +106,7 @@ $ meson setup build-arm --cross-file meson/arm-linux-gnueabi-gcc.ini && meson co

#### Dependencies (Debian)
```
apt install build-essential flex swig bison meson device-tree-compiler libyaml-dev
apt install build-essential flex swig bison meson device-tree-compiler libyaml-dev libpython3-dev
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh, do we? 😅

I don't immediately recall why - is it libfdt python bindings?

Can you add a note in the commit message?

Copy link
Contributor Author

@Manawyrm Manawyrm Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

root@ubuntu-2gb-fsn1-1:~/culvert# meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /root/culvert/build
ninja: Entering directory `/root/culvert/build'
[47/408] Generating subprojects/dtc/pylibfdt/pylibfdt with a custom command
FAILED: subprojects/dtc/pylibfdt/_libfdt.so
/root/culvert/subprojects/dtc/pylibfdt/../setup.py --quiet --top-builddir /root/culvert/build/subprojects/dtc build_ext
/root/culvert/subprojects/dtc/pylibfdt/../pylibfdt/libfdt_wrap.c:174:11: fatal error: Python.h: No such file or directory
  174 | # include <Python.h>
      |           ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[49/408] Linking target subprojects/dtc/dtc
ninja: build stopped: subcommand failed.

Hmm, yup. Looks like it.
Hm, the more elegant solution would probably to disable pylibfdt entirely (as I'm guessing we don't need it for anything anyway).

I'm not very familiar with meson, though...
dtc's meson file (subprojects/dtc/meson.build) doesn't look like pylibfdt can be disabled (without hacks):

py = import('python')
py = py.find_installation(required: get_option('python'))
swig = find_program('swig', required: get_option('python'))
pylibfdt_enabled = not meson.is_cross_build() and py.found() and swig.found() ? true : false

I've updated the commit description anyway.

Copy link
Owner

@amboar amboar Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meson setup -Ddtc:python=disabled ... should might work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does work and that's the better solution by far :)

I've opened #74 for this.

libfdt (subproject) requires Python3 development headers to
compile its pylibfdt bindings.

Signed-off-by: Manawyrm <[email protected]>
@Manawyrm
Copy link
Contributor Author

Manawyrm commented Dec 9, 2024

Better solution over in #74

@Manawyrm Manawyrm closed this Dec 9, 2024
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 this pull request may close these issues.

2 participants