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

Can't build from source.tgz #916

Closed
sterpe opened this issue Aug 18, 2015 · 13 comments
Closed

Can't build from source.tgz #916

sterpe opened this issue Aug 18, 2015 · 13 comments

Comments

@sterpe
Copy link

sterpe commented Aug 18, 2015

Maybe I'm doing something wrong...?

See there is no ./configure so attempted to autoconf

17:54:02 [10133\0] <sterpe@sterpe-pro:~/src> $ curl -LSO https://github.com/stedolan/jq/archive/jq-1.5.tar.gz
17:54:28 [10134\0] <sterpe@sterpe-pro:~/src> $ tar xzf jq-1.5.tar.gz 
17:54:48 [10135\0] <sterpe@sterpe-pro:~/src> $ cd jq-jq-1.5/
17:54:52 [10136\0] <sterpe@sterpe-pro:~/src/jq-jq-1.5> $ ./configure
-bash: ./configure: No such file or directory
17:54:56 [10137\127] <sterpe@sterpe-pro:~/src/jq-jq-1.5> $ autoconf
fatal: Not a git repository (or any of the parent directories): .git
configure.ac:12: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:13: error: possibly undefined macro: AM_SILENT_RULES
configure.ac:14: error: possibly undefined macro: AM_PROG_AR
configure.ac:15: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.ac:23: error: possibly undefined macro: AM_PROG_CC_C_O
configure.ac:132: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:140: error: possibly undefined macro: AC_FIND_FUNC
configure.ac:166: error: possibly undefined macro: AC_CHECK_MATH_FUNC
17:55:00 [10138\1] <sterpe@sterpe-pro:~/src/jq-jq-1.5> $ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in config "."/config
@pkoppstein
Copy link
Contributor

Maybe I'm doing something wrong...?

Please try "autoreconf -i" before running ./configure. On my machine, this produces "fatal" error messages, but they shouldn't stop the creation of the jq executable.

@nicowilliams / @dtolnay - Please note:
(1) The statement at https://stedolan.github.io/jq/download that "You can build it using the usual ./configure ..." is at best misleading.
(2) When I used the curl/tar/autoreconf/... method, the resulting binary does not report its version number properly:

$ jq --version
jq-

@dtolnay
Copy link
Member

dtolnay commented Aug 18, 2015

There are two source tarballs linked at the bottom of https://github.com/stedolan/jq/releases/tag/jq-1.5 - one that GitHub publishes automatically which is just the raw source from git, and one that @nicowilliams created that includes a configure script and does not require autoconf (EDIT: and --version is correct). I don't see a way to hide the GitHub automatic one. To make things worse I originally linked to the wrong one from the website, which is fixed in this commit 19577fc.

I think the way to avoid this situation going forward is to not publish our own tarball, but put the configure script into git so that the GitHub automatic tarball works with just ./configure.

* 3ebfc3b (master) great bug fix
* e78f81b moving on
| * d680d01 (tag: v1.6) add configure script for 1.6
|/  
* e74a92f fix bug
* 8da69d9 my sweet commit

@nicowilliams
Copy link
Contributor

The tgz added by github is not helpful, no. It's not the first time I've noticed it either; every time I hope no one else notices it :(

Anyways, @stedolan didn't like the ideas of committing a built jq.1 or the outputs of flex and bison. But we did it anyways (with @stedonal AWOL :) because it was ETOOHARD for users to deal with the jq's build dependencies and we still wanted users to be able build from git. But I'm not convinced that this particular annoyance deerves the same treatment, and I was always quite reluctant to commit build artifacts too, only just a tad more pragmatic about it than @stedolan :/

@nicowilliams
Copy link
Contributor

@pkoppstein (1) is a non-issue, just grab the right tarball/zipball. (2) is also a non-issue for the same reason, but it is annoying, and it'd be nice if scripts/version could detect when the "archive" is being built (probably by finding that there's no .git directory, so it could output something like "jq-unknown", but I don't know how it could do better than than (maybe it could look at the name of the current directory in the parent directory and hope it's something like jq-jq-X.Y??). EDIT: Or commit ./configure, which, blargh.

@dtolnay
Copy link
Member

dtolnay commented Aug 18, 2015

I think there is a difference between including build artifacts in every commit versus putting them in tagged releases only. I think the latter is valuable in the case of configure and whatever else is normally in the release tarball but not in git.

@nicowilliams
Copy link
Contributor

Oh! Right, I get it now. Yes, that's a good idea. We could add the autoconf outputs to the 1.5 branch and move the tag, causing github to update the archive tarball and zipball...

@dtolnay
Copy link
Member

dtolnay commented Aug 18, 2015

Sounds good to me. Just make sure to keep the existing tgz and zip in case anyone is linking to them.

@nicowilliams
Copy link
Contributor

Yeah, like homebrew!

@nicowilliams
Copy link
Contributor

What happened to the jq-1.5-branch branch?

@dtolnay
Copy link
Member

dtolnay commented Aug 18, 2015

I deleted it because we did not need to keep both the branch and the tag. You can recreate it from the tag if you need it.

@nicowilliams
Copy link
Contributor

Fixed with a5b5cbe.

@nicowilliams
Copy link
Contributor

Thanks @dtolnay!

@dolmen
Copy link

dolmen commented Nov 4, 2015

Now we can't make a clean build from a git checkout of the jq-1.5 tag: my builds are marked with version jq-1.5-dirty.
This is due to a5b5cbe that included the autom4te.cache directory.

cipriancraciun pushed a commit to cipriancraciun/jq that referenced this issue Mar 21, 2016
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