Skip to content

Commit

Permalink
sagemathgh-36900: Fix build of optional Cython modules broken in sage…
Browse files Browse the repository at this point in the history
…math#29386

The Cython modules depending on optional packages (such as
sage.libs.coxeter3) were not being built after sagemath#29386. This showed up in
the CI as numerous doctest failures; as reported in
sagemath#36775 (comment)

Fixed here by avoiding a clash of environment variables that prevented
the function `is_package_installed_and_updated` from functioning during
the build of sagelib.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [x] 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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

URL: sagemath#36900
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Dec 17, 2023
2 parents 3c18c7c + 3350f7f commit 73e52a4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=7f2fe8137f5998559f8d3a0a7f965adf6d5ebc78
md5=586738771174a2d26d29ce7ba571a95d
cksum=1156937644
sha1=8b7ffb6e3984e747b42d30b458220fe60c8ea50a
md5=eee78cc60e5bb6176640574eb28c17cb
cksum=1389896899
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2395f7bb45fd7da537a953055df5e0a70dd96c6a
4a970443cd567705f67fcafa7ce1173c45361e3a
2 changes: 1 addition & 1 deletion src/bin/sage-env
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fi
# depending on SAGE_ROOT and SAGE_LOCAL which are already defined.
if [ -n "$SAGE_LOCAL" ]; then
export SAGE_SHARE="$SAGE_LOCAL/share"
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed"
export SAGE_SPKG_INST="$SAGE_LOCAL/var/lib/sage/installed" # deprecated
fi
if [ -n "$SAGE_SHARE" ]; then
export SAGE_DOC="$SAGE_SHARE/doc/sage"
Expand Down
3 changes: 2 additions & 1 deletion src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
SAGE_LOCAL = var("SAGE_LOCAL", SAGE_VENV)
SAGE_SHARE = var("SAGE_SHARE", join(SAGE_LOCAL, "share"))
SAGE_DOC = var("SAGE_DOC", join(SAGE_SHARE, "doc", "sage"))
SAGE_SPKG_INST = var("SAGE_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed"))
SAGE_LOCAL_SPKG_INST = var("SAGE_LOCAL_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed"))
SAGE_SPKG_INST = var("SAGE_SPKG_INST", join(SAGE_LOCAL, "var", "lib", "sage", "installed")) # deprecated

# source tree of the Sage distribution
SAGE_ROOT = var("SAGE_ROOT") # no fallback for SAGE_ROOT
Expand Down
4 changes: 2 additions & 2 deletions src/sage/misc/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _spkg_inst_dirs():
"""
Generator for the installation manifest directories as resolved paths.
It yields first ``SAGE_SPKG_INST``, then ``SAGE_VENV_SPKG_INST``,
It yields first ``SAGE_LOCAL_SPKG_INST``, then ``SAGE_VENV_SPKG_INST``,
if defined; but it both resolve to the same directory, it only yields
one element.
Expand All @@ -402,7 +402,7 @@ def _spkg_inst_dirs():
"""
last_inst_dir = None
for inst_dir in (sage.env.SAGE_SPKG_INST, sage.env.SAGE_VENV_SPKG_INST):
for inst_dir in (sage.env.SAGE_LOCAL_SPKG_INST, sage.env.SAGE_VENV_SPKG_INST):
if inst_dir:
inst_dir = Path(inst_dir).resolve()
if inst_dir.is_dir() and inst_dir != last_inst_dir:
Expand Down

0 comments on commit 73e52a4

Please sign in to comment.