Skip to content

Meta-ticket: Split sage-env into 5 to clean up sage configuration #21707

@mkoeppe

Description

@mkoeppe

src/bin/sage-env (with generated configuration in src/bin/sage-env-config; installed in $SAGE_LOCAL/bin) is used in all of the following contexts:

  1. Sage-the-distribution while building spkgs,
  2. Sage-the-distribution for building sagelib,
  3. for environment variables needed to start Sage,
  4. as variables by Sage at runtime (through sage.env), and
  5. for environment variables affecting subprocesses of Python invoked by sagelib modules.

This ticket proposes to split the configuration according to these 5 contexts. This will make the installation of Sage more modular and flexible.

1./2. Create build/bin/sage-build-env(with generated configuration in build/bin/sage-build-env-config) for the build-time environment variables for sage-the-distribution (spkg and sagelib). It is not installed in $SAGE_LOCAL.
b. In build/make/Makefile.in and the scripts generated by build/bin/sage-spkg, source build/bin/sage-build-env in addition to src/bin/sage-env. This is #29052.
c. Gradually, we will move settings from src/bin/sage-env[-config] to build/bin/sage-build-env[-config] that are known to be only needed for 1./2. (Note that not all compiler-related environment variables can be moved exclusively to 1./2. – some need to be added to 5 as well for some some calls to compilers needed at runtime to support things like %cython (?) and sage.calculus.desolvers.desolve_mintides.) As well as users' use of pip to install additional Python packages!
d. Eventually, we will remove the call to src/bin/sage-env from the build scripts.

2./3. Obtain sagelib's build-time configuration such as src/setup.py's library_dirs and runtime information (sage.env) from sage-config (introduced in #29038).
a. In src/Makefile, poison the SAGE_LOCAL variable.

3./4./5. Using sage_conf (Python module and script sage-config, #29038), make sage.all fully functional when imported from a Python, without setting any environment variables (sage-env).
a. Initially, phase out src/bin/sage-env-config by using sage-config instead.

Aspects of downstream sage packaging:

Binary packages:

pip-installable Sage

More related tickets:

Depends on #29038
Depends on #29052

CC: @embray @jdemeyer @nexttime @kiwifb @dimpase @isuruf @antonio-rojas @infinity0 @timokau @orlitzky @jhpalmieri @tobiasdiez

Component: build

Keywords: sd109

Author: Matthias Koeppe

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

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