Skip to content

Commit 872ca39

Browse files
author
Release Manager
committed
gh-37504: cmake, ninja_build: Reject installations in inaccessible user schemes
<!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> These two are installable via binary wheels on PyPI. When they are installed with `pip install --user`, as appears to be becoming more popular, then our `configure` script will see them, but they will not work within the Sage environment because we set PYTHONUSERBASE. Fix as done previously for `meson` in #37319. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] 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. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> - Depends on #37319 (merged here) URL: #37504 Reported by: Matthias Köppe Reviewer(s):
2 parents fc0d339 + cdcc434 commit 872ca39

File tree

4 files changed

+35
-27
lines changed

4 files changed

+35
-27
lines changed

build/pkgs/cmake/spkg-configure.m4

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
SAGE_SPKG_CONFIGURE(
2-
[cmake], [
3-
AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [
4-
AC_PATH_PROGS_FEATURE_CHECK([CMAKE], [cmake], [
5-
cmake_version=`$ac_path_CMAKE --version 2>&1 \
6-
| $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
7-
AS_IF([test -n "$cmake_version"], [
8-
AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [
9-
ac_cv_path_CMAKE="$ac_path_CMAKE"
10-
ac_path_CMAKE_found=:
1+
SAGE_SPKG_CONFIGURE([cmake], [dnl
2+
AC_CACHE_CHECK([for cmake >= 3.11], [ac_cv_path_CMAKE], [dnl
3+
dnl Do not accept cmake installed via https://pypi.org/project/cmake/
4+
dnl in the default user scheme; it will not work in our venv because
5+
dnl we set PYTHONUSERBASE in sage-env.
6+
WITH_SAGE_PYTHONUSERBASE([dnl
7+
AC_PATH_PROGS_FEATURE_CHECK([CMAKE], [cmake], [dnl
8+
cmake_version=`$ac_path_CMAKE --version 2>&1 \
9+
| $SED -n -e 's/cmake version *\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)/\1/p'`
10+
AS_IF([test -n "$cmake_version"], [dnl
11+
AX_COMPARE_VERSION([$cmake_version], [ge], [3.11], [dnl
12+
ac_cv_path_CMAKE="$ac_path_CMAKE"
13+
ac_path_CMAKE_found=:
14+
])
1115
])
1216
])
1317
])

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=b0dfc1d5886366b5c58354527810c1dbeffd78a3
3-
md5=c2f9837bcf2823d5b2f36063ebeedb38
4-
cksum=3535625335
2+
sha1=26e8d2b6804d9474bed32cba580e9edd9947723c
3+
md5=b6b9dbb57d17ba53f57f37f74c66a24c
4+
cksum=3731157415
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
686e933eb32ade977ed51836a33424e2095e5408
1+
4163e69cf94a4fbcf59e1297de0a4644d2e4291a

build/pkgs/ninja_build/spkg-configure.m4

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
SAGE_SPKG_CONFIGURE(
2-
[ninja_build], [
3-
dnl meson_python needs 1.8.2 or later
4-
AC_CACHE_CHECK([for ninja >= 1.8.2], [ac_cv_path_NINJA], [
5-
AC_PATH_PROGS_FEATURE_CHECK([NINJA], [ninja], [
6-
dnl support both two- and three-component version schemes
7-
dnl since samurai (a ninja alternative) uses two
8-
ninja_version=`$ac_path_NINJA --version 2>&1 \
9-
| $SED -n -e 's/\([[0-9]]*\(\.[[0-9]]*\)\{1,2\}\).*/\1/p'`
10-
AS_IF([test -n "$ninja_version"], [
11-
AX_COMPARE_VERSION([$ninja_version], [ge], [1.8.2], [
12-
ac_cv_path_NINJA="$ac_path_NINJA"
13-
ac_path_NINJA_found=:
1+
SAGE_SPKG_CONFIGURE([ninja_build], [dnl
2+
dnl meson_python needs 1.8.2 or later
3+
AC_CACHE_CHECK([for ninja >= 1.8.2], [ac_cv_path_NINJA], [dnl
4+
dnl Do not accept ninja installed from https://pypi.org/project/ninja/
5+
dnl in the default user scheme; it will not work in our venv because
6+
dnl we set PYTHONUSERBASE in sage-env.
7+
WITH_SAGE_PYTHONUSERBASE([dnl
8+
AC_PATH_PROGS_FEATURE_CHECK([NINJA], [ninja], [dnl
9+
dnl support both two- and three-component version schemes
10+
dnl since samurai (a ninja alternative) uses two
11+
ninja_version=`$ac_path_NINJA --version 2>&1 \
12+
| $SED -n -e 's/\([[0-9]]*\(\.[[0-9]]*\)\{1,2\}\).*/\1/p'`
13+
AS_IF([test -n "$ninja_version"], [dnl
14+
AX_COMPARE_VERSION([$ninja_version], [ge], [1.8.2], [
15+
ac_cv_path_NINJA="$ac_path_NINJA"
16+
ac_path_NINJA_found=:
17+
])
1418
])
1519
])
1620
])

0 commit comments

Comments
 (0)