Skip to content

Commit b37ed1c

Browse files
author
Release Manager
committed
Trac #34152: Remove remaining dependencies of bootstrap on gettext (AC_LIB_RPATH etc.)
**Background**: `./bootstrap` needs about 112 KB of m4 and shell code from `gnulib`: https://www.gnu.org/software/gnulib Before #29549, these files were copied from a system-wide installation of `gettext` (which uses `gnulib`): https://www.gnu.org/software/gettext As opposed to `gettext`, `gnulib` does not make releases, and many systems don't package `gnulib` at all. Thus one cannot uniformly rely on `gnulib` being already installed. This essentially leaves two options for using `gnulib` in Sage - copy said 112K into the Sage git tree, or provide `gnulib` as a Sage pseudo-package (pseudo, due to the chicken vs egg issue: one cannot just make it an ordinary spkg - it needs to be used by `bootstrap`). Who needs to run `bootstrap` and where: - Any developer who switches to a branch that makes an SPKG upgrade or other changes to the build system, on their development machine. - Our [[https://doc.sagemath.org/html/en/developer/portability_testing.html #testing-sage-on-a-different-platform-using-docker|portability testsuite]], run locally using `tox -e docker-...` and on GH Actions, in the Docker container for the tested platform. Who does not need to run `bootstrap`: - Users who only build released versions from tarballs - because they come pre-bootstrapped - Users who only build released versions from a git clone - because Sage falls back to downloading a tarball of the `configure` SPKG. -------- **History**: #29549 intended to remove the dependency of `bootstrap` on `gettext`. #29549 made it possible to run `bootstrap` on the `manylinux` platforms needed by cibuildwheel (#33800). The branch of #29549 followed "copy files" approach. However, some files that `gnulib-tool` added were left out from the commit, so it breaks on machines on which `gettext` is missing completely, as reported in https://groups.google.com/g/sage-release/c/FezzF5Q7Wt4/m/xyxVTaYgBAAJ ------- **This ticket**: Here we complete the task and remove `gettext` from various `distros/` files etc. Two approaches have been proposed: mkoeppe ("copy files") : [[https://github.com/sagemath/sagetrac- mirror/compare/develop...4011cc4608|Branch u/mkoeppe/fix_broken_bootstrap__ac_lib_rpath_etc__ @ 4011cc4608]] - Follows approach 3 of the [[https://www.gnu.org/software/gnulib/manual/html_node/VCS- Issues.html|Gnulib manual section 'Integration with Version Control Systems']]. - 5 files, in `config/` and `m4/`, total 112 KB, have been imported by using [[https://www.gnu.org/software/gnulib/manual/html_node/Initial- import.html|`gnulib-tool import iconv`]] and committed to the branch. - Matches our practice with imported files [[https://github.com/sagemath/sage/tree/develop/m4|`m4/ax_*.m4`]] from [[https://www.gnu.org/software/autoconf-archive/The-Macros.html |autoconf-archive]]. Different from our practice with SPKGs because the files are needed to generate the `configure` script. - Introduces no new dependency. - Burden on a developer who authors an update ticket for these files: Obtain gnulib by cloning the repo, then re-run `gnulib-tool import`, remove unneeded files (that's where #29549 went wrong), commit the changes. (Updates are expected to be necessary only very rarely.) - Burden on users and other developers: None. - dimpase's criticism of this approach: "gnulib's code is not Sage's code, it has no place in Sage git tree; this way, updating the imported gnulib files is tricky and error-prone by design". dimpase ("Sage pseudo-package"): https://github.com/sagemath/sagetrac- mirror/compare/develop...u/dimpase/config/gnulib - Follows approach 2(C) of the [[https://www.gnu.org/software/gnulib/manual/html_node/VCS- Issues.html|Gnulib manual section 'Integration with Version Control Systems']], but instead of using Gnulib's [[https://www.gnu.org/software/gnulib/manual/html_node/Developer- tools.html|Programs for developing in Git checkouts]], implements its own script (making checkout much faster, as full `gnulib` checkout is 250 MB). - Introduces a new (although one can't really do Sage development without `git` installed) dependency on `git` and on availability of internet connection at the first run of `./bootstrap` in a tree, to pull 83 MB (fair to say that internet is needed for Sage development a lot, anyway). - Burden on a developer who authors an update ticket for these files: Edit the `bootstrap` file to change the commit hash, verify that the list of files removed by `make bootstrap-clean` is still correct, commit this change - Burden on other users: a pseudo-package needs to be installed once (and updated, automatically) - mkoeppe's criticism of this approach: "Having `bootstrap` operate a multi-megabyte git clone (on the 1st install and when there's a change of the gnulib commit hash) in the `upstream/` directory increases complexity for no benefit." hybrid ("copy files, spkg-src script for maintenance"): [[https://github.com/sagemath/sagetrac- mirror/compare/develop...u/mkoeppe/config/gnulib|Branch u/mkoeppe/config/gnulib]] - Resolves the criticism on the "copy files" approach: "updating the imported gnulib files" is now assisted by the `spkg-src` script (adapted from dimpase's branch) - Resolves the criticism on the "Sage pseudo-package" approach: "operate a multi-megabyte git clone (on the 1st install and when there's a change of the gnulib commit hash)" is only done by authors of tickets that update gnulib, not by general users of `bootstrap`. ------- '''Voting took place at https://groups.google.com/g/sage- devel/c/E2qstbWXC7g''' ------- To test: For example `tox -r -e local-homebrew-macos-minimal -- config.status` URL: https://trac.sagemath.org/34152 Reported by: mkoeppe Ticket author(s): Matthias Koeppe, Dima Pasechnik Reviewer(s): François Bissey, ​Dima Pasechnik, Matthias Koeppe, Kwankyu Lee
2 parents cae9ee5 + 8bf9d97 commit b37ed1c

24 files changed

+2065
-27
lines changed

.homebrew-build-env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# that activate keg-only homebrew package installations
33

44
HOMEBREW=`brew --prefix` || return 1
5-
for l in gettext bzip2 texinfo polymake; do
5+
for l in bzip2 texinfo polymake; do
66
if [ -d "$HOMEBREW/opt/$l/bin" ]; then
77
PATH="$HOMEBREW/opt/$l/bin:$PATH"
88
fi
@@ -39,7 +39,7 @@ for l in "gcc/lib/gcc/11 gcc/lib/gcc/10 gcc/lib/gcc/9"; do
3939
done
4040
export LIBRARY_PATH
4141
export CPATH
42-
for l in gettext; do
42+
for l in ; do
4343
if [ -d "$HOMEBREW/opt/$l/share/aclocal" ]; then
4444
ACLOCAL_PATH="$HOMEBREW/opt/$l/share/aclocal:$ACLOCAL_PATH"
4545
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Packages needed for ./bootstrap
2-
gettext autoconf automake libtool
2+
autoconf automake libtool
33
# Otherwise: Error: could not locate the pkg-config autoconf macros. These are
44
pkg-config
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Packages needed for ./bootstrap
2-
gettext autoconf automake libtool
2+
autoconf automake libtool
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Packages needed for ./bootstrap
2-
gettext-devel autoconf automake libtool
2+
autoconf automake libtool

build/pkgs/_bootstrap/distros/debian.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Packages needed for ./bootstrap
2-
gettext
32
autoconf
43
automake
54
libtool
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Packages needed for ./bootstrap
2-
gettext-devel autoconf automake libtool
2+
autoconf automake libtool
33
# Fedora 26 needs:
44
pkg-config
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Packages needed for ./bootstrap
2-
gettext autoconf automake libtool pkg-config
2+
autoconf automake libtool pkg-config
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Packages needed for ./bootstrap
2-
gettext autoconf automake libtool pkg-config
2+
autoconf automake libtool pkg-config

build/pkgs/_bootstrap/distros/nix.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Packages needed for ./bootstrap
2-
gettext autoconf automake libtool pkg-config
2+
autoconf automake libtool pkg-config

build/pkgs/_bootstrap/distros/opensuse.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Packages needed for ./bootstrap
2-
gettext-tools
32
autoconf
43
automake
54
libtool

0 commit comments

Comments
 (0)