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

Upgrade autotools #21196

Closed
mkoeppe opened this issue Aug 9, 2016 · 25 comments
Closed

Upgrade autotools #21196

mkoeppe opened this issue Aug 9, 2016 · 25 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Aug 9, 2016

Upgrade autotools to the latest upstream versions, for no particular reason.

Depends on #21047
Depends on #24903

CC: @jdemeyer @nexttime @embray

Component: packages: experimental

Author: Matthias Koeppe, Julian Rüth

Branch/Commit: u/mkoeppe/upgrade-autotools @ d794672

Reviewer: Dima Pasechnik

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

@mkoeppe
Copy link
Member Author

mkoeppe commented Aug 9, 2016

Branch: u/mkoeppe/upgrade-autotools

@mkoeppe
Copy link
Member Author

mkoeppe commented Aug 9, 2016

comment:2

The branch attempts to upgrade the autotools versions. Building currently fails because libtool 2.4.3's patches against gnulib stuff do not apply cleanly when gnulib is too new.


New commits:

da4a28fUse Sage m4 to build libtool
d70e858Add xz as dependency
b2095e1Merge tag '7.3.beta9' into t/21047/_sage__i_autotools__fails_because_libtool_2_4_3_requires_xz
e09aaf3Expand discussion about M4
ff3f2b3Merge tag '7.3' into t/21047/_sage__i_autotools__fails_because_libtool_2_4_3_requires_xz
59fb410Install symlinks bin/{aclocal,automake}-AM_API_VERSION
72269ccspkg-write-makefile: Remove dependency on GNU sed
ce2b490spkg-write-makefile: Fix wrong prereq in automake 1.10
ba06f0eSupply .serial file for libtool
d794672Upgrade autotools versions

@mkoeppe
Copy link
Member Author

mkoeppe commented Aug 9, 2016

Commit: d794672

@mkoeppe
Copy link
Member Author

mkoeppe commented Aug 9, 2016

comment:3

(Branch is on top of #21047.)

@mkoeppe
Copy link
Member Author

mkoeppe commented Aug 9, 2016

Author: Matthias Koeppe

@embray
Copy link
Contributor

embray commented Nov 22, 2016

comment:8

Ah, I was just in the process of trying to do this myself (as I guess you saw on the ML). Thanks for adding me.

@embray
Copy link
Contributor

embray commented Nov 22, 2016

comment:9

Did you ever find a workaround to the issue of libtool 2.4.3 and gnulib? I have an idea for that that I'm testing now.

@embray
Copy link
Contributor

embray commented Nov 22, 2016

comment:10

Here's my idea--it worked for me. The idea is that there is an optional gnulib version appended to the libtool version (with a +). If given, it will check out that tag from the gnulib repo before building (otherwise it defaults to the master branch, which worked for all but libtool 2.4.3 anyways).

I admit the syntax is a bit awkward and am open to other ideas. I just didn't want to hard-code a special case just for this version (though that might be acceptable as well given that it ended up being the only one affected AFAICT).

diff --git a/build/pkgs/autotools/spkg-install b/build/pkgs/autotools/spkg-install
index c373e84..a514674 100755
--- a/build/pkgs/autotools/spkg-install
+++ b/build/pkgs/autotools/spkg-install
@@ -64,7 +64,10 @@ rm -f m4 makeinfo help2man autoconf autoheader autom4te autoreconf \
 source "$SRC/../version-list"
 for x in $autoconf_versions; do autoconf_latest=$x ; done
 for x in $automake_versions; do automake_latest=$x ; done
-for x in $libtool_versions; do libtool_latest=$x ; done
+for x in $libtool_versions; do
+    x=${x%+*}
+    libtool_latest=$x ;
+done

 # We install scripts for autoconf,... based on the generic "autofoo" script
 cd "$SAGE_LOCAL/bin"
diff --git a/build/pkgs/autotools/spkg-write-makefile b/build/pkgs/autotools/spkg-write-makefile
index 56e6040..4288eb2 100755
--- a/build/pkgs/autotools/spkg-write-makefile
+++ b/build/pkgs/autotools/spkg-write-makefile
@@ -90,6 +90,14 @@ write_make_rules() {
     all="$p-all:"
     for v in $*
     do
+        # Split the version into the package version and the required gnulib version
+        # if any; by default just use the master branch of gnulib
+        gnulib_ver="master"
+        if [[ "$v" == *+* ]]; then
+            gnulib_ver=${v#*+}
+            v=${v%+*}
+        fi
+
         echo >&2 "Processing $p-$v"
         cd $p

@@ -115,6 +123,11 @@ write_make_rules() {
             if [ ! -f configure ]; then
                 # libtool-2.4.3 requires some gnulib files
                 if [ -d gnulib ]; then
+                    echo >&2 "Preparing gnulib ${gnulib_ver}"
+                    cd ../gnulib
+                    git checkout "${gnulib_ver}"
+                    cd ../$p
+
                     cp -a ../gnulib/build-aux .
                 fi
                 # Run aclocal, such that AM_INIT_AUTOMAKE is available.
@@ -201,11 +214,15 @@ write_make_rules() {
         [ -z "$lt_ver" ] || echo -e "\texport LIBTOOL_VERSION=$lt_ver ; \\\\"
         [ -z "$ac_ver" ] || echo -e "\texport AUTOCONF_VERSION=$ac_ver ; \\\\"
         [ -z "$am_ver" ] || echo -e "\texport AUTOMAKE_VERSION=$am_ver ; \\\\"
-       echo -e "\tcd $p-$v && ${bootstrap}\\\\"
-       echo -e "\t    ./configure --prefix=\"\$(SAGE_LOCAL)/$p-$v\" && \\\\"
-       echo -e "\t    \$\$MAKE && \$\$MAKE install"
-       echo -e "\t# Remove all files except for the .* files"
-       echo -e "\t[ \"\$\$SAGE_KEEP_BUILT_SPKGS\" = yes ] || rm -rf $p-$v/*"
+
+    if [ $p = libtool -a -d gnulib ]; then
+        echo -e "\t(cd \$(SRC)/gnulib && git checkout ${gnulib_ver}) 1>&2 && \\\\"
+    fi
+    echo -e "\tcd $p-$v && ${bootstrap}\\\\"
+    echo -e "\t    ./configure --prefix=\"\$(SAGE_LOCAL)/$p-$v\" && \\\\"
+    echo -e "\t    \$\$MAKE && \$\$MAKE install"
+    echo -e "\t# Remove all files except for the .* files"
+    echo -e "\t[ \"\$\$SAGE_KEEP_BUILT_SPKGS\" = yes ] || rm -rf $p-$v/*"
         echo

         prevextract="$p-$v/.tarball-version"
diff --git a/build/pkgs/autotools/version-list b/build/pkgs/autotools/version-list
index c4a2f2e..0edf2ad 100644
--- a/build/pkgs/autotools/version-list
+++ b/build/pkgs/autotools/version-list
@@ -15,9 +15,16 @@ automake_versions="
     1.9 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.10 1.10.1 1.10.2 1.10.3
     1.11 1.11.1 1.11.2 1.11.3 1.11.4 1.11.5 1.11.6 1.12 1.12.1 1.12.2
     1.12.3 1.12.4 1.12.5 1.12.6 1.13 1.13.1 1.13.2 1.13.3 1.13.4
-    1.14 1.14.1"
+    1.14 1.14.1 1.15"

 libtool_versions="
     1.5.20 1.5.22 1.5.24 1.5.26
     2.2.4 2.2.6 2.2.6b 2.2.8 2.2.10
-    2.4 2.4.2 2.4.3"
+    2.4 2.4.2 2.4.3+v0.1-253-ge28a0f7
+    2.4.4 2.4.5 2.4.6"
+
+m4_version=1.4.17
+
+help2man_version=1.47.4
+
+texinfo_version=4.13

@embray
Copy link
Contributor

embray commented Nov 22, 2016

comment:11

Turns out I was wrong--gnulib master does not work some of the later libtool versions as well. A simpler solution looks like it might be to just use the same gnulib version across all of them.

@embray
Copy link
Contributor

embray commented Nov 22, 2016

comment:12

BTW, a more general bug--when I tried the spkg-src it failed at source version-list since it cds to a different directory before the source command, which should come earlier.

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 23, 2016

comment:13

Replying to @embray:

BTW, a more general bug--when I tried the spkg-src it failed at source version-list since it cds to a different directory before the source command, which should come earlier.

Do you mean spkg-write-makefile instead of spkg-src?

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 23, 2016

comment:14

Replying to @embray:

Turns out I was wrong--gnulib master does not work some of the later libtool versions as well. A simpler solution looks like it might be to just use the same gnulib version across all of them.

"all of them" = all versions or all currently failing versions?

which gnullib version would you want to use?

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 23, 2016

comment:15

I think there's also a similar problem with texinfo. Old autotools versions break with texinfo >= 5; and IIRC, some newer autotools versions I think need texinfo >= 5.

@embray
Copy link
Contributor

embray commented Nov 23, 2016

comment:16

Replying to @mkoeppe:

Replying to @embray:

BTW, a more general bug--when I tried the spkg-src it failed at source version-list since it cds to a different directory before the source command, which should come earlier.

Do you mean spkg-write-makefile instead of spkg-src?

No: https://github.com/sagemath/sagetrac-mirror/blob/527d09f4cf53eb2f9972aff4b9451823bda76fd9/build/pkgs/autotools/spkg-src

@embray
Copy link
Contributor

embray commented Nov 23, 2016

comment:17

Replying to @mkoeppe:

Replying to @embray:

Turns out I was wrong--gnulib master does not work some of the later libtool versions as well. A simpler solution looks like it might be to just use the same gnulib version across all of them.

"all of them" = all versions or all currently failing versions?

which gnullib version would you want to use?

I found git checkout v0.1-253-ge28a0f7 on gnulib to work on all the versions of libtool both before this ticket, and the ones added by this ticket.

@embray
Copy link
Contributor

embray commented Nov 23, 2016

comment:18

Replying to @mkoeppe:

I think there's also a similar problem with texinfo. Old autotools versions break with texinfo >= 5; and IIRC, some newer autotools versions I think need texinfo >= 5.

I didn't run into this particular problem but maybe I didn't try it on any packages that use texinfo. Can you point to a specific example?

@dimpase
Copy link
Member

dimpase commented Jan 1, 2018

comment:20

ping?

@saraedum
Copy link
Member

saraedum commented Apr 4, 2018

comment:21

What should we do about this ticket? Should we try to upgrade? (I could try to work on this…)

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 5, 2018

comment:22

See also - #24903 optional package autotools fail to build

@saraedum
Copy link
Member

saraedum commented Apr 8, 2018

Changed dependencies from #21047 to #21047, #24903

@saraedum
Copy link
Member

saraedum commented Apr 8, 2018

comment:24

If we decide to drop autotools in #24903, then this can be closed.

@saraedum
Copy link
Member

Changed author from Matthias Koeppe to Matthias Koeppe, Julian Rüth

@saraedum
Copy link
Member

comment:25

I propose to make autotools experimental and drop it some day. I don't think we should put too much effort into upgrading this.

If somebody else wants to take over with the upgrade (and has a system where this actually builds) they should feel free to take over of course :)

@dimpase
Copy link
Member

dimpase commented Apr 22, 2018

Reviewer: Dima Pasechnik

@videlec
Copy link
Contributor

videlec commented May 18, 2018

comment:27

closing positively reviewed duplicates

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