Opened 10 months ago

Last modified 4 weeks ago

#31396 needs_review enhancement

relocatable wheel version of package sage_conf — at Version 4

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-9.5
Component: relocation Keywords:
Cc: culler, gh-kliem, dimpase, jhpalmieri, slelievre Merged in:
Authors: Matthias Koeppe Reviewers:
Report Upstream: N/A Work issues:
Branch: u/mkoeppe/relocatable_wheel_version_of_package_sage_conf (Commits, GitHub, GitLab) Commit: 9573b7c12afc5de1de743e53ff182d20490b340c
Dependencies: #29039 Stopgaps:

Status badges

Description (last modified by mkoeppe)

This version of sage_conf is for making a wheel that packages the precompiled non-Python bits of the Sage distribution, making SAGE_LOCAL relocatable using the method proposed in #31076, using SAGE_LOCAL=/var/tmp/sage-... and a symlink.

The sage script invokes sage-config to determine SAGE_ROOT and SAGE_LOCAL. In the version of sage-config supplied by this version of sage_conf, we ensure that the symlink from /var/tmp/sage-.... to the actual install location is set.

To test:

(cd src/pkgs/sage_conf-relocatable/ && tox -v -v -v)

On macOS, this builds a 750MB wheel, an order of magnitude above the standard file size limit on PyPI.

Optional steps:

  • Also build the wheelhouse (local/var/lib/sage/wheels), at least for tricky packages...

Change History (4)

comment:1 Changed 10 months ago by mkoeppe

  • Branch set to u/mkoeppe/relocatable_wheel_version_of_package_sage_conf

comment:2 Changed 10 months ago by git

  • Commit set to 9573b7c12afc5de1de743e53ff182d20490b340c

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

952fb9aFix up package_data
9573b7cCloser to working

comment:3 Changed 10 months ago by mkoeppe

  • Authors set to Matthias Koeppe
  • Cc gh-kliem added
  • Description modified (diff)

comment:4 Changed 10 months ago by mkoeppe

  • Description modified (diff)

On macOS, some shared libraries from homebrew still leak into the build:

find src/pkgs/sage_conf-relocatable/.tox/python/lib/python3.9/site-packages/sage_root -name "*.so" -o -name "*.dylib" | xargs otool -L
libgiac.dylib:
/usr/local/opt/gettext/lib/libintl.8.dylib
R/library/cluster/libs/*.dylib:
	/usr/local/opt/gettext/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
	/usr/local/opt/pcre/lib/libpcre.1.dylib (compatibility version 4.0.0, current version 4.12.0)
	/usr/local/opt/xz/lib/liblzma.5.dylib (compatibility version 8.0.0, current version 8.5.0)

Definitely should disable the R build (#30383).

Also check whether setting CC=gcc -sysroot.... helps getting rid of /usr/local leaking in.

Also need to add --enable-fat-binary.

setup.py build_py should probably use a symlink from /var/tmp... into ~/.sage as well so that it is easy to test relocation after removing the symlink. Also copytree from sage_root_source should be changed so it overwrites (updates) the existing contents of SAGE_ROOT.

the tox test should include the test with otool for self-containedness.

Note: See TracTickets for help on using tickets.