Skip to content

Commit

Permalink
Trac #30724: src/bin/sage-env, src/bin/sage-env-config.in: Remove PYT…
Browse files Browse the repository at this point in the history
…HON_FOR_VENV

Instead, define it in `build/make/Makefile.in`.

With this ticket, the `MACOSX_DEPLOYMENT_TARGET` handling uses a new
(unexported) configuration variable defined by `sage-env-config`; see
also #30711.

This cleans up the sage runtime environment - one fewer environment
variable.

It is also preparation for #29013.

URL: https://trac.sagemath.org/30724
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager committed Nov 19, 2020
2 parents 3b0553f + 4bfa0ea commit 1ac30ab
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ STARTED = $(SAGE_LOCAL)/etc/sage-started.txt
doc-clean doc-src-clean doc-output-clean \
clean sagelib-clean build-clean python3_venv _clean-broken-gcc

PYTHON_FOR_VENV = @PYTHON_FOR_VENV@

ifneq ($(PYTHON_FOR_VENV),)
# Special rule for making the Python virtualenv from the system Python (Python
# 3 only). $(PYTHON) is set in Makefile to python3_venv.
Expand Down
5 changes: 4 additions & 1 deletion build/pkgs/python3/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ SAGE_SPKG_CONFIGURE([python3], [
dnl PRE
], [
dnl POST
AS_IF([test x$sage_spkg_install_python3 = xno], [PYTHON_FOR_VENV="$ac_cv_path_PYTHON3"])
AS_IF([test x$sage_spkg_install_python3 = xno],
[PYTHON_FOR_VENV="$ac_cv_path_PYTHON3"],
[SAGE_MACOSX_DEPLOYMENT_TARGET=legacy])
AC_SUBST([PYTHON_FOR_VENV])
AC_SUBST([SAGE_MACOSX_DEPLOYMENT_TARGET])
dnl These temporary directories are created by the check above
dnl and need to be cleaned up to prevent the "rm -f conftest*"
Expand Down
15 changes: 12 additions & 3 deletions src/bin/sage-env
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ export UNAME=`uname | sed 's/CYGWIN.*/CYGWIN/' `

# Mac OS X-specific setup
if [ "$UNAME" = "Darwin" ]; then
# Avoid 'MACOSX_DEPLOYMENT_TARGET mismatch: now "10.9" but "10.15" during configure'
if [ -z "$PYTHON_FOR_VENV" ]; then
case "$SAGE_MACOSX_DEPLOYMENT_TARGET" in
legacy)
# legacy behavior of the Sage distribution.
# set MACOSX_DEPLOYMENT_TARGET -- if set incorrectly, this can
# cause lots of random "Abort trap" issues on OSX. see trac
# #7095 for an example.
Expand All @@ -348,7 +349,15 @@ if [ "$UNAME" = "Darwin" ]; then
MACOSX_DEPLOYMENT_TARGET=10.$[$MACOSX_VERSION-4]
fi
export MACOSX_DEPLOYMENT_TARGET MACOSX_VERSION
fi
;;
"")
# Do nothing
;;
*)
# A fixed version set at configure time.
export MACOSX_DEPLOYMENT_TARGET=$SAGE_MACOSX_DEPLOYMENT_TARGET
;;
esac
# Work around problems on recent OS X crashing with an error message
# "... may have been in progress in another thread when fork() was called"
# when objective-C functions are called after fork(). See Trac #25921.
Expand Down
2 changes: 1 addition & 1 deletion src/bin/sage-env-config.in
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ CONFIGURED_OBJCXX="@OBJCXX@"
#######################################
# Other configuration (exported)
#######################################
export PYTHON_FOR_VENV="@PYTHON_FOR_VENV@"

#######################################
# Other configuration (not exported, only used in sage-env)
#######################################
SAGE_PKG_CONFIG_PATH="@SAGE_PKG_CONFIG_PATH@"
SAGE_MACOSX_DEPLOYMENT_TARGET="@SAGE_MACOSX_DEPLOYMENT_TARGET@"

0 comments on commit 1ac30ab

Please sign in to comment.