Skip to content

spkg-configure.m4 for python3 with SAGE_LOCAL as a venv for system pythons #29032

@embray

Description

@embray

This is an experimental alternative proposal to #27824.

It isn't yet as "complete" as #27824 as it lacks some of the fixes (e.g. the patches to Pillow) which I didn't need for my tests, but which may still be needed on other platforms (TBD).


The spkg-configure.m4 itself is taken almost directly from #27824, as most of it was great, except for a couple minor changes:

  • No temporary "config_venv" to test the system Python's packages; instead just run the system Python (if detected) with the -S flag.

  • config_setup.py and config_build are renamed conftest.py and conftest.dir respectively since autoconf will automatically clean up files and directories beginning with "conftest"; see https://www.gnu.org/software/autoconf/manual/autoconf-2.60/autoconf.html#Guidelines

  • AC_SUBST([SAGE_SYSTEM_PYTHON]) instead of AC_SUBST([PYTHON_FOR_VENV])


The changes to build/make/deps are also inspired by #27824 but are simpler in my opinion: Instead of creating a virtualenv nested inside SAGE_LOCAL, SAGE_LOCAL itself is just treated as a virtualenv, and we install the necessary files for the Python interpreter to treat it as such, which keeps things simpler, as SAGE_LOCAL + source sage-env already fills the same purpose as a virtualenv.


The changes to src/sage/env.py are reworked just a little bit (in particular, the version in #27824 was buggy on Cygwin, as it would privilege system DLLs over DLLs in SAGE_LOCAL).

This was tested on Ubuntu 18.04, and make ptestlong passes from a clean build with the system Python detected. No guarantees about OSX or other platforms.

Depends on #29357

Component: build: configure

Author: Erik Bray

Branch/Commit: u/mkoeppe/build/configure/python3 @ 99b032e

Reviewer: Dima Pasechnik

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions