sagemath/sage

bootstrap: Clean up use of gettextize

mkoeppe opened this issue · 33 comments

See discussion at
Homebrew/homebrew-core#53192

Instead of using gettextize at bootstrap time, we just vendor the files m4/iconv.m4 and config/config.rpath in the source tree.

This is done by using gnulib: gnulib-tool --import iconv (and ignoring all the other files that it is offering us).

CC: @dimpase

Component: build: configure

Author: Matthias Koeppe

Branch: d9bd946

Reviewer: Dima Pasechnik

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

comment:1

Definitely not for 9.1.

Description changed:

--- 
+++ 
@@ -1,3 +1,6 @@
 See discussion at
 https://github.com/Homebrew/homebrew-core/issues/53192
 
+
+Instead of gettextize, we may want to use gnulib https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html
+
comment:3

(from dimpase on #27823)

Bruno Haible says on bug-autoconf that one should use gnulib's iconv module to install config.rpath etc. Indeed,

gnulib-tool --import iconv

will install config.rpath into config/ (among with other things that probably can be ignored).
So this is something to try in order to get rid of the hacky install_config_rpath() in comment:18

comment:4

Unfortunately, gnulib is not present on homebrew (https://repology.org/project/gnulib/versions), so we should not try to use it in the bootstrap phase... Of course we can just commit the generated file -- it probably does not change so often.

Author: Matthias Koeppe

Commit: 318f58c

New commits:

318f58cm4/iconv.m4, config/config.rpath: Import using gnulib-tool --import iconv

Description changed:

--- 
+++ 
@@ -2,5 +2,8 @@
 https://github.com/Homebrew/homebrew-core/issues/53192
 
 
-Instead of gettextize, we may want to use gnulib https://www.gnu.org/software/gnulib/manual/html_node/gettextize-and-autopoint.html
+Instead of using `gettextize` at bootstrap time, we just vendor the files `m4/iconv.m4` and `config/config.rpath` in the source tree. 
 
+This is done by using gnulib: `gnulib-tool --import iconv` (and ignoring all the other files that it is offering us).
+
+
comment:7

Replying to @mkoeppe:

Unfortunately, gnulib is not present on homebrew (https://repology.org/project/gnulib/versions), so we should not try to use it in the bootstrap phase... Of course we can just commit the generated file -- it probably does not change so often.

any reason for gnulib not being on homebrew?

(anyhow, I'm testing this now).

comment:8

Replying to @dimpase:

any reason for gnulib not being on homebrew?

(anyhow, I'm testing this now).

upstream says: just use git to get gnulib, as there is nothing to build.
https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00041.html

Hmm, yes, we can in principle have gnulib installed as a git submodule...

comment:9

Replying to @dimpase:

upstream says: just use git to get gnulib, as there is nothing to build.

That's what I did, and I committed the result.

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

2f9b436build/bin/write-dockerfile.sh: Copy config.rpath to container

Changed commit from 318f58c to 2f9b436

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

e52fd00build/bin/write-dockerfile.sh: Copy config.rpath to container

Changed commit from 2f9b436 to e52fd00

comment:12

I tested this before the last 2 commits were added. Should they be tested with docker somehow?

Reviewer: Dima Pasechnik

comment:14

ok, lgtm

comment:15

Thanks!

comment:16

When actually trying to use the generated confball I get (on OSX):

Using cached file /Users/buildbot-sage/worker/sage_git/build/upstream/configure-4b0180ea3fe0842fd17ffa15afa79dc3b4bf2cd0.tar.gz
config/install-sh: Skipping hardlink pointing to itself: config/install-sh
tar: Error exit delayed from previous errors.

The build seems to continue but skipping to untar a file is probably not good...

comment:17

which tar?

comment:18

Do use rdfind in this tree?

Changed commit from e52fd00 to d9bd946

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

d9bd946Makefile, bootstrap: Remove duplication of install-sh
comment:20

Can't reproduce without more detail but here's removing a duplication of install-sh as an argument to tar.

comment:21

let me test this on macOS

comment:22

lgtm - running ./bootstrap -s followed by /bootstrap -d works without warnings/errors.

comment:23

Thanks!

Changed commit from d9bd946 to none

comment:25

Follow-up in #34152