Ticket #3603 (closed task: fixed)

Opened 8 years ago

Last modified 3 years ago

Redo version detection in autoconf to use modern practices

Reported by: zaytsev Owned by: andrew_b
Priority: minor Milestone: 4.8.27
Component: mc-core Version: master
Keywords: Cc: egmont, info@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Currently we have a custom macro mc_VERSION used to autodetect the version from git tags. This is a problem, because we can't modernize our autoconf build system to use currently supported invocations of AC_INIT and AM_INIT_AUTOMAKE.

One important use case for fixing this would be to switch to tar-pax in our tarballs or at least set filename-length-max=99 to catch broken tarballs on make dist. Currently that's next to impossible, and Travis was building broken tarballs without anyone noticing for quite some time.

The correct way to autodetect version string with autotools is to use the m4_esyscmd_s macro. This macro is used by autoconf itself at least since autoconf 2.62 (so, an example can be found in its source code).

Change History

comment:1 Changed 8 years ago by andrew_b

Related to #2252.

comment:2 Changed 8 years ago by and

Yep, plus get rid of

configure.ac:13: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.ac:13: http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation

Questionable is with which required autoconf version we what to go.
Too high version requirement means out-of-the-box compiling from git will failed on older distributions. But I see only rhel6 (autoconf 2.63) compromise.

comment:3 Changed 8 years ago by zaytsev

  • Milestone changed from Future Releases to 4.8.18

comment:4 Changed 8 years ago by zaytsev

Reminder to myself:

configure.ac:268: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
configure.ac:268: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:268: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.

comment:5 Changed 8 years ago by zaytsev

Another thing: I wonder where this comes from -

ar: `u' modifier ignored since `D' is the default (see `U')

Fedora 23.

comment:6 Changed 8 years ago by zaytsev

Okay, I have finally found where the AM_PROG_MKDIR_P comes from. This is from gettext-0.18, and it's pulled in by autopoint even though I have 0.19.x installed on the build host, because that's what we require in configure.ac. It will be gone if we bump the requirement to at least gettext-0.18.2, but this will already exclude people trying to bootstrap mc on Ubuntu 12.04. I guess we'll be able to get rid of it in a couple of years... :-/

comment:7 Changed 8 years ago by zaytsev

Re. "ar: `u' modifier ignored" problem, it seems that wait & do nothing is the best strategy:

https://bugzilla.redhat.com/show_bug.cgi?id=1155273

comment:8 Changed 8 years ago by zaytsev

  • Milestone changed from 4.8.18 to 4.8.19

comment:9 Changed 7 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Branch state changed from no branch to on review

comment:10 follow-up: ↓ 11 Changed 7 years ago by zaytsev-work

After your changes DISTR_VERSION will be blank I thin; if you are not in a hurry, I would really like to check everything that has to do with versioning first, I think this can wait for a long time... :-/

comment:11 in reply to: ↑ 10 Changed 7 years ago by andrew_b

Replying to zaytsev-work:

After your changes DISTR_VERSION will be blank

Fixed.

comment:12 Changed 7 years ago by egmont

Hi guys,

Are you planning to address the related bug #2252 any time soon? Will this fix bring us closer to that?

Getting rid of autogen runs and complete rebuilds during e.g. a git bisect would be a big developer productivity boost.

comment:13 Changed 7 years ago by and

If "proper AC_INIT and AM_INIT_AUTOMAKE usage" seems unlikely
please have a look into util-linux or wget source code.

These using a more common way to deal with git/tarball versions.

 m4_esyscmd([build-aux/git-version-gen .tarball-version]),
 m4_esyscmd([tools/git-version-gen .tarball-version]),

comment:14 Changed 7 years ago by zaytsev

@egmont, with the current patch it will make matters even worse in terms of #2252. That's why I'm not very happy about merging it in its current form. My plan was to look into autotools and/or other packages as @and says to find out how they do versioning, and try to port it over to mc, including fixing the #2252 while we are at it. When I can find time for that, I can't say :-(

comment:15 Changed 7 years ago by egmont

  • Cc egmont added

comment:16 Changed 7 years ago by andrew_b

  • Branch state changed from on review to on rework

comment:17 Changed 6 years ago by zaytsev

  • Milestone changed from 4.8.20 to 4.8.21

comment:18 Changed 6 years ago by zaytsev

  • Milestone changed from 4.8.21 to 4.8.22

comment:19 Changed 5 years ago by zaytsev

  • Milestone changed from 4.8.22 to 4.8.23

comment:20 Changed 5 years ago by zaytsev

  • Milestone changed from 4.8.23 to 4.8.24

comment:21 Changed 5 years ago by metux

  • Cc info@… added

comment:22 Changed 4 years ago by zaytsev

  • Milestone changed from 4.8.25 to 4.8.26

comment:23 Changed 3 years ago by and

Another try to tidy up deprecate AM_INIT_AUTOMAKE :)

comment:24 Changed 3 years ago by zaytsev

  • Milestone changed from 4.8.26 to 4.8.27

comment:25 Changed 3 years ago by andrew_b

  • Type changed from enhancement to task
  • Branch state changed from on rework to on review

comment:26 Changed 3 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:27 Changed 3 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [8519c7e5b460a241e0f67d32dff306fe22dcd404].

git log --pretty=oneline 6a6fdf1ae..8519c7e5b

comment:28 Changed 3 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.