Ticket #3603 (accepted enhancement)

Opened 2 years ago

Last modified 4 months ago

Redo version detection in autoconf to use modern practices

Reported by: zaytsev Owned by: andrew_b
Priority: minor Milestone: 4.8.21
Component: mc-core Version: master
Keywords: Cc: egmont
Blocked By: Blocking:
Branch state: on rework Votes for changeset:


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 2 years ago by andrew_b

Related to #2252.

comment:2 Changed 2 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 23 months ago by zaytsev

  • Milestone changed from Future Releases to 4.8.18

comment:4 Changed 23 months 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 23 months 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 23 months 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 23 months ago by zaytsev

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


comment:8 Changed 18 months ago by zaytsev

  • Milestone changed from 4.8.18 to 4.8.19

comment:9 Changed 16 months 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 16 months 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 16 months ago by andrew_b

Replying to zaytsev-work:

After your changes DISTR_VERSION will be blank


comment:12 Changed 16 months 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 16 months 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 16 months 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 16 months ago by egmont

  • Cc egmont added

comment:16 Changed 15 months ago by andrew_b

  • Branch state changed from on review to on rework

comment:17 Changed 4 months ago by zaytsev

  • Milestone changed from 4.8.20 to 4.8.21
Note: See TracTickets for help on using tickets.