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

configure.ac:1: warning: AC_INIT: not a literal: m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX") #5832

Open
juhp opened this issue Dec 26, 2021 · 13 comments
Labels
bug build-problem Nix fails to compile or test; also improvements to build process

Comments

@juhp
Copy link

juhp commented Dec 26, 2021

Describe the bug

I am trying to build nix on Fedora from source.

Steps To Reproduce

  1. Download 2.5.1 (or 2.5.0 or 2.4) from github tag
  2. Unpack tarball
  3. run autoreconf or ./bootstrap.sh
+ ./bootstrap.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
configure.ac:1: warning: AC_INIT: not a literal: m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")
configure.ac:1: warning: AC_INIT: not a literal: m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")
autoreconf: configure.ac: tracing
configure.ac:1: warning: AC_INIT: not a literal: m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")
autoreconf: configure.ac: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
configure.ac:1: warning: AC_INIT: not a literal: m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")
configure.ac:108: error: possibly undefined macro: AC_MSG_ERROR
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1

Expected behavior

configure script to be created without error.

Additional context

Call me old-fashioned, but I would really prefer to have a bootstrapped tarball as part of formal releases.

@juhp juhp added the bug label Dec 26, 2021
@uemax
Copy link

uemax commented Dec 26, 2021

Well, I got same issue. Maybe you can simply modify the configure.ac file to avoid these errors.

Here is my solution:

Origin: AC_INIT([nix],[m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")])

Modified: AC_INIT([nix], m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX"))

Just remove the square brackets, no errors again.

@weilbith
Copy link

@whoschen his comment already helped. Now I also get configure.ac:108: error: possibly undefined macro: AC_MSG_ERROR.

@Kha
Copy link
Contributor

Kha commented Dec 26, 2021

AFAIR these errors are usually triggered by missing build dependencies, e.g. libtool and/or m4

@juhp
Copy link
Author

juhp commented Dec 27, 2021

FWIW I have:

$ rpm -q autoconf automake libtool m4
autoconf-2.69-37.fc35.noarch
automake-1.16.2-5.fc35.noarch
libtool-2.4.6-42.fc35.x86_64
m4-1.4.19-2.fc35.x86_64

Though I got the same error with Fedora 36 autoconf-2.71.

@uemax
Copy link

uemax commented Dec 27, 2021

Maybe you should try to install autoconf-archive and pkg-config, then re-clone
the repository and run commands listed in manual.

@dmacvicar
Copy link

Maybe you should try to install autoconf-archive and pkg-config, then re-clone
the repository and run commands listed in manual.

This solved (this) issue for me.

@juhp
Copy link
Author

juhp commented Jan 4, 2022

Thank you, seems I was missing autoconf-archive indeed.

Are the build requirements documented somewhere?
I do see autoconf-archive listed in release-common.nix

@stale
Copy link

stale bot commented Jul 10, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jul 10, 2022
@veprbl
Copy link
Member

veprbl commented Nov 15, 2022

Still an issue.

@stale stale bot removed the stale label Nov 15, 2022
@big-harry
Copy link

Still an issue on MacOS, even with m4 installed from brew and it being first in $PATH

@edolstra edolstra added the build-problem Nix fails to compile or test; also improvements to build process label Nov 22, 2022
andreabedini added a commit to andreabedini/nix that referenced this issue Feb 17, 2023
andreabedini added a commit to andreabedini/nix that referenced this issue Feb 21, 2023
This reverts commit 746f4d5.
@stale stale bot added the stale label May 21, 2023
@tfc
Copy link
Contributor

tfc commented Jul 12, 2023

I also ran into this problem. used nix develop in the repository on nixos. Would expect the project to be bundled with the right shell definition for building the project.

@stale stale bot removed the stale label Jul 12, 2023
@robcohen
Copy link

Also got the same error, apt-get install autoconf-archive fixed it for me. OS is PopOS!

@ghost
Copy link

ghost commented Mar 4, 2024

Use yay -S autoconf-archive in Arch-based distributions.

jimklimov added a commit to jimklimov/nut that referenced this issue Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build-problem Nix fails to compile or test; also improvements to build process
Projects
None yet
Development

No branches or pull requests

10 participants