-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
libgpiod: does not compile on macOS 11.2-x86_64 host #14652
Comments
ping @jefferyto |
@k-ronny what does |
this is because
and in my build environment python3 is
this results in
and later to
with the Makefile changes I get
and later
and a working module some additional info:
|
So there is definitely something wrong with your Python: python3-config is a simple shell script and should start with "#!/bin/sh" - it's not a Python script itself. |
@mhei
the shell scripts are gone??? on Debian Buster it looks right
now I am cleaning up and rebuilding the whole thing, maybe my problem will go away |
ping @ynezz @httpstorm Any idea here? |
in
|
@neheb @k-ronny At this point I have the following suspects:
Here is some data from my environment:
Good luck! |
@httpstorm
???
but it uses
here is my .config
|
@k-ronny My brand new MacBook Pro 16 is totally borked at the moment, and I need to show it to the Apple support in about two hours before I can restart it. It's been making kernel panics whenever I restart it. I might be able to do some testing after that, and once I have the entire .config. |
@httpstorm
If I enable the installation of the shell script version all is good. e.g. <...>/feeds/packages/lang/python/python3/patches/666-macos-config.patch
But this means it will not use macOS specific options. Is this a problem? |
Hello @k-ronny
Before building, add the patches from this PR to feeds/packages/libs/perl/patches https://github.com/openwrt/packages/pull/14676/files I don't think perl is involved in the python build. I mentioned it, because it itself fails to build on macOS. Accidentally the perl build fails because it fails to find the current directory (cwd). Here is my list of installed brew and MacPorts packages: Good luck! |
@httpstorm My brew installed packages are
and it's dependencies. I have just started a build from your tree. |
Hello @k-ronny !
The build succeeded. Then I added:
The build failed reproducing your issue. I will look into this soon later today or tomorrow. |
@httpstorm
and pyport.h includes
I am compiling on a platform where LONG is 8 (macOS) for a platform where LONG is 4 (mipsel) so the compiler should use
|
Thanks @k-ronny for debugging this - I think if we install the shell script version of python-config to I think it makes sense to install the shell script version for target Python, since it is used to help cross-compile other packages and so no Mac-specific customizations should be used. The shell script version should also be packaged in python3-dev, to be consistent with Linux builds. For host Python (installed to @commodo any thoughts? |
works for me; |
Hello @k-ronny Your observations are right on the point! The reason why the following check fails
We should fix this script to include a proper shebang, and a valid prefix. Using a shell script is preferred to be consistent on both platforms. |
@jefferyto @commodo |
@httpstorm: I'm confused with your earlier comment
and where you propose to implement this as a fix? At the moment, I'd NAK this since in my eyes the problem here is that python development environment is mis-configured on macOS. So I'd agree with @jefferyto proposal too, i.e. to fixup the python-config script. But maybe I got you wrong, then sorry... |
@mhei
The patch suggested by @k-ronny in his initial post #14652 (comment) is a valid solution to point 2.
|
Hi,
this patch results in
and solves my problem without patching libgpiod. |
@k-ronny Please name your patch according to these rules, and create a pull-request: |
The Python version of python-config is installed when building on macOS, rather than the shell script version when building on Linux. When run on macOS, the Python version of python-config will return values with Mac-specific customizations. This patches the python-config install recipe so that which version is installed can be controlled by the package makefile. When building on macOS, this installs the Python version for host Python and the shell script version for target Python. This also updates Host/Compile and Host/Install to use the default host build recipes, so that the various HOST_* variables are taken into account automatically. Fixes openwrt#14652 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Hi, |
Thank you, @k-ronny for the hard work and research, and @jefferyto for the fix! Good luck! |
From me, too: thank you all for your hard work and time on this issue. |
The Python version of python-config is installed when building on macOS, rather than the shell script version when building on Linux. When run on macOS, the Python version of python-config will return values with Mac-specific customizations. This patches the python-config install recipe so that which version is installed can be controlled by the package makefile. When building on macOS, this installs the Python version for host Python and the shell script version for target Python. This also updates Host/Compile and Host/Install to use the default host build recipes, so that the various HOST_* variables are taken into account automatically. Fixes openwrt/packages#14652 Signed-off-by: Jeffery To <jeffery.to@gmail.com> Signed-off-by: Tianling Shen <cnsztl@project-openwrt.eu.org>
The Python version of python-config is installed when building on macOS, rather than the shell script version when building on Linux. When run on macOS, the Python version of python-config will return values with Mac-specific customizations. This patches the python-config install recipe so that which version is installed can be controlled by the package makefile. When building on macOS, this installs the Python version for host Python and the shell script version for target Python. This also updates Host/Compile and Host/Install to use the default host build recipes, so that the various HOST_* variables are taken into account automatically. Fixes openwrt#14652 Signed-off-by: Jeffery To <jeffery.to@gmail.com> (cherry picked from commit 1833090)
Maintainer: @mhei
Environment: all?
Description: cross compiling of libgpiod on a macOS 11.2-x86_64 host is failing
I think it is related to this definition in the Makefile:
If I apply this patch it compiles on macOS and Debian Buster and it runs on a Onion Omega2+:
But I do not know if this is the right approach.
The text was updated successfully, but these errors were encountered: