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

tox.ini: Add local-macos-nohomebrew environments, deployment targets 10.14, 10.15, 11.1 #31567

Closed
mkoeppe opened this issue Mar 26, 2021 · 49 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 26, 2021

This will do a "best effort" isolation to avoid using a homebrew installation in /usr/local for anything except bootstrapping and unpacking xz tarballs + a little trick for liblzma.h, which is missing on macOS.

To test:

$ EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-nohomebrew-python3_xcode

It can then be checked that no libraries from /usr/local leak in, using

find prefix/lib -name "*.so" -o -name "*.dylib*" -exec otool -L {} \;

(Building R is disabled because the R package build still pokes around in /usr/local and finds libintl and liblzma.)

To set specific deployment targets, use:

$ EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-10.14-nohomebrew-python3_xcode -- config.status
$ EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-10.15-nohomebrew-python3_xcode -- config.status
$ EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-11.1-nohomebrew-python3_xcode -- config.status

... and with python3.7 from XCode:

$ tox -e local-macos-10.14-nohomebrew-python3_xcode-python3.7 -- config.status

(Remove config.status from the end of these lines to have the actual build done.)

These environments allow building Sage for older macOS versions, for example for building a 10.14 distribution on a 10.15 machine. The wheels are then correctly tagged, for example pplpy-0.8.6-cp38-cp38-macosx_10_14_x86_64.whl.

Cannot go in the opposite direction (building for 11 on a 10.15 machine) -- because pip will refuse to install a previously built wheel that is tagged for 11.)

Depends on #31552
Depends on #31562
Depends on #31409
Depends on #31584

CC: @jhpalmieri @zlscherr

Component: porting

Author: Matthias Koeppe

Branch/Commit: ed1a089

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/31567

@mkoeppe mkoeppe added this to the sage-9.3 milestone Mar 26, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2021

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

87e2dbatox.ini: Add local-macos-nohomebrew and configuration facors macos-{10.14,10.15,11.1}

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Commit: 87e2dba

@mkoeppe mkoeppe changed the title tox.ini: Add local-macos-nohomebrew environments tox.ini: Add local-macos-nohomebrew environments, deployment targets 10.14, 10.15, 11.1 Mar 27, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2021

Author: Matthias Koeppe

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

1ed9302tox.ini: Add macos-{python3_xcode,nohomebrew}-python{3.7,3.8}

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Changed commit from 87e2dba to 1ed9302

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

0458f23tox.ini: Add macos-{python3_xcode,nohomebrew}-python{3.7,3.8}

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Changed commit from 1ed9302 to 0458f23

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2021

comment:8

This is best tested together with #31552, #31562, which do some of the necessary isolation work.

More isolation work is needed at least for pillow and freetype - as observed in #31396 comment:32

@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 27, 2021

Dependencies: #31552, #31562

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Changed commit from 0458f23 to 9d9c562

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

8b5b273build/pkgs/singular/checksums.ini: Use 4.2.0p1+2021-03-24+sage-2
39629ddMerge #31552
1ef46d0build/pkgs/giac: Add another patch in patches/autotools
89f61d2build/pkgs/giac: Update to 1.6.0.47p3
9d9c562Merge #31562

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

236ea3ctox.ini (macos-nohomebrew): Pass compiler configuration to configure using variables other than CC, CXX.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Changed commit from 9d9c562 to 236ea3c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Changed commit from 236ea3c to 92db4e4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

92db4e4tox.ini (macos-nohomebrew): Pass compiler configuration to configure using variables other than CC, CXX.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 28, 2021

Changed dependencies from #31552, #31562 to #31552, #31562, #31409

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

737b21csrc/sage/stats/r.py: Mark all 2 doctests in this file as # optional - rpy2
4403924src/sage/interfaces/r.py: Mark all tests # optional - rpy2
405ebb9More # optional - rpy2
b7c1576Merge tag '9.3.beta8' into t/31409/cygwin_standard__r_build_fails_____downgrade_r__rpy2_to_optional
ce3b35fMore # optional - r
49c10c1Revert "build/pkgs/{r,rpy2}: Downgrade to optional"
a67300bMerge #30383
f0a5fb5configure.ac: Add option --disable-r
f04c134Merge branch 't/30383/new_package_type__optional_enabled_by_default' into t/31409/cygwin_standard__r_build_fails_____downgrade_r__rpy2_to_optional
7966b66Merge #31409

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

dffcdbctox.ini (macos-nohomebrew): Fix up pillow build by setting ZLIB_ROOT

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 28, 2021

Changed commit from b5edde2 to dffcdbc

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 29, 2021

comment:22

pillow still finds various libraries in /usr/local because of very creative discovery code that finds everything in /usr/local because we told it that it can have /usr/local/opt/xz/include - see _add_directory (https://github.com/python-pillow/Pillow/blob/8.1.x/setup.py#L197)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 29, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

3779a25tox.ini (macos-nohomebrew): Disable more libraries to remove dependencies on homebrew

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 29, 2021

Changed commit from dffcdbc to 3779a25

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 29, 2021

comment:24

Fixed pillow. Now I can build a wheel in #31396 that does not have any dependencies on shared libraries in /usr/local.

@jhpalmieri
Copy link
Member

comment:25

For what it's worth, I see a few suspicious items in the log files. (This is on a system with homebrew and with source .homebrew-build-env in my shell init file. That may be causing some of these.)

  • cvxopt includes flags -L/usr/local/lib and -I/usr/local/include when calling gcc
  • pillow says Appending path /usr/local/Cellar/xz/5.2.5/include and then the gcc flag -I/usr/local/Cellar/xz/5.2.5/include.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 30, 2021

comment:26

The xz include is on purpose -- see comment added in tox.ini

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 30, 2021

comment:27

Replying to @jhpalmieri:

For what it's worth, I see a few suspicious items in the log files. (This is on a system with homebrew and with source .homebrew-build-env in my shell init file. That may be causing some of these.)

Yes, this a good setting for testing this ticket. The build using tox is designed to be isolated from the effects of .homebrew-build-env.

  • cvxopt includes flags -L/usr/local/lib and -I/usr/local/include when calling gcc

This is probably https://github.com/cvxopt/cvxopt/blob/master/setup.py#L55 in combination with a bug in our build system - #31584.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 30, 2021

Changed dependencies from #31552, #31562, #31409 to #31552, #31562, #31409, #31584

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2021

Changed commit from 3779a25 to ed1a089

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 30, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

7ff26dfgit grep -l SAGE_SUITESPARSE | xargs sed -i .bak s/SAGE_SUITESPARSE_LOCALINSTALL/SAGE_SUITESPARSE_PREFIX/g
52537d1build/pkgs/cvxopt/spkg-install.in: Actually use the value of SAGE_SUITESPARSE_PREFIX
ed1a089Merge #31584

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri
Copy link
Member

comment:30

Okay, this looks good to me.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 31, 2021

comment:31

Thanks!

@jhpalmieri
Copy link
Member

comment:32

By the way, should commands like make distclean also clean the .tox directory?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 31, 2021

comment:33

I think it should not because .tox is not a "build artifact" - if this reasoning makes sense.

@jhpalmieri
Copy link
Member

comment:34

That makes sense. Maybe I need to learn more about tox. What command should I use if I want to restart EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-nohomebrew-python3_xcode from scratch? Just delete .tox/local-macos-nohomebrew-python3?

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 31, 2021

comment:35

Replying to @jhpalmieri:

That makes sense. Maybe I need to learn more about tox. What command should I use if I want to restart EXTRA_CONFIGURE_ARGS="--disable-r" tox -e local-macos-nohomebrew-python3_xcode from scratch? Just delete .tox/local-macos-nohomebrew-python3?

That works, but you can also pass the -r option to tox, which will start from scratch.

@jhpalmieri
Copy link
Member

comment:36

Great, thanks!

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Apr 18, 2021
@vbraun
Copy link
Member

vbraun commented May 27, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants