Skip to content

sage_setup: Use paths within SAGE_LOCAL when provided via sage_conf #31338

@mkoeppe

Description

@mkoeppe

We add a simple mechanism to sagelib's setup.py (via a new module in sage_setup) to prepend SAGE_LOCAL values to key environment variables needed for the build: PATH, LIBRARY_PATH, CPATH, LDFLAGS. This allows use to build sagelib outside of an environment set by sage-env (which would set these variables among many more) if only sage_conf is installed in the build environment.

To test:

./configure --enable-editable
make sagelib-build-deps      # installs sage_conf and other things
(cd src && ../local/bin/python3 setup.py develop)

Note - the last line is not within a sage-env!

Follow-up, if necessary: Because for misconfigured Pythons, -I options may leak in as described in #31335 and take precedence over the CPATH that we set, we may want to essentially revert #29697, adding some refinements:

  • SAGE_LOCAL vs SAGE_VENV
  • make sure that if $SAGE_LOCAL is unset, nothing is added.

Relevant tickets regarding include/library search paths: #13348, #14709, #29562 (+), #29607 (+), #29697 (?), #31041 (), #30818 (), #30013 (~)

Depends on #31593

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

Component: build

Author: Matthias Koeppe

Branch: 31eaf59

Reviewer: Dima Pasechnik

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions