sagemath/sage

Add script packages build/pkgs/_prereq, build/pkgs/_bootstrap

mkoeppe opened this issue · 91 comments

As a follow-up to #29053, we move the build/pkgs/*.txt files to a more systematic location. This will simplify some scripts.

  • build/pkgs/_prereq/distros/debian.txt etc. - records the minimal requirements (system packages) for installing from source. (we move the current build/pkgs/debian.txt etc. there)
  • build/pkgs/_bootstrap/distros/debian.txt etc. - would record the additional requirements for running ./bootstrap (we move the current build/pkgs/debian-bootstrap.txt there)

Related:

Possible follow-up:

  • build/pkgs/_toolchain/dependencies - to replace some special Makefile targets currently in build/make/Makefile.in.

Depends on #30940
Depends on #29655

CC: @dimpase @egourgoulhon @jhpalmieri @kiwifb @tobiasdiez @seblabbe @slel @kliem

Component: build

Keywords: sd111

Author: Matthias Koeppe

Branch/Commit: e8da106

Reviewer: Sébastien Labbé, Dima Pasechnik

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

Description changed:

--- 
+++ 
@@ -1,7 +1,8 @@
 As a follow-up to #29053.
 
-- `build/pkgs/PREREQ/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
-- `build/pkgs/BOOTSTRAP/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
-- `build/pkgs/TOOLCHAIN/deps` - to replace some special Makefile targets currently in `build/make/deps`.
+- `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
+- `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
+- `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
 
-
+Related: 
+- #28998: Add script-type _spkg_check package that installs tox, mock, pytest etc.

Description changed:

--- 
+++ 
@@ -2,7 +2,9 @@
 
 - `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
 - `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
+- `build/pkgs/_prereq_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
 - `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
 
 Related: 
 - #28998: Add script-type _spkg_check package that installs tox, mock, pytest etc.
+
comment:4

for example on fedora-26-standard sagetex testsuite fails:

! LaTeX Error: File `makecmds.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 
         
l.78 \RequirePackage
                    {ifpdf}^^M

Description changed:

--- 
+++ 
@@ -2,7 +2,7 @@
 
 - `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
 - `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
-- `build/pkgs/_prereq_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
+- `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
 - `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
 
 Related: 

Commit: bf2dfdf

comment:6

Installation manual also recommends Tcl/Tk - what are they used for in Sage?
http://doc.sagemath.org/html/en/installation/source.html#tcl-tk


New commits:

bf2dfdfbuild/pkgs/_recommended: New

Author: Matthias Koeppe

Description changed:

--- 
+++ 
@@ -2,9 +2,9 @@
 
 - `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
 - `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
-- `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
 - `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
 
 Related: 
 - #28998: Add script-type _spkg_check package that installs tox, mock, pytest etc.
+- #29557: `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
 

Dependencies: #29557

Changed commit from bf2dfdf to none

Description changed:

--- 
+++ 
@@ -6,5 +6,5 @@
 
 Related: 
 - #28998: Add script-type _spkg_check package that installs tox, mock, pytest etc.
-- #29557: `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisitesUbuntu)
+- #29557: `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisites/Ubuntu)
 

Description changed:

--- 
+++ 
@@ -1,7 +1,7 @@
 As a follow-up to #29053.
 
-- `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace #29053's file build/pkgs/debian.txt)
-- `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (autotools and such)
+- `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace the current `build/pkgs/debian.txt`)
+- `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (to replace the current `build/pkgs/debian-bootstrap.txt`)
 - `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
 
 Related: 

Changed dependencies from #29557 to #30951

comment:14

Best done on top of #30951

Changed dependencies from #30951 to #30951, #30947

Description changed:

--- 
+++ 
@@ -1,10 +1,13 @@
-As a follow-up to #29053.
+As a follow-up to #29053, we move the `build/pkgs/*.txt` files to a more systematic location.  This will simplify some scripts.
 
-- `build/pkgs/_prereq/distros/debian.txt` etc. - would record the minimal requirements (system packages) for installing from source. (to replace the current `build/pkgs/debian.txt`)
-- `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (to replace the current `build/pkgs/debian-bootstrap.txt`)
-- `build/pkgs/_toolchain/deps` - to replace some special Makefile targets currently in `build/make/deps`.
+- `build/pkgs/_prereq/distros/debian.txt` etc. - records the minimal requirements (system packages) for installing from source. (we move the current `build/pkgs/debian.txt` etc. there)
+- `build/pkgs/_bootstrap/distros/debian.txt` etc. - would record the additional requirements for running `./bootstrap` (we move the current `build/pkgs/debian-bootstrap.txt` there)
 
 Related: 
 - #28998: Add script-type _spkg_check package that installs tox, mock, pytest etc.
 - #29557: `build/pkgs/_recommended` - records additional recommended packages such as texlive-xetex (see https://wiki.sagemath.org/prerequisites/Ubuntu)
 
+Possible follow-up: 
+- `build/pkgs/_toolchain/dependencies` - to replace some special Makefile targets currently in `build/make/Makefile.in`.
+
+

Work Issues: Update scripts to new location

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

0281b21tox.ini: Simplify, use sage-get-system-packages, sage-package list

Changed commit from 0281b21 to 3abae24

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

3abae24tox.ini: Fixup - always include _bootstrap

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

36f62debuild/bin/write-dockerfile.sh: Remove special casing of build/pkgs/$SYSTEM.txt
06edf3bsrc/doc/en/developer/portability_testing.rst: Update paths in documentation

Changed commit from 3abae24 to 06edf3b

Changed work issues from Update scripts to new location to none

comment:22

I'm not sure about the naming of the local- environments. Why should I expect as a developer that local-sudo installs system packages? What about local-system-packages-ubuntu (for root) and local-sudo-system-packages-ubuntu (for sudo)?

Changed commit from 06edf3b to 8d725b8

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

0e97683tox.ini: Simplify, use sage-get-system-packages, sage-package list
da3f657tox.ini: Fixup - always include _bootstrap
8fde1dcbuild/bin/write-dockerfile.sh: Remove special casing of build/pkgs/$SYSTEM.txt
8d725b8src/doc/en/developer/portability_testing.rst: Update paths in documentation
comment:24

I have taken out the addition of the local-root environments to keep this ticket more narrowly focused. Let's return to this in #30944.

Changed commit from 8d725b8 to bd7f66c

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

bd7f66cMakefile (configure): Update dependency on moved files build/pkgs/*.txt

Changed commit from bd7f66c to 6b9f3a3

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

5e9366dMerge tag '9.3.beta2' into t/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_
6b9f3a3Merge branch 't/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_' into t/29124/script-packages-prereq-toolchain-bootstrap

Changed commit from 6b9f3a3 to a5ecf3c

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

b0459c3Merge tag '9.3.beta2' into t/30951/tox_ini__build_bin_write_dockerfile_sh__simplify_by_using_new_options_of__sage__package_list_
a8708ddbuild/bin/write-dockerfile.sh: Change bash -x back to bash
8a575d4tox.ini (minimal): Use SAGE_PACKAGE_LIST_ARGS=_prereq
f696cfcMerge branch 't/30951/tox_ini__build_bin_write_dockerfile_sh__simplify_by_using_new_options_of__sage__package_list_' into t/29124/script-packages-prereq-toolchain-bootstrap
a5ecf3cbootstrap: Remove --enable-_recommended etc.

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

0e35938m4/sage_spkg_collect.m4: Remove _recommended etc. from the configure package summary

Changed commit from a5ecf3c to 0e35938

comment:31

Am I right to think that only the last two commits of the branch should be reviewed here?

comment:32

No, there are actually a few more commits earlier that don't come from the merged dependencies

comment:33

Ok. Then, could the branch be rebased on top of the dependencies, to make the changes made by this ticket consecutive and easier to read (during the review and/or after).

Changed keywords from none to sd111

comment:34

Hoping we can make progress on this ticket this week - https://wiki.sagemath.org/days111

Changed dependencies from #30951, #30947 to #30947

Changed commit from 0e35938 to a9bd145

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2792314Merge branch 't/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_' into t/29124/script-packages-prereq-toolchain-bootstrap
c901ba6Add script packages build/pkgs/_prereq, build/pkgs/_bootstrap
5b2f4fbbuild/pkgs/_prereq/spkg-configure.m4: New
7ad8286src/doc/bootstrap: Remove special casing of build/pkgs/$SYSTEM.txt - _prereq is now just a standard package with spkg-configure.m4
ad24294tox.ini: Simplify, use sage-get-system-packages, sage-package list
1a77a6bbuild/bin/write-dockerfile.sh: Remove special casing of build/pkgs/$SYSTEM.txt
35241e7src/doc/en/developer/portability_testing.rst: Update paths in documentation
68baff1Makefile (configure): Update dependency on moved files build/pkgs/*.txt
fae4bd0bootstrap: Remove --enable-_recommended etc.
a9bd145m4/sage_spkg_collect.m4: Remove _recommended etc. from the configure package summary
comment:37

Rebased on top of #30947 and current beta

comment:38

Thank you. I do have lots of other todos this week, but I hope to be able to review few tickets during the week. I will start with this one and the other ones you put me in cc.

comment:39

I am not sure if commit a9bd145 works because I still see underscore packages listed in the list of SPKGs which did not find equivalent system packages during the run of ./configure:

    notice: the following SPKGs did not find equivalent system packages:

        _recommended boost coxeter3 gp2c igraph isl libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata
        
checking for the package system in use... debian
configure:

    hint: installing the following system packages, if not
    already present, is recommended and may avoid having to
    build them (though some may have to be built anyway):

      $ sudo apt-get update 
      $ sudo apt-get install  texlive-latex-extra texlive-xetex latexmk pandoc dvipng default-jdk ffmpeg libavdevice-dev libboost-dev pari-gp2c libigraph-dev libisl-dev

    After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status
comment:40

Ok, I see, the goal of commit a9bd145 was to remove _recommended elsewhere in the log:

config.log on 9.3.beta3:

## ----------------------------------------------------------------------- ##
## Build status for each package:                                          ##
## ----------------------------------------------------------------------- ##
4ti2-1.6.7.p0:                               does not support check for system package; optional, will be installed as an SPKG
_recommended-none:                           no suitable system package; optional, use "./configure --enable-_recommended" to install
alabaster-0.7.12:                            does not support check for system package; will be installed as an SPKG

config.log with this branch on top of 9.3.beta3:

## ----------------------------------------------------------------------- ##
## Build status for each package:                                          ##
## ----------------------------------------------------------------------- ##
4ti2-1.6.7.p0:                               does not support check for system package; optional, will be installed as an SPKG
_bootstrap-none:                             does not support check for system package; optional, use "./configure --enable-_bootstrap" to install
_prereq-none:                                does not support check for system package; will be installed as an SPKG
_recommended-none:                           no suitable system package; optional, use "./configure --enable-_recommended" to install
alabaster-0.7.12:                            does not support check for system package; will be installed as an SPKG

config.log with this branch on top of 9.3.beta3 (after running make first):

## ----------------------------------------------------------------------- ##
## Build status for each package:                                          ##
## ----------------------------------------------------------------------- ##
4ti2-1.6.7.p0:                               does not support check for system package; optional, will be installed as an SPKG
alabaster-0.7.12:                            does not support check for system package; will be installed as an SPKG
appnope-0.1.0.p0:                            does not support check for system package; will be installed as an SPKG

Still, I would suggest to also remove it from the list notice: the following SPKGs did not find equivalent system packages:.

Reviewer: Sébastien Labbé

Changed commit from a9bd145 to 571cc49

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

184ae6dMerge tag '9.3.beta3' into t/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_
084fbf6src/doc/bootstrap: Use ./sage
571cc49Merge branch 't/30947/src_doc_bootstrap__simplify_by_using_new_options_of__sage__package_list_' into t/29124/script-packages-prereq-toolchain-bootstrap
comment:43

Merged new version of #30947

comment:44

Replying to @seblabbe:

Still, I would suggest to also remove it from the list notice: the following SPKGs did not find equivalent system packages:.

I agree it's not pretty. But all of the SPKGs listed there expand/transform to system packages that are suggested to be installed. Without the _recommended, it will be a mystery where some of the suggested system packages are coming from. So I think it's better to keep it there.

comment:45

Ok. works for me.

comment:46

Thank you!

comment:47

Merge conflict

Changed commit from 571cc49 to c529729

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

9c5e8a2add references to `bin/sage-build-env` and `bin/sage-build-env-config`
4b8933bremove incorrect `$` in `build/bin/sage-build-env`
071b8ccRevert "add references to `bin/sage-build-env` and `bin/sage-build-env-config`"
c51e752correct comments to makefile
aa7ecd6fix that we might have changed $FCFLAGS during configure
94326dbbetter solution for dealing with -ffree-form
87dae61keep FCFLAGS during gfortran configure
7577dd4added quotes
3bb3099prepare preciouos variables
c529729Merge commit '3bb309944b7e8542b2ac88ed3c9d9a60e68644d7' of git://trac.sagemath.org/sage into t/29124/script-packages-prereq-toolchain-bootstrap

Changed dependencies from #30947 to #30947, #30375

comment:49

Merged #30375 in the hope to resolve merge conflicts

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

b73d6f0Merge tag '9.3.beta4' into t/29124/script-packages-prereq-toolchain-bootstrap

Changed commit from c529729 to b73d6f0

comment:51

Merged current beta

comment:52
**********************************************************************
File "src/sage/misc/package.py", line 427, in sage.misc.package.standard_packages
Failed example:
    installed[0], installed[-1]  # optional - build
Expected:
    ('alabaster', 'zn_poly')
Got:
    ('_prereq', 'zn_poly')
**********************************************************************
1 item had failures:
   1 of   4 in sage.misc.package.standard_packages
    [49 tests, 1 failure, 3.31 s]
----------------------------------------------------------------------

Changed dependencies from #30947, #30375 to #30947, #30375, #30940

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

97942e3sage.misc.package.pip_installed_packages: Only normalize when optional arg normalization='spkg'
6706182sage.misc.package.list_packages: Return early if SAGE_PKGS is not available
9258849sage.misc.package.list_packages: Streamline handling of exclude_pip
7f80e3esage.misc.package.list_packages: Actually add new items to the list
78bae1fMerge tag '9.3.beta3' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
3cf5ee4Merge commit 'a50ddf88975086b14a49895e371477df00fd57b5' of git://trac.sagemath.org/sage into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
b4927e1sage.misc.package: Remove/adjust non-robust doctests
e5fe752Merge tag '9.3.beta4' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
78ff9d5src/sage/misc/package.py: Add one more # optional - build
a44042fMerge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/script-packages-prereq-toolchain-bootstrap

Changed commit from b73d6f0 to a44042f

comment:55

Merged #30940, which makes these doctests more robust

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

64bde5fMerge tag '9.3.beta5' into t/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available
e9a7572src/sage/misc/package.py: Improve source formatting
c7bcda9Merge branch 't/30940/src_bin_sage_list_packages__make_it_work_if_sage_root_is_not_available' into t/29124/script-packages-prereq-toolchain-bootstrap
9988c5fci-cygwin*.yml: Adjust to new script packages _bootstrap, _prereq

Changed commit from a44042f to 9988c5f

Changed dependencies from #30947, #30375, #30940 to #30940

comment:61

The last commit fixes the issue observed in #29124:

moved the files build/pkgs/*.txt to new locations but forgot to update the CI scripts for Cygwin, which had led to failures like this (https://github.com/mkoeppe/sage/runs/1561097256):

sed: can't read ./build/pkgs/cygwin.txt: No such file or directory
sed: can't read ./build/pkgs/cygwin-bootstrap.txt: No such file or directory
Chocolatey v0.10.15
Package name is required. Please pass at least one package name to install.
Error: Process completed with exit code 1.

Changed dependencies from #30940 to #30940, #29655

Changed commit from 9988c5f to 6ff6545

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

6f3b864build/pkgs/[s-t]*/SPKG.rst: Reformat title in format 'spkg_name: Short description'
23558f8build/pkgs/[t-z]*/SPKG.rst: Reformat title in format 'spkg_name: Short description' -- completes coverage of all standard packages
17789dfbuild/pkgs/[z-z]*/SPKG.rst: Reformat title in format 'spkg_name: Short description' -- completes coverage of all optional packages
944408dbuild/pkgs/[a-z]*/SPKG.rst: Reformat title in format 'spkg_name: Short description' -- completes coverage of all experimental packages
feafa60src/doc/en/installation/standard_packages.rst: Remove
58c63e1src/doc/bootstrap: Add brief explanation of the standard/optional/experimental package types
54d4fb1extra line after version
17f2f24Merge branch 't/29655/improve_build_pkgs___spkg_rst' into t/29124/script-packages-prereq-toolchain-bootstrap
e7a768bbuild/pkgs/{_bootstrap,_prereq}/SPKG.rst: Reformat title
6ff6545Move build/pkgs/opensuse*.txt to build/pkgs/{_bootstrap,_prereq}/distros
comment:64

Still needs review

comment:65

./bootstrap is getting very slow - 3 times slower than ./configure, over 60 sec on a relatively fast machine!

comment:66

On this branch I'm getting

sage -t --warn-long 53.2 --random-seed=0 src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 219, in sage.tests.cmdline.test_executable
Failed example:
    print(out)  # optional - build
Expected:
    Found local metadata for sqlite-...
    SQLite
    ======
    ...
    SQLite is a software library that implements a self-contained,
    serverless, zero-configuration, transactional SQL database engine.
    ...
Got:
    sqlite: An SQL database engine
    ==============================
    <BLANKLINE>
    Description
    -----------
    <BLANKLINE>
    SQLite is a software library that implements a self-contained,
    serverless, zero-configur
...

and one more similar failure in this file.
Not sure whether it's coming from this ticket, or one of dependencies.

Changed reviewer from Sébastien Labbé to Sébastien Labbé, Dima Pasechnik

comment:67

Thanks for catching this. It's coming from #29655

Changed commit from 6ff6545 to b57fecc

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

2eac7a1src/doc/bootstrap: Use sage-spkg-info directly instead of 'sage --info', much faster now
3fe8d4csrc/sage/tests/cmdline.py: Adjust doctests
b57feccMerge branch 't/29655/improve_build_pkgs___spkg_rst' into t/29124/script-packages-prereq-toolchain-bootstrap
comment:70

hmm, now I see

File "src/sage/tests/cmdline.py", line 219, in sage.tests.cmdline.test_executable
Failed example:
    print(out)  # optional - build
Expected:
    SQLite
    ======
    ...
    SQLite is a software library that implements a self-contained,
    serverless, zero-configuration, transactional SQL database engine.
    ...
Got:
    sqlite: An SQL database engine
    ==============================
    <BLANKLINE>
    Description
    -----------
    <BLANKLINE>
    SQLite is a software library that implements a self-contained,
    serverless, zero-configuration, transactional SQL database engine.
    <BLANKLINE>
...

(and the same in line 232)

So more changes of these test outputs are needed.

The different heading (sqlite: An SQL database engine) comes from src/doc/en/reference/spkg/sqlite.rst, as far as me and grep can tell.

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

49ad8aesrc/sage/tests/cmdline.py: Adjust doctest properly
e8da106Merge branch 't/29655/improve_build_pkgs___spkg_rst' into t/29124/script-packages-prereq-toolchain-bootstrap

Changed commit from b57fecc to e8da106

comment:73

OK, good.

comment:74

Thanks!