Skip to content

sage: Determine SAGE_LOCAL, SAGE_ROOT via sage-config if it exists #29852

@mkoeppe

Description

@mkoeppe

We reduce the runtime dependency of sage on sage-env-config.

We query sage-config (installed by sage_conf, which has a dependency on our python3 package) for the values of SAGE_LOCAL and SAGE_ROOT. sage-config must be in the same directory as $0.

This allows the installed sage script to be invoked directly from $SAGE_LOCAL/bin in an environment without SAGE_... variables, restoring what was previously implemented in #25486.

Also, we move sourcing of sage-env-config (but not sage-env!) earlier in the sage script.
This is so that commands such as $SAGE_LOCAL/bin/sage --root work correctly.

Follow-up tickets:

CC: @kiwifb @orlitzky @jhpalmieri @antonio-rojas @seblabbe

Component: build

Keywords: sd111

Author: Matthias Koeppe

Branch/Commit: eb3793e

Reviewer: Dima Pasechnik, François Bissey

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions