Opened 20 months ago
Closed 19 months ago
#31216 closed enhancement (fixed)
tox.ini (local): Add environment variables to skip system package installs and other steps, add mechanism for a local interactive shell
Reported by:  mkoeppe  Owned by:  

Priority:  major  Milestone:  sage9.3 
Component:  porting  Keywords:  
Cc:  ghtobiasdiez, ghkliem, dimpase  Merged in:  
Authors:  Matthias Koeppe  Reviewers:  Tobias Diez 
Report Upstream:  N/A  Work issues:  
Branch:  2d84b5a (Commits, GitHub, GitLab)  Commit:  2d84b5ab5ac0741e872fb5a15539c2bbf935fe86 
Dependencies:  #30944  Stopgaps: 
Description (last modified by )
(from #31064)
We add the following to the local...
environments:
 an environment variable that can be passed to tox to skip system package installs, directly reusing a previously set up system
SKIP_SYSTEM_PKG_INSTALL=yes tox e localhomebrewmacosstandard  config.status SKIP_SYSTEM_PKG_INSTALL=yes tox e localhomebrewmacosstandard  config.status
This can save time and also give developers more control for experiments with system packages.
 a target that gives an interactive shell in the tox environment:
tox e localhomebrewmacosstandard  bash tox e localdirect  bash SKIP_SYSTEM_PKG_INSTALL=yes SKIP_BOOTSTRAP=1 SKIP_CONFIGURE=1 tox e localhomebrewmacosstandard  bash
Change History (25)
comment:1 Changed 20 months ago by
 Dependencies set to #30944
comment:2 Changed 20 months ago by
 Branch set to u/mkoeppe/tox_ini__local___add_environment_variables_to_skip_system_package_installs__mechanism_for_a_local_interactive_shell
comment:3 Changed 20 months ago by
 Commit set to 13f58fc7445bca7f54cc80efea51c1082a615542
 Description modified (diff)
comment:4 Changed 20 months ago by
 Description modified (diff)
comment:5 Changed 20 months ago by
 Commit changed from 13f58fc7445bca7f54cc80efea51c1082a615542 to ace4ef6674eaf29ff6a590ce0bcc5943f36c342c
Branch pushed to git repo; I updated commit sha1. New commits:
ace4ef6  tox.ini (local): Add option SKIP_SYSTEM_PKG_INSTALL=1

comment:6 Changed 20 months ago by
 Status changed from new to needs_review
comment:7 Changed 20 months ago by
 Description modified (diff)
comment:8 followup: ↓ 12 Changed 20 months ago by
On a first glance this looks good. Thanks! Could you please also add documentation for these tox commands / switches. Also I was wondering if one could add a tox e localhomebrewmacosstandard  installsystempackages
that only installs the system packages?
comment:9 Changed 20 months ago by
 Commit changed from ace4ef6674eaf29ff6a590ce0bcc5943f36c342c to ddc4f0b63ae13eee632663d7cb57c2b6d8207eb8
Branch pushed to git repo; I updated commit sha1. New commits:
ddc4f0b  tox.ini (local): Handle environment variables SKIP_BOOTSTRAP, SKIP_CONFIGURE

comment:10 Changed 20 months ago by
 Description modified (diff)
 Summary changed from tox.ini (local): Add environment variables to skip system package installs, mechanism for a local interactive shell to tox.ini (local): Add environment variables to skip system package installs and other steps, add mechanism for a local interactive shell
comment:11 Changed 20 months ago by
 Commit changed from ddc4f0b63ae13eee632663d7cb57c2b6d8207eb8 to 6253bd822f2dd515979875d3aea4beaf8de0d0ec
comment:12 in reply to: ↑ 8 ; followup: ↓ 13 Changed 20 months ago by
Replying to ghtobiasdiez:
Could you please also add documentation for these tox commands / switches.
Done
Also I was wondering if one could add a
tox e localhomebrewmacosstandard  installsystempackages
that only installs the system packages?
I have instead added more SKIP_...
options.
comment:13 in reply to: ↑ 12 ; followup: ↓ 14 Changed 19 months ago by
Replying to mkoeppe:
I have instead added more
SKIP_...
options.
Thanks! Would it also make sense to add one to skip make
? (I remember you once told me how to do this, I think, it was via config.status
or something  but maybe the version using skip is closer in spirit anyway).
I'll review this once #30944 is merged in develop.
comment:14 in reply to: ↑ 13 ; followup: ↓ 16 Changed 19 months ago by
Replying to ghtobiasdiez:
Would it also make sense to add one to skip
make
?
You can just pass a make target that does nothing  such as Makefile
comment:15 Changed 19 months ago by
 Status changed from needs_review to needs_work
localsudostandard runtest: commands[1]  bash c 'case "" in 1y*Y*);; *) eval $(build/bin/sageprintsystempackagecommand $(build/bin/sageguesspackagesystem) sudo update) ;;'/usr/bin/bash: c: line 1: syntax error: unexpected end of file
I think there is a "esac" missing at the end of these two lines:
+ local{root,sudo}: bash c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1y*Y*);; *) eval $(build/bin/sageprintsystempackagecommand {env:SYSTEM} {env:__SUDO:} update) ;;' + local{root,sudo}: bash c 'case "{env:SKIP_SYSTEM_PKG_INSTALL:}" in 1y*Y*);; *) PACKAGES=$(build/bin/sagegetsystempackages {env:SYSTEM} $(PATH=build/bin:$PATH build/bin/sagepackage list {env:SAGE_PACKAGE_LIST_ARGS}) _bootstrap); eval $(build/bin/sageprintsystempackagecommand {env:SYSTEM} {env:__SUDO:} yes noinstallrecommends install $PACKAGES)  [ "$IGNORE_MISSING_SYSTEM_PACKAGES" = yes ] && echo "(ignoring errors)" ;;'
comment:16 in reply to: ↑ 14 Changed 19 months ago by
Replying to mkoeppe:
Replying to ghtobiasdiez:
Would it also make sense to add one to skip
make
?You can just pass a make target that does nothing  such as
Makefile
tox e localsudostandard Makefile
with SKIP_BOOTSTRAP: yes
and SKIP_CONFIGURE: yes
still runs bootstrap
and basetoolchain
in the make
command, which then fails since configure
was not called before.
comment:17 Changed 19 months ago by
Ah, of course. Make that configure.ac
instead of Makefile
...
comment:18 Changed 19 months ago by
That worked, thanks! Apart from the missing "esac" mentioned above, this looks good to me.
comment:19 Changed 19 months ago by
 Commit changed from 6253bd822f2dd515979875d3aea4beaf8de0d0ec to 2d84b5ab5ac0741e872fb5a15539c2bbf935fe86
Branch pushed to git repo; I updated commit sha1. New commits:
2d84b5a  tox.ini: Add missing esac

comment:20 Changed 19 months ago by
 Status changed from needs_work to needs_review
comment:21 followup: ↓ 22 Changed 19 months ago by
Is the prefix [mkoeppe@sage sage]$
really needed / what's its purpose?
https://github.com/sagemath/sagetracmirror/compare/u/mkoeppe/tox__improve_local_sudo_ubuntu_standard...u/mkoeppe/tox_ini__local___add_environment_variables_to_skip_system_package_installs__mechanism_for_a_local_interactive_shell#diffc13a55474e037a35696cfba4768b81295c0383f1940052c5fcbef0737387f165R610
Otherwise the changes look good to me.
comment:22 in reply to: ↑ 21 Changed 19 months ago by
Replying to ghtobiasdiez:
Is the prefix
[mkoeppe@sage sage]$
really needed / what's its purpose?
It's a typical shell prompt on posix systems. The second sage
indicates the current directory. This is consistent with other parts of the Sage developer guide, for example https://doc.sagemath.org/html/en/developer/doctesting.html
comment:23 Changed 19 months ago by
 Status changed from needs_review to positive_review
Thanks, then it looks good to me!
comment:25 Changed 19 months ago by
 Branch changed from u/mkoeppe/tox_ini__local___add_environment_variables_to_skip_system_package_installs__mechanism_for_a_local_interactive_shell to 2d84b5ab5ac0741e872fb5a15539c2bbf935fe86
 Resolution set to fixed
 Status changed from positive_review to closed
Last 10 new commits:
Merge tag '9.3.beta4' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
src/sage/misc/package.py: Add one more # optional  build
Merge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/scriptpackagesprereqtoolchainbootstrap
Merge tag '9.3.beta5' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
src/sage/misc/package.py: Improve source formatting
Merge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/scriptpackagesprereqtoolchainbootstrap
cicygwin*.yml: Adjust to new script packages _bootstrap, _prereq
Merge branch 't/29124/scriptpackagesprereqtoolchainbootstrap' into t/30944/tox__improve_local_sudo_ubuntu_standard
Merge branch 't/30944/tox__improve_local_sudo_ubuntu_standard' into t/31216/tox_ini__local___add_environment_variables_to_skip_system_package_installs__mechanism_for_a_local_interactive_shell
tox.ini (local): Run an interactive shell if posargs are bash