Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 7791cd9

Browse files
author
Matthias Koeppe
committed
Remove --buildbase code
1 parent e5f9065 commit 7791cd9

File tree

4 files changed

+14
-21
lines changed

4 files changed

+14
-21
lines changed

src/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/.cython_version
22
/build
33
/Makefile
4-
/build-sagelib

src/Makefile.in

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ all: sage
1515

1616
## We poison all environment variables that have paths to the sage source and build directories,
1717
## but keep the directories below SAGE_LOCAL intact.
18-
## In this way we make sure that all of the sagelib build's source/build paths are communicated through
19-
## the current directory (for the source tree) and --build-base.
18+
## In this way we make sure that all of the sagelib build's source paths are communicated through
19+
## the current directory (for the source tree).
20+
## Building takes places in the build/ subdirectory.
21+
## The environment variable SAGE_CYTHONIZED needs to point to build/cythonized.
2022
##
2123
## As a special exception, we feed SAGE_PKGS. This is needed by src/sage_setup/optional_extension.py
2224
## via src/sage/misc/package.py. Hoping that #20382 will make this unnecessary.
@@ -36,14 +38,14 @@ sage:
3638
SAGE_DOC_SRC=/doesnotexist \
3739
SAGE_SCRIPTS_DIR=/doesnotexist \
3840
SAGE_BUILD_DIR=/doesnotexist \
39-
SAGE_CYTHONIZED=/doesnotexist \
4041
SAGE_PKGS=$(abs_top_srcdir)/build/pkgs \
41-
&& python -u setup.py build --build-base=$(abs_builddir)/build-sagelib install)
42+
SAGE_CYTHONIZED=$(abs_builddir)/build/cythonized \
43+
&& python -u setup.py build install)
4244

4345
clean:
4446
@echo "Deleting Sage library build artifacts..."
45-
rm -rf c_lib build .cython_version # from old sage versions
46-
rm -rf build-sagelib
47+
rm -rf c_lib .cython_version # from old sage versions
48+
rm -rf build
4749
find . -name '*.pyc' | xargs rm -f
4850
rm -f sage/libs/pari/auto_*
4951
rm -rf sage/ext/interpreters

src/sage/env.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ def _add_variable_or_fallback(key, fallback, force=False):
106106

107107
_add_variable_or_fallback('SAGE_LIB', SITE_PACKAGES[0])
108108

109-
# SAGE_CYTHONIZED is only (to be) used in doctests of sage_setup/
110-
_add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build-sagelib', 'cythonized'))
109+
_add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_ROOT', 'src', 'build', 'cythonized'))
111110

112111
# Used by sage/misc/package.py. Should be SAGE_SRC_ROOT in VPATH.
113112
_add_variable_or_fallback('SAGE_PKGS', opj('$SAGE_ROOT', 'build', 'pkgs'))

src/setup.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,15 @@ def excepthook(*exc):
4040
### Check build-base
4141
#########################################################
4242

43-
build_base = 'build' # the distutils default
44-
cmd = None
45-
for i, arg in enumerate(sys.argv[1:]):
46-
if not arg or not arg.startswith("-"):
47-
cmd = arg
48-
elif cmd == 'build' and (arg.startswith("--build-base") or arg == '-b'):
49-
if arg.startswith("--build-base="):
50-
build_base = arg[len("--build-base="):]
51-
else:
52-
build_base = arg[i+1]
43+
build_base = 'build' # the distutils default. Changing it is not supported by this setup.sh.
44+
45+
#########################################################
46+
### Set source directory
47+
#########################################################
5348

5449
import sage.env
55-
sage.env.SAGE_CYTHONIZED = os.path.abspath(os.path.join(build_base, 'cythonized'))
5650
sage.env.SAGE_SRC = os.getcwd()
5751

58-
5952
#########################################################
6053
### List of Extensions
6154
###

0 commit comments

Comments
 (0)