We recently moved from subversion to git, and then to Github, for several open source projects. Github was nice in that it provided a lot of functionality. One of the things I particularly like is the ability to download tags as zip
or .tar.gz
files.
Unfortunately Github recently discontinued downloads. That shouldn't be a problem because of the ability to download tags. However in the past we have not put a Makefile
, configure
script or any other autoconf-generated files into the repo because they get lots of conflicts when people merge.
What's the proper way to handle this?
bootstrap.sh
file and people are told to run that?make dist
and put that into the repo?Thanks
No, you absolutely should not put Makefile.in in your git repo. Yes, you absolutely should include it with your distribution. As a corollary, you should not be using git as your distribution mechanism. (That's what tarballs and rpms are for.)
You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.
# A Makefile is a collection of rules. Each rule is a recipe to do a specific. # thing, sort of like a grunt task or an npm package. json script. #
Broadly speaking, you should not upload on github following: any content which does not legally belong to you, and which has no some open source license. content which could be generated (e.g. object files).
make dist
via GitHub ReleasesYour first option—putting the Autoconf- and Automake-generated files into the repository—is not a good idea. It's almost never beneficial to store generated files in source control. In this case, it's going to pollute your history with a lot of unnecessary and potentially conflicting commits, particularly if not all your contributors are using the same version of Autotools. Your third option—checking in the output of make dist
—is a bad idea for exactly the same reasons as the first option.
Your second option—adding a "bootstrap" script that calls Autoconf and Automake to generate the configure
scripts—is also a bad idea. This defeats the entire purpose of Autotools, which is to make your source portable across systems—including those for which Autotools is not available! (Consider what would happen if someone wanted to build and install your software on a machine on which they don't have root access, and where the GNU Build System is not installed. A bootstrap script is not going to help them because they'd first need to make a local installation of Autotools and possibly all its dependencies.)
The proper way of releasing code that uses Autotools is to produce a tarball with make dist
(or better yet, make distcheck
, since this will also run tests and do other sanity checks), and then publish this tarball somewhere other than the source repository.
Your original question, from April 2013, states that GitHub discontinued download pages. However, in July 2013, GitHub added a "Releases" feature that not only pre-packages your source tags, but also allows you to attach arbitrary files to each release. So on GitHub, the Releases page is where you should publish your make dist
tarballs (and preferably also the detached GnuPG signatures of them).
$ git tag 1.0 # Also use -s if desired
$ git push --tags
$ make dist # Alternatively, 'make distcheck'
If you don't want to use GitHub Releases, then as pointed out in a previous answer, you should upload the tarballs somewhere else, such as your own website or FTP site. Add a link to this repository from your project's README.md
so that users can find it.
The second is better: you want any user of your repo to be up and running as fast as possible, re-generating what he/she needs in order to build your program.
Since Git is very much a version control for text (as opposed to an artifact repo like Nexus), providing a way to generate the final binary is the way to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With