Ticket #3603 (closed task: fixed)
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).
Attachments
Change History
comment:2 Changed 9 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.
Changed 9 years ago by and
comment:4 Changed 9 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 9 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 9 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 9 years ago by zaytsev
Re. "ar: `u' modifier ignored" problem, it seems that wait & do nothing is the best strategy:
comment:9 Changed 8 years ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- Branch state changed from no branch to on review
Branch: 3603_version
Initial changeset:98f52561a31d7229a49885466ddbf1c8b5ec440a
comment:10 follow-up: ↓ 11 Changed 8 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 8 years ago by andrew_b
comment:12 Changed 8 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 8 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 8 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:23 Changed 4 years ago by and
Another try to tidy up deprecate AM_INIT_AUTOMAKE :)
Changed 4 years ago by and
Changed 4 years ago by and
- Attachment mc-3603-configure.ac-fix-deprecated-AM_PROG_MKDIR_P-warning.patch added
comment:25 Changed 4 years ago by andrew_b
- Type changed from enhancement to task
- Branch state changed from on rework to on review
Branch: 3603_version
Initial changeset:94d954a8e8e36061d60690f0ee7fd843c8cbc2d9
comment:26 Changed 4 years ago by andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from on review to approved
comment:27 Changed 4 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
Related to #2252.