sagemath/sage

Reimplement `sage -i SPKG` for optional/experimental packages as `configure --enable-SPKG && make build`

mkoeppe opened this issue · 17 comments

#28095 adds configure --enable-SPKG.

As a follow-up, using this new interface we reimplement sage -i for optional/experimental packages, falling back to direct invocation of make for all other packages.

CC: @dimpase @embray @jhpalmieri

Component: build

Author: Matthias Koeppe

Branch/Commit: 3417f43

Reviewer: John Palmieri

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

Description changed:

--- 
+++ 
@@ -2,3 +2,4 @@
 
 As a follow-up, using this new interface we reimplement `sage -i`.
 
+Also, we issue warnings regarding experimental packages at configure time, rather than at `make` time. 
comment:2

Ah, I misread this at first--I thought you were proposing to replace sage -i as the way to install optional packages.

If I understand correctly though, you are just proposing a change to how it works internally. If so I'm +1.

Author: Matthias Koeppe

New commits:

3417f43src/bin/sage: Handle 'sage -i SPKG' for optional/experimental packages by configure --enable-SPKG

Commit: 3417f43

Description changed:

--- 
+++ 
@@ -1,5 +1,6 @@
 #28095 adds `configure --enable-SPKG`.
 
-As a follow-up, using this new interface we reimplement `sage -i`.
+As a follow-up, using this new interface we reimplement `sage -i` for optional/experimental packages, falling back to direct invocation of make for all other packages.
 
-Also, we issue warnings regarding experimental packages at configure time, rather than at `make` time. 
+
+
comment:6

I took a fresh tarball and merged this branch. When I ran ./sage -i meataxe, it ran configure three times in a row. Is this expected?

comment:7

By the way, after running ./sage -i meataxe or ./configure --enable-meataxe, config.log still says

configure:30333: result: meataxe-1.0.p0: does not support check for system package; optional, use "./configure --enable-meataxe" to install

It would be nice if this actually noted that the user has requested its installation.

comment:8

Replying to @jhpalmieri:

I took a fresh tarball and merged this branch. When I ran ./sage -i meataxe, it ran configure three times in a row. Is this expected?

That's clearly too much.

comment:9

Replying to @jhpalmieri:

By the way, after running ./sage -i meataxe or ./configure --enable-meataxe, config.log still says

configure:30333: result: meataxe-1.0.p0: does not support check for system package; optional, use "./configure --enable-meataxe" to install

It would be nice if this actually noted that the user has requested its installation.

That's #29363 "At the end of configure, indicate which optional/experimental packages are configured to be installed"

comment:10

Replying to @mkoeppe:

Replying to @jhpalmieri:

I took a fresh tarball and merged this branch. When I ran ./sage -i meataxe, it ran configure three times in a row. Is this expected?

That's clearly too much.

With a fully built Sage, running ./sage -i -p_group_cohomology just ran configure once.

Let me clarify about the other case. I took a fresh tarball for 9.1.beta8, got this branch and ran git rebase develop. That's when configure ran three times. The first time:

% ./sage -i meataxe                           
make -j6 build/make/Makefile --stop
make[1]: warning: -jN forced in submake: disabling jobserver mode.
rm -f config.log
mkdir -p logs/pkgs
ln -s logs/pkgs/config.log config.log
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
...

The second time:

real	0m0.206s
user	0m0.156s
sys	0m0.038s
Sage build/upgrade complete!

running ./configure   '--enable-meataxe'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no

The third time:

checking for the package system in use... homebrew
configure: No equivalent system packages for homebrew are known to Sage
make -j6 build/make/Makefile --stop
make[1]: warning: -jN forced in submake: disabling jobserver mode.
rm -f config.log
mkdir -p logs/pkgs
ln -s logs/pkgs/config.log config.log
running CONFIG_SHELL=/bin/sh /bin/sh ./configure --enable-meataxe --no-create --no-recursion
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no

If I start with a 9.1.beta7 tarball and use this branch, configure only runs twice.

comment:11

these multiple runs of configure, in some cases up to 3 times, also happen without this branch. so this is not a regression.

comment:12

Replying to @dimpase:

these multiple runs of configure, in some cases up to 3 times, also happen without this branch. so this is not a regression.

I agree. But independent of this ticket, we should probably look at some point how to clean this up a bit.

comment:13

Well, I'm happy with this. Positive review from me. Dima (or @embray, if you're active these days), if you want to look at it more, feel free to set back to needs review.

Reviewer: John Palmieri