After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 742505 - Build python3 on osx
Build python3 on osx
Status: RESOLVED OBSOLETE
Product: jhbuild
Classification: Infrastructure
Component: module sets
unspecified
Other Mac OS
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2015-01-07 05:06 UTC by Patrick Griffis (tingping)
Modified: 2021-05-17 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add python3 to osx bootstrap (2.00 KB, patch)
2015-01-07 05:06 UTC, Patrick Griffis (tingping)
none Details | Review
Add py3cairo module to osx (1.52 KB, patch)
2015-01-07 05:06 UTC, Patrick Griffis (tingping)
none Details | Review

Description Patrick Griffis (tingping) 2015-01-07 05:06:11 UTC
Created attachment 294002 [details] [review]
Add python3 to osx bootstrap

As title says...
Comment 1 Patrick Griffis (tingping) 2015-01-07 05:06:35 UTC
Created attachment 294003 [details] [review]
Add py3cairo module to osx
Comment 2 Patrick Griffis (tingping) 2015-01-09 23:49:00 UTC
I have found one issue with this build:

python3-config --ldflags

returns:

-lintl -ldl -framework CoreFoundation -lpython3.4m -Wl,-stack_size,1000000 -framework CoreFoundation

But most packages use this on a shared lib which fails with -stack_size is only supported for executables. Not sure how to fix this.
Comment 3 Patrick Griffis (tingping) 2015-01-09 23:53:54 UTC
Its also possible we should use some things from homebrews[1] package like was mentioned in bug 742486 such as setting -isysroot.

1 - https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python3.rb
Comment 4 John Ralls 2015-01-10 00:50:12 UTC
(In reply to comment #3)
> Its also possible we should use some things from homebrews[1] package like was
> mentioned in bug 742486 such as setting -isysroot.
> 
> 1 - https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python3.rb

That's not exclusive to Python. Since Xcode 5 it's always required for building anything because Apple dumped /usr/include even when you have command-line tools installed. How have you been setting it for everything else?

Here's what gtk-osx's setup-sdk() passes to jhbuild (it's in the .jhbuildrc distributed with gtk-osx):
$ Manjusri:r-git/build/gnucash-git> echo $CFLAGS
-arch i386 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.10
$ Manjusri:r-git/build/gnucash-git> echo $CPPFLAGS
-I$JHBUILD_PREFIX/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
$ Manjusri:r-git/build/gnucash-git> echo $LDFLAGS
-L$JHBUILD_PREFIX/lib -arch i386 -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/lib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.10 -Wl,-headerpad_max_install_names


The SDK path is obtained from xcode-select -p + a filename constructed from the passed-in SDK version and the standard elements.
Comment 5 Patrick Griffis (tingping) 2015-01-10 01:34:53 UTC
>That's not exclusive to Python. Since Xcode 5 it's always required for building
>anything because Apple dumped /usr/include even when you have command-line
>tools installed. How have you been setting it for everything else?

From a glance it is not being set at all. So perhaps that is for another issue.
Comment 6 John Ralls 2015-01-10 03:24:52 UTC
(In reply to comment #5)
> >That's not exclusive to Python. Since Xcode 5 it's always required for building
> >anything because Apple dumped /usr/include even when you have command-line
> >tools installed. How have you been setting it for everything else?
> 
> From a glance it is not being set at all. So perhaps that is for another issue.

What are you using for CFLAGS and LDFLAGS then? Do you build only for your own use?
Comment 7 Patrick Griffis (tingping) 2015-01-10 03:45:34 UTC
>What are you using for CFLAGS and LDFLAGS then?

It looks like jhbuild does not set any custom flags, at least nothing is set in `jhbuild shell`.

>Do you build only for your own use?

Well so far, @desrt just started 'improving' normal jhbuild on osx so I started helping out. I would like these builds to be redistributable eventually. I assumed his goal was to merge some of the changes from gtk-osx to jhbuild so there is no duplicated effort.
Comment 8 Allison Karlitskaya (desrt) 2015-01-10 21:24:08 UTC
Note jhbuild has an extra_prefixes option:

https://git.gnome.org/browse/jhbuild/commit/?id=c8a8603e2e69c5c6d01a25612c31a088b7e6a020

We use that for making sure /usr/local is included properly in all of the C include path, library path, etc. on FreeBSD, where it isn't by default.

Perhaps it makes sense to add some extra_prefixes when we are on Mac OS as well?
Comment 9 John Ralls 2015-01-10 21:47:02 UTC
Yeah, you could handle it that way, though using -isysroot is safer because it forces the -framework directive to also look in the SDK instead of /System/Library.

But nobody's answered the question about how you're getting it to build at all on OSX. Are you both on pre-10.9 systems?
Comment 10 Patrick Griffis (tingping) 2015-01-10 22:21:47 UTC
>Are you both on pre-10.9 systems?

I am on 10.10.
Comment 11 John Ralls 2015-01-11 00:10:33 UTC
Interesting and a bit unexpected: It looks like Apple has built in magic to get Clang to look in the current-version's SDK for system includes.

So there's no need to do anything for the base case where someone wants to build for the currently-running system. The complications come with building for older systems.
Comment 12 Philip Chimento 2016-11-10 05:39:50 UTC
(In reply to Patrick Griffis (tingping) from comment #2)
> I have found one issue with this build:
> 
> python3-config --ldflags
> 
> returns:
> 
> -lintl -ldl -framework CoreFoundation -lpython3.4m -Wl,-stack_size,1000000
> -framework CoreFoundation
> 
> But most packages use this on a shared lib which fails with -stack_size is
> only supported for executables. Not sure how to fix this.

See bug 773803 and bug 774175 for something that I'm reasonably confident fixes it.
Comment 13 André Klapper 2020-11-07 12:31:15 UTC
(In reply to Philip Chimento from comment #12)
> See bug 773803 and bug 774175 for something that I'm reasonably confident
> fixes it.

Is this open ticket still needed? Or fixed by the previous two tickets?
Comment 14 Philip Chimento 2020-11-19 00:34:39 UTC
I don't think this ticket is superseded by those two tickets, they are just illustrating how to fix the stack size error when building libraries.
Comment 15 GNOME Infrastructure Team 2021-05-17 16:01:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/211.