Opened 2 years ago

Closed 2 years ago

#30624 closed enhancement (fixed)

Improve wording and formatting of configure's recommendation message

Reported by: slelievre Owned by:
Priority: major Milestone: sage-9.3
Component: build: configure Keywords:
Cc: egourgoulhon, mjo, mkoeppe, slelievre, gh-tobiasdiez, slabbe Merged in:
Authors: Samuel Lelièvre, Matthias Koeppe Reviewers: Matthias Koeppe, Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 72f0081 (Commits, GitHub, GitLab) Commit: 72f00813745794bf1386517393bbf749d7aeb6a8
Dependencies: #30606 Stopgaps:

GitHub link to the corresponding issue

Description (last modified by slabbe)

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).

Change History (30)

comment:1 Changed 2 years ago by slelievre

Description: modified (diff)

comment:2 Changed 2 years ago by slelievre

Branch: public/30624-improve-configure-recommendation-message
Commit: 208d57272ee098e0e932a1356978e1cc99e9ce7c
Status: newneeds_review

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

comment:3 Changed 2 years ago by slelievre

Cc: mjo added

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.

comment:4 Changed 2 years ago by mkoeppe

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."

comment:5 Changed 2 years ago by mkoeppe

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

comment:6 Changed 2 years ago by git

Commit: 208d57272ee098e0e932a1356978e1cc99e9ce7c90ffc5575380b254a21ff92690249fd6895167be

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

comment:7 Changed 2 years ago by mkoeppe

Authors: Samuel Lelièvre, Matthias Koeppe

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

comment:8 Changed 2 years ago by mkoeppe

Dependencies: #30606

comment:9 Changed 2 years ago by mkoeppe

Status: needs_reviewneeds_work

comment:10 Changed 2 years ago by mkoeppe

Your turn, Samuel...

comment:11 Changed 2 years ago by slelievre

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.

comment:12 Changed 2 years ago by mkoeppe

Milestone: sage-9.2sage-9.3

comment:13 Changed 2 years ago by mkoeppe

Samuel, do you plan to work on this?

comment:14 Changed 2 years ago by egourgoulhon

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 https://trac.sagemath.org/ticket/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.

comment:15 Changed 2 years ago by mkoeppe

Cc: gh-tobiasdiez added

comment:16 Changed 2 years ago by mkoeppe

Summary: Improve configure's recommendation messageImprove wording and formatting of configure's recommendation message

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.

comment:17 Changed 2 years ago by mkoeppe

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

comment:18 Changed 2 years ago by slelievre

Authors: Samuel Lelièvre, Matthias KoeppeMatthias Koeppe

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

comment:19 Changed 2 years ago by mkoeppe

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

comment:20 Changed 2 years ago by mkoeppe

Authors: Matthias KoeppeSamuel Lelièvre, Matthias Koeppe

comment:21 Changed 2 years ago by mkoeppe

Cc: slabbe added

comment:22 Changed 2 years ago by slabbe

Description: modified (diff)

comment:23 Changed 2 years ago by git

Commit: 90ffc5575380b254a21ff92690249fd6895167be72f00813745794bf1386517393bbf749d7aeb6a8

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

comment:24 Changed 2 years ago by mkoeppe

Reviewers: Matthias Koeppe, ...
Status: needs_workneeds_review

Ready for review

comment:25 Changed 2 years ago by slabbe

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?

comment:26 Changed 2 years ago by slabbe

Reviewers: Matthias Koeppe, ...Matthias Koeppe, Sébastien Labbé

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.

comment:27 Changed 2 years ago by slabbe

Status: needs_reviewpositive_review

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.

comment:28 Changed 2 years ago by mkoeppe

Thank you!

comment:29 in reply to:  25 Changed 2 years ago by mkoeppe

Replying to slabbe:

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

comment:30 Changed 2 years ago by vbraun

Branch: public/30624-improve-configure-recommendation-message72f00813745794bf1386517393bbf749d7aeb6a8
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.