Skip to content
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

Reimplement "sage -p SPKG" as "cd $SAGE_ROOT && make SPKG-no-deps" #30649

Closed
mkoeppe opened this issue Sep 24, 2020 · 55 comments
Closed

Reimplement "sage -p SPKG" as "cd $SAGE_ROOT && make SPKG-no-deps" #30649

mkoeppe opened this issue Sep 24, 2020 · 55 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Sep 24, 2020

This option installs a package without its dependencies, enabling experiments by experienced developers.

After #29013 (Support installation of Python packages into separate venvs depending on the python version), sage-spkg requires an installation-tree argument. As a result, currently sage -p is broken, as reported in #32751.

We remove this direct use of sage-spkg.

Making this change also removes the last use of SAGE_LOGS from src/

Since this now goes through a make target instead of using sage-spkg directly, after switching to a branch that adds a package, developers may need to manually invoke bootstrap and configure before using this option.

Depends on #33127

CC: @jhpalmieri @orlitzky @kliem @vbraun

Component: build

Author: Matthias Koeppe, John Palmieri

Branch/Commit: 9ed0d60

Reviewer: John Palmieri, Matthias Koeppe

Issue created by migration from https://trac.sagemath.org/ticket/30649

@mkoeppe mkoeppe added this to the sage-9.2 milestone Sep 24, 2020
@mkoeppe
Copy link
Member Author

mkoeppe commented Sep 24, 2020

Dependencies: #30657

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 19, 2021

Changed dependencies from #30657 to #31263

@mkoeppe mkoeppe changed the title Reimplement "sage -p SPKG" as "make SPKG-no-deps" Reimplement "sage -p SPKG" as "cd $SAGE_ROOT/build/make && install SPKG-no-deps" Jan 19, 2021
@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 19, 2021

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 19, 2021

Commit: 427f0bd

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 19, 2021

Author: Matthias Koeppe

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 19, 2021

New commits:

427f0bdsrc/bin/sage (-p): Use build/make/install SPKG-no-deps

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title Reimplement "sage -p SPKG" as "cd $SAGE_ROOT/build/make && install SPKG-no-deps" Reimplement "sage -p SPKG" as "cd $SAGE_ROOT/build/make && ./install SPKG-no-deps" Jan 19, 2021
@jhpalmieri
Copy link
Member

comment:6

I think that this does not behave according to the documentation: "Options are the same as for the -i command." For example ./sage -p -c bzip2 does not run the test suite, and ./sage -p -s biopython does not preserve the build directory.

@mkoeppe
Copy link
Member Author

mkoeppe commented Jan 20, 2021

comment:7

You are right, this needs more thought

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 13, 2021

comment:8

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@mkoeppe
Copy link
Member Author

mkoeppe commented Jul 19, 2021

comment:9

Setting a new milestone for this ticket based on a cursory review.

@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Jul 19, 2021
@mkoeppe

This comment has been minimized.

@mkoeppe

This comment has been minimized.

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 15, 2022

comment:29

Yes, I'm in favor of deleting this nonsensical test

@jhpalmieri
Copy link
Member

comment:31

The issues in comment:6 have been fixed.


New commits:

8ebd85btrac 30649: remove "sage -p --info --info ..." test

@jhpalmieri
Copy link
Member

Changed commit from d42fabe to 8ebd85b

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 16, 2022

Changed author from Matthias Koeppe to Matthias Koeppe, John Palmieri

@jhpalmieri
Copy link
Member

comment:34

Any ideas on what else needs to be done with this?


New commits:

33d3d1csrc/bin/sage-env: Merge code that sets SAGE_ROOT
fdada1csrc/bin/sage-env: Update comments on SAGE_ENV_SOURCED
7828a79src/bin/sage-env: Fixup: Move setting of SAGE_ROOT out of the inner-most if-block
2bd0742src/bin/sage-env: Suppress error message from probing for NEW_SAGE_ROOT
702b779src/bin/sage-env: Do not set SAGE_ROOT to empty; sage-location does not like it
c9fe2edMerge #33127

@jhpalmieri
Copy link
Member

Changed commit from 8ebd85b to c9fe2ed

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 19, 2022

comment:35

I think it is ready

@jhpalmieri
Copy link
Member

comment:36

The change from comment:30 and comment:31 seems to have been lost, and I am getting an error when I try to push. I don't want to mess up the rest of the branch, so it might be better if you do it:

diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
index 681ff703e25..fccba3f12fb 100644
--- a/src/sage/tests/cmdline.py
+++ b/src/sage/tests/cmdline.py
@@ -210,9 +210,7 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
         sage: ret  # optional - sage_spkg
         0
 
-    Test ``sage --info [packages]`` and the equivalent
-    ``sage -p --info --info [packages]`` (the doubling of ``--info``
-    is intentional, that option should be idempotent)::
+    Test ``sage --info [packages]``::
 
         sage: out, err, ret = test_executable(["sage", "--info", "sqlite"])  # optional - sage_spkg
         sage: print(out)  # optional - sage_spkg
@@ -225,17 +223,6 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
         sage: ret  # optional - sage_spkg
         0
 
-        sage: out, err, ret = test_executable(["sage", "-p", "--info", "--info", "sqlite"])  # optional - sage_spkg
-        sage: print(out)  # optional - sage_spkg
-        sqlite...
-        SQLite is a software library that implements a self-contained,
-        serverless, zero-configuration, transactional SQL database engine.
-        ...
-        sage: err  # optional - sage_spkg
-        ''
-        sage: ret  # optional - sage_spkg
-        0
-
     Test ``sage-run`` on a Python file, both with an absolute and with a relative path::
 
         sage: dir = tmp_dir(); name = 'python_test_file.py'

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 20, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

65989cctrac 30649: remove "sage -p --info --info ..." test

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 20, 2022

Changed commit from c9fe2ed to 65989cc

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 20, 2022

comment:38

Sorry for dropping this! Here it is

@jhpalmieri
Copy link
Member

comment:39

I propose the following two changes (the first one because this is already in sage-site and the option is handled twenty lines later, the second is just a typo not related to the changes here but one that you see when you run ./sage -p):

diff --git a/build/bin/sage-site b/build/bin/sage-site
index 78848c389e..f7164503b7 100755
--- a/build/bin/sage-site
+++ b/build/bin/sage-site
@@ -129,7 +129,7 @@ if [ "$1" = '-standard' -o "$1" = "--standard" ]; then
 fi
 
 if [ "$1" = '-p' ]; then
-    # If there are no further arguments, display usage help (via an option handled by sage-site)
+    # If there are no further arguments, display usage help
     if [ $# -eq 1 ]; then
         set -- --info
     else
diff --git a/build/bin/sage-spkg b/build/bin/sage-spkg
index 1af55f6671..4478bc7f2d 100755
--- a/build/bin/sage-spkg
+++ b/build/bin/sage-spkg
@@ -99,7 +99,7 @@ Options:
    -y: automatically reply "y" for all prompts regarding
        experimental and old-style packages; warning: there
        is no guarantee that these packages will build correctly;
-       use at your own risk"
+       use at your own risk
    -n: automatically reply "n" for all prompts regarding
        experimental and old-style packages
    -o: allow fetching the package from its upstream URL

Also for a future ticket: should ./sage -i and ./sage -p (with no further arguments) behave similarly? ./sage -i builds some stuff, while ./sage -p just prints a usage message and exits.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 20, 2022

Changed commit from 65989cc to 9ed0d60

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 20, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

9ed0d60build/bin/sage-site: Edits to comments, help text

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 20, 2022

comment:41

Replying to @jhpalmieri:

should ./sage -i and ./sage -p (with no further arguments) behave similarly? ./sage -i builds some stuff, while ./sage -p just prints a usage message and exits.

I suppose sage -p could be reduced to just saying "Nothing to do." instead of showing usage.

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 20, 2022

comment:42

And it's not clear if sage -i running make all-build is really useful, so we could consider changing this behavior too.

But as you say, that would be a future ticket.

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 20, 2022

Reviewer: ..., Matthias Koeppe

@jhpalmieri
Copy link
Member

Changed reviewer from ..., Matthias Koeppe to John Palmieri, Matthias Koeppe

@jhpalmieri
Copy link
Member

comment:44

Looks good to me. It has some advantages that I didn't expect. Without this branch:

% ./sage -p pytest
Error: Installing old-style SPKGs is no longer supported

whereas with this branch, ./sage -p pytest works fine (although it says "Successfully installed iniconfig-1.1.1 pytest-7.0.1" so it is still doing some dependency checking — probably pip or similar, not Sage's build system).

@mkoeppe
Copy link
Member Author

mkoeppe commented Feb 20, 2022

comment:45

Thanks!

@vbraun
Copy link
Member

vbraun commented Feb 21, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants