Skip to content

Remove SAGE_LOCAL from sage.config - #42606

Open
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:agent/gh-42459-sage-local-prefix
Open

Remove SAGE_LOCAL from sage.config#42606
cxzhong wants to merge 1 commit into
sagemath:developfrom
cxzhong:agent/gh-42459-sage-local-prefix

Conversation

@cxzhong

@cxzhong cxzhong commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Fixes #42459.

sage.config contains build-time configuration, while SAGE_LOCAL is a runtime environment setting with a different meaning in Sage-the-Distro. Keeping SAGE_LOCAL in both places made the generated Kenzo path use the Python venv instead of the non-Python installation prefix.

This PR now:

  • removes SAGE_LOCAL from sage.config;
  • configures KENZO_FAS directly in Meson from an explicit -DSAGE_LOCAL option used by Sage-the-Distro;
  • leaves KENZO_FAS empty in pure Meson builds so that ECL uses its normal search path;
  • configures the ThreeJS directory directly instead of deriving it from sage.config.SAGE_LOCAL;
  • keeps sage.env.SAGE_LOCAL runtime-based, with the environment taking precedence and the active Python prefix as the pure-Python fallback;
  • removes obsolete runtime placeholder replacements now that Meson supplies complete values;
  • adds regression coverage for both Meson modes, runtime fallback/override behavior, and fully substituted paths.

The runtime fallback restores the behavior that existed before sage.config.SAGE_LOCAL became unconditional: Sage-the-Distro still exports its non-Python prefix, while pure Python installations use their active sys.prefix.

Testing

  • ./sage -t src/sage/config_test.py — 8 passed
  • .venv/bin/python3 -m pytest -q src/sage/config_test.py — 8 passed
  • Conda Python: python -m pytest -q src/sage/config_test.py — 8 passed
  • ruff check src/sage/config_test.py
  • git diff --check upstream/develop...HEAD
  • pure Meson reconfiguration and runtime smoke tests with SAGE_LOCAL unset
  • fresh Meson setup with -DSAGE_LOCAL="/tmp/sage 42606 local"; generated config.py compiled and its Kenzo/ThreeJS paths were verified

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

None.

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

Documentation preview for this PR (built with commit 5705567; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@cxzhong
cxzhong requested a review from tobiasdiez August 1, 2026 07:57
@tobiasdiez

Copy link
Copy Markdown
Contributor

I don't have a very strong opinion on this, but I would prefer to "just" remove SAGE_LOCAL from the config.py file. For Kenzo, it should work to look in meson for it in SAGE_LOCAL, similar to how maxima is handled.

@cxzhong
cxzhong force-pushed the agent/gh-42459-sage-local-prefix branch from 3f42b90 to 5705567 Compare August 3, 2026 03:04
@cxzhong cxzhong changed the title Use the configured SAGE_LOCAL in sage.config Remove SAGE_LOCAL from sage.config Aug 3, 2026
@cxzhong
cxzhong marked this pull request as ready for review August 3, 2026 04:54
@cxzhong

cxzhong commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@tobiasdiez could you review this again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SAGE_LOCAL has two different meanings in sage distro

2 participants