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

Improve wording and formatting of configure's recommendation message #30624

Closed
slel opened this issue Sep 21, 2020 · 34 comments
Closed

Improve wording and formatting of configure's recommendation message #30624

slel opened this issue Sep 21, 2020 · 34 comments

Comments

@slel
Copy link
Member

slel commented Sep 21, 2020

Context

Recent work on Sage's build system enables to use many
system packages as possible when building Sage.
See meta-ticket #27330 for an overview.

Part of that effort is to have configure end with
recommendations of extra system packages to install.

Making this recommendation system very precise would not
be sustainable. As a compromise, it recommends installing
packages whenever

  • satisfactory versions of these packages
    are not found to be already installed
  • some version of that OS has versions of these packages
    that would avoid having to build them

Problem

With the wording of the recommendation hint up to
Sage 9.2.beta12, users can be puzzled when it recommends
installing a package that is already installed.

Solution

Improve the recommendation message and along the way
make it better stand out.

Before this ticket:

configure: hint: installing the following system packages
is recommended and may avoid building some of the above SPKGs
from source:
configure:   $ sudo apt-get update
$ sudo apt-get install libcdd-dev libcdd-tools libnauty-dev

After this ticket:

configure:

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

    $ sudo apt-get update
    $ sudo apt-get install libcdd-dev libcdd-tools libnauty-dev

References

See the 2020-09 discussion on sage-release,
in particular these posts:

See also

See also #30863 whose aim is the same (e.g., do not suggest to sudo apt install sympow if the reason was that the sympow already installed on the system was failing some tests).

Depends on #30606

CC: @egourgoulhon @orlitzky @mkoeppe @slel @tobiasdiez @seblabbe

Component: build: configure

Author: Samuel Lelièvre, Matthias Koeppe

Branch/Commit: 72f0081

Reviewer: Matthias Koeppe, Sébastien Labbé

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

@slel slel added this to the sage-9.2 milestone Sep 21, 2020
@slel

This comment has been minimized.

@slel
Copy link
Member Author

slel commented Oct 5, 2020

@slel
Copy link
Member Author

slel commented Oct 5, 2020

Commit: 208d572

@slel
Copy link
Member Author

slel commented Oct 5, 2020

comment:2

Here is a branch.

Illustration on macOS.

Before:

$ source .homebrew-build-env && ./bootstrap -q && ./configure
...
config.status: creating directory local/lib/pkgconfig
config.status: creating directory local/share
config.status: creating directory local/var/lib/sage/installed
configure: notice: the following SPKGs did not find equivalent system packages: cbc coxeter3 gp2c libnauty libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata perl_cpan_polymake_prereq perl_term_readline_gnu python3 tox
checking for the package system in use... -n (ignoring conda because no environment is active)
homebrew
configure: hint: installing the following system packages is recommended and may avoid building some of the above SPKGs from source:
configure:   $ brew install python3
# To automatically take care of homebrew messages regarding
# keg-only packages for the current shell session:
  $ source /opt/s/sage9/.homebrew-build-env
# Add this to your shell profile if you want it to persist between shell sessions.
configure: After installation, re-run configure using:
configure:   $ ./config.status --recheck && ./config.status

After:

$ source .homebrew-build-env && ./bootstrap -q && ./configure
...
config.status: creating directory local/lib/pkgconfig
config.status: creating directory local/share
config.status: creating directory local/var/lib/sage/installed
configure:

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

        cbc coxeter3 gp2c libnauty libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata perl_cpan_polymake_prereq perl_term_readline_gnu python3 tox

checking for the package system in use... -n (ignoring conda because no environment is active)
homebrew
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):

      $ brew install python3

    Homebrew can issue suggestions regarding keg-only packages.
    The following command is to automatically apply these suggestions.
    Run it once to apply the suggestions for the current session.
    Add it to your shell profile to apply them for all future sessions.

      $ source /opt/s/sage92b6/.homebrew-build-env

    After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status

Illustration on Debian.

Before:

$ ./bootstrap -q && ./configure
...
config.status: creating directory local/lib/pkgconfig
config.status: creating directory local/share
config.status: creating directory local/var/lib/sage/installed
configure: notice: the following SPKGs did not find equivalent system packages: coxeter3 gp2c libnauty libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata tox
checking for the package system in use... debian
configure: hint: installing the following system packages is recommended and may avoid building some of the above SPKGs
from source:
configure:   $ sudo apt-get update
  $ sudo apt-get install pari-gp2c libnauty-dev
configure: After installation, re-run configure using:
configure:   $ ./config.status --recheck && ./config.status

After:

$ ./bootstrap -q && ./configure
...
config.status: creating directory local/lib/pkgconfig
config.status: creating directory local/share
config.status: creating directory local/var/lib/sage/installed
configure:

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

        coxeter3 gp2c libnauty libsemigroups pari_elldata pari_galpol pari_nftables pari_seadata tox

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 pari-gp2c libnauty-dev

    After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status

New commits:

208d572t-30624 improve configure recommendation message

@slel
Copy link
Member Author

slel commented Oct 5, 2020

comment:3

Polishing commits welcome (here or in a follow-up ticket).

I'll update the "before/after" in the ticket description
once the branch gets positive review.

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2020

comment:4

This change is not good. # is the shell comment character.
The idea here is that (if PROMPT is not used) that you get a valid shell script as the output.

-        $IF_VERBOSE echo "# To automatically take care of homebrew messages regarding "
-        $IF_VERBOSE echo "# keg-only packages for the current shell session:"
+        $IF_VERBOSE echo ""
+        $IF_VERBOSE echo "    Homebrew can issue suggestions regarding keg-only packages."
+        $IF_VERBOSE echo "    The following command is to automatically apply these suggestions."

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2020

comment:5

If you put this ticket on top of #30606, you could add customization of the comment prefix in the same way that #30606 adds customization of the prompt...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2020

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

14e9395SagePackageSystem: Rename to sage_spkg (underscore) to make it an allowed optional tag
5c0da17src/sage/doctest/control.py: Add available package systems to optional tags
c01aa8fsrc/sage/features/__init__.py: Mark tests that check for 'sage -i' optional - sage_spkg
5ef159c30606: fixing docstring """ -> r"""
d344adfMerge tag '9.2.beta13' into t/30606/sage_features_feature_resolution__if_sage_root_is_available__recommend_system_packages
a854438DocTestController.__init__: Only add package systems when 'optional' is used
68a8e2asrc/sage/features/__init__.py: Fix patchbot / relint warnings
81ef969Merge branch 't/30606/sage_features_feature_resolution__if_sage_root_is_available__recommend_system_packages' into t/30624/public/30624-improve-configure-recommendation-message
d8321b6build/bin/sage-print-system-package-command: Add option --verbose=COMMENT-PREFIX
90ffc55t-30624 improve configure recommendation message

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 5, 2020

Changed commit from 208d572 to 90ffc55

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2020

comment:7

Rebased as I suggested. You can now modify the invocations of sage-print-system-package-command to use something like this for the desired effect:

build/bin/sage-print-system-package-command homebrew --verbose='     ' --prompt='               $ ' setup-build-env foo

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2020

Author: Samuel Lelièvre, Matthias Koeppe

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 5, 2020

Dependencies: #30606

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 7, 2020

comment:10

Your turn, Samuel...

@slel
Copy link
Member Author

slel commented Oct 8, 2020

comment:11

Neither of the "notice: ...", "hint: ...",
or "After installation, ..." parts start with "# ".

So I tried to also avoid "# " for the text
on linking Homebrew's keg-only packages.

Thanks for showing me the correct way to do that.

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

mkoeppe commented Nov 1, 2020

comment:13

Samuel, do you plan to work on this?

@egourgoulhon
Copy link
Member

comment:14

FWIW, I've installed Sage 9.3.beta0 from scratch on Ubuntu 20.04; configure ends with the following recommendations:

configure: hint: installing the following system packages is recommended and may 
avoid building some of the above SPKGs from source:
configure:   $ sudo apt-get update 
  $ sudo apt-get install texlive-generic-extra texlive-xetex latexmk pandoc dvipng 
default-jdk ffmpeg libavdevice-dev libcdd-dev libcdd-tools libec-dev eclib-tools 
libgc-dev libgiac-dev xcas pari-gp2c lcalc liblfunction-dev libnauty-dev nauty 
pari-gp2c libpari-dev pari-doc pari-elldata pari-galdata pari-galpol pari-seadata 
sympow

Now, as mentioned in #29557 comment:56, texlive-generic-extra does not exist on Ubuntu 20.04 (there is texlive-latex-extra, which is already installed on my system). Moreover the recommended packages texlive-xetex, latexmk, pandoc, dvipng, default-jdk, ffmpeg, libavdevice-dev, libcdd-dev and libcdd-tools are already installed on my system.

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 17, 2020

comment:16

Updates of the package list and similar improvements -- please in #30930 or other tickets, not here.

Let's keep this ticket narrowly focused on what is already on the branch.

@mkoeppe mkoeppe changed the title Improve configure's recommendation message Improve wording and formatting of configure's recommendation message Nov 17, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 17, 2020

comment:17

Samuel, please let me know if I can help with anything else to get this ticket finished.

@slel
Copy link
Member Author

slel commented Nov 17, 2020

Changed author from Samuel Lelièvre, Matthias Koeppe to Matthias Koeppe

@slel
Copy link
Member Author

slel commented Nov 17, 2020

comment:18

What you did is good. Maybe set to needs_review and review as is?

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 18, 2020

comment:19

The new options that I introduced for you (comment:7) are not used yet.

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 18, 2020

Changed author from Matthias Koeppe to Samuel Lelièvre, Matthias Koeppe

@seblabbe

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 27, 2020

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

2016d4dbuild/bin/sage-print-system-package-command: Add option --verbose=COMMENT-PREFIX
0e77878t-30624 improve configure recommendation message
e617074m4/sage_spkg_collect.m4: Use new sage-print-system-package-command options to get indentation right
72f0081build/bin/sage-print-system-package-command (homebrew): Make wording regarding keg-only packages more specific

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 27, 2020

Changed commit from 90ffc55 to 72f0081

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 27, 2020

Reviewer: Matthias Koeppe, ...

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 27, 2020

comment:24

Ready for review

@seblabbe
Copy link
Contributor

comment:25

I just tested the branch on Ubuntu 18.04, I obtain:

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-generic-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
         

Should _recommended be listed in the first list?

@seblabbe
Copy link
Contributor

Changed reviewer from Matthias Koeppe, ... to Matthias Koeppe, Sébastien Labbé

@seblabbe
Copy link
Contributor

comment:26

Should _recommended be listed in the first list?

If the answer to that question is yes, please change the status of this ticket to positive review.

@seblabbe
Copy link
Contributor

comment:27

Should _recommended be listed in the first list?

I just observed that this is the current behavior on 9.3.beta2. So, this is independent of this ticket.

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 27, 2020

comment:28

Thank you!

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 27, 2020

comment:29

Replying to @seblabbe:

I just tested the branch on Ubuntu 18.04, I obtain:

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

Should `_recommended` be listed in the first list?

I am making some changes in this direction - suppressing display of packages starting with underscore - in #29124

@vbraun
Copy link
Member

vbraun commented Dec 5, 2020

Changed branch from public/30624-improve-configure-recommendation-message to 72f0081

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

5 participants