-
-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Meta-ticket: Split sage-env into 5 to clean up sage configuration #21707
Comments
comment:1
One comment. Currently |
comment:2
Thanks - I've updated the description |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:4
I agree. Consider a slight alternative: Rewrite sage-env as a Python script. This would give it much more flexibility and probably more legibility, including some command-line options for different environments ( The output would of course be the shell commands to actually set the variables. So rather than |
comment:5
I have a tendency to mix up |
comment:6
Right--they could be one in the same. |
comment:7
Replying to @embray:
I have thought about it often. Of course that really means that you'll have to removing all the build time stuff. But in sage-on-gentoo where I ship a very simplified sage-env (in /etc as well) they are virtually doing the same thing, one in shell, the other in python. |
comment:8
In either case--whether making a single script, or two separate shell scripts, this would be useful for gentoo (and probably other distros as well) then right? |
comment:9
Probably, the current |
comment:10
Ideally, the configuration for sagelib runtime should take place in a generated Python file and not involve environment variables at all. |
comment:11
More likely parts of it would be static, and other parts could be generated, but yes, what I meant above in terms of rewriting But it's still useful for interacting with other tools, especially for build purposes, as well as dropping into |
Commit: |
Dependencies: #25130 |
Author: Matthias Koeppe |
comment:14
As-is this is going to conflict with tickets like #27825 that are adding still more environment variables needed at build-time to sage-env-config. I'm completely in favor of this separation in principle though. The question is whether we should do this first and then update tickets like #27825 on top of it, or the other way around? |
comment:16
The tickets would be trivial to rebase on top of this one. |
comment:17
Probably one should introduce a command |
comment:18
For the sake of a bit more terseness I wonder if we could call it just Now that I look I'm not even entirely sure we need to separate I think we could probably have a |
comment:59
From the discussion in #32904 regarding
|
comment:60
From #32904 comment:24:
|
comment:61
Replying to @mkoeppe:
I think this is an interesting direction |
src/bin/sage-env
(with generated configuration insrc/bin/sage-env-config
; installed in$SAGE_LOCAL/bin
) is used in all of the following contexts:sage.env
), andThis ticket proposes to split the configuration according to these 5 contexts. This will make the installation of Sage more modular and flexible.
1./2. Create
build/bin/sage-build-env
(with generated configuration inbuild/bin/sage-build-env-config
) for the build-time environment variables for sage-the-distribution (spkg and sagelib). It is not installed in $SAGE_LOCAL.b. In
build/make/Makefile.in
and the scripts generated bybuild/bin/sage-spkg
, sourcebuild/bin/sage-build-env
in addition tosrc/bin/sage-env
. This is #29052.c. Gradually, we will move settings from
src/bin/sage-env[-config]
tobuild/bin/sage-build-env[-config]
that are known to be only needed for 1./2. (Note that not all compiler-related environment variables can be moved exclusively to 1./2. – some need to be added to 5 as well for some some calls to compilers needed at runtime to support things like%cython
(?) andsage.calculus.desolvers.desolve_mintides
.) As well as users' use ofpip
to install additional Python packages!d. Eventually, we will remove the call to
src/bin/sage-env
from the build scripts.2./3. Obtain sagelib's build-time configuration such as
src/setup.py
'slibrary_dirs
and runtime information (sage.env
) fromsage-config
(introduced in #29038).a. In
src/Makefile
, poison theSAGE_LOCAL
variable.pkg-config
installed from SPKGpkgconf
should not depend on environment variableSAGE_LOCAL
b. Pass
SAGE_PKGS
(if still needed at all - see src/setup.py: Replace use of is_package_installed_and_updated by sage_conf or features #28815 or Meta-ticket: Modularize sagelib into separate distributions (pip-installable packages) sagemath-... for Sage 10.x #29705) viasage-config
instead of fromsrc/Makefile
.3./4./5. Using
sage_conf
(Python module and scriptsage-config
, #29038), makesage.all
fully functional when imported from a Python, without setting any environment variables (sage-env
).a. Initially, phase out
src/bin/sage-env-config
by usingsage-config
instead.src/bin/sage-env-config.in
: Move logic tosrc/bin/sage-env
, move non-environment configuration variables tosage_conf.py
b. Set
sage.env
variables via the Python modulesage_conf
instead of relying on information from environment variables. Example:CYSIGNALS_CRASH_DAYS
sage.env
: Give values fromsage_conf
precedence over environment variablesc. Set environment variables that are needed only by subprocesses invoked by sagelib in the environment of these subprocesses, rather than relying on them begin set in
sage-env
. This environment could be provided by a variablesage_conf.SAGE_SUBPROCESS_ENV
and/or more invidual variables. Example:R_PROFILE
MAXIMA
instead of hardcoding "maxima"d. Finally, remove use of
sage-env
for all purposes except forsage -sh
.Aspects of downstream sage packaging:
src
directory to build and install sagelib.build/pkgs/sagelib/spkg-src
(Build sagelib from build/pkgs/sagelib/src, fixsetup.py sdist
, add spkg-src and tox.ini #29950); see also sage-conf_pypi: API for incremental builds #30036 (pip-installable sage)build/pkgs/sage_conf
, which is intended for use with sage-the-distribution.Binary packages:
sage_conf
for relocatable binary distributionspip-installable Sage
sage_conf
- installs non-Python bits of the Sage distribution in~/.sage/
sage_conf
More related tickets:
src/bin
as described in Move non-scripts of src/bin/ elsewhere (and also move their install location) #21570, Install src/bin scripts by sagelib's setup.py, not make #21559.SAGE_SCRIPTS_DIR
to make$SAGE_LOCAL/bin/sage
work from any directory, in an environment withoutSAGE_*
variables - this adds aSAGE_ROOT
variable tosage-env-config
src/bin/sage-env
,src/bin/sage-env-config.in
: Remove PYTHON_FOR_VENVDepends on #29038
Depends on #29052
CC: @embray @jdemeyer @nexttime @kiwifb @dimpase @isuruf @antonio-rojas @infinity0 @timokau @orlitzky @jhpalmieri @tobiasdiez
Component: build
Keywords: sd109
Author: Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/21707
The text was updated successfully, but these errors were encountered: