[BUG] Failing to find Python.h when building against a Flatpak runtime
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 18k
- Forks
- 2.3k
- Avg merge
- 5d 17h
- Merged PRs (30d)
- 10
Description
OS: Linux, Freedesktop 20.08 Flatpak runtime.
Building f1abf5d9159b805674197f6bc443592e631c9130 as a module of iminuit 2.4.0.
This issue has been mentioned by another user here but I can replicate it.
The problem is with print(s.get_python_inc(plat_specific=True)); in FindPythonLibsNew.cmake which gives the result
/usr/include/x86_64-linux-gnu/python3.8 but only pyconfig.h is there.
When setting plat_specific=False I'm getting /usr/include/python3.8 which is where Python.h resides.
One suggested fix is to change plat_specific to False but I don't know if this is correct.
Another fix for this is to determine if we are running in Flatpak by checking the existence of /.flatpak-info and then set plat_specific to False.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in FindPythonLibsNew.cmake and inspect the get_python_inc(plat_specific=True) path selection described in the issue. Reproduce the lookup in the Freedesktop 20.08 Flatpak runtime, compare the plat_specific values, and verify that building pybind11 as part of iminuit can locate Python.h without a manual workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp, python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100