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

Naming of the tarball release: https://github.com/paulusmack/ppp/archive/ppp-2.5.1.tar.gz #519

Open
rubyFeedback opened this issue Sep 18, 2024 · 14 comments
Assignees

Comments

@rubyFeedback
Copy link

Hey guys,

Using this URL:

https://github.com/paulusmack/ppp/archive/ppp-2.5.1.tar.gz

When I extract this on the commandline, I get this directory:

ppp-ppp-2.5.1

So the ppp appears twice.

I believe the more natural name would be to use the same name as by the URL,
in other words:

ppp-2.5.1

Most other projects also do this. I assume some script may be automatically
renaming things, because a human being will probably rarely prepend a
'ppp-'. It also simplifies downstream scripts if the simple rule "basename of
the remote URL is the directory name when distracted".

@Neustradamus
Copy link
Member

@paulusmack: Can you look?

@paulusmack
Copy link
Collaborator

I'm not impressed with github's release mechanisms. Besides this naming snafu, it also doesn't include things like the ./configure script which aren't checked in to git, but get generated by autogen.sh.

I recommend you get ppp-2.5.1.tar.gz from https://download.samba.org/pub/ppp/ and use that.

@jkroonza
Copy link
Contributor

Not to mention the .tar.gz at https://download.samba.org/pub/ppp/ppp-2.5.1.tar.gz is double-compressed:

jkroon@plastiekpoot ~ $ wget https://download.samba.org/pub/ppp/ppp-2.5.1.tar.gz
--2024-09-19 11:49:33--  https://download.samba.org/pub/ppp/ppp-2.5.1.tar.gz
Resolving download.samba.org... 2a01:4f8:192:486::2:3, 144.76.82.148
Connecting to download.samba.org|2a01:4f8:192:486::2:3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 994693 (971K) [application/gzip]
Saving to: ‘ppp-2.5.1.tar.gz’

ppp-2.5.1.tar.gz         100%[==================================>] 971.38K   173KB/s    in 5.6s    

2024-09-19 11:49:40 (173 KB/s) - ‘ppp-2.5.1.tar.gz’ saved [994693/994693]

jkroon@plastiekpoot ~ $ file ppp-2.5.1.tar.gz 
ppp-2.5.1.tar.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 995838
jkroon@plastiekpoot ~ $ gunzip < ppp-2.5.1.tar.gz | file -
/dev/stdin: gzip compressed data, from Unix
jkroon@plastiekpoot ~ $ gunzip < ppp-2.5.1.tar.gz | gunzip | file -
/dev/stdin: POSIX tar archive (GNU)

That said, I've never experienced the problems you describe above.

https://github.com/ppp-project/ppp/archive/refs/tags/ppp-2.5.1.tar.gz is not double-compressed, but it has the double path issue, so github does a ${package_name}-${tag}.tar.gz and files are in ${package_name}-${tag}. Since the tag includes ppp that causes the double path issue.

Then, I suspect we can also exclude things like /.github/ from the release (this can seemingly be done with .gitattributes).

https://softwareengineering.stackexchange.com/questions/366771/how-do-we-avoid-development-files-in-the-release

Does give a few pointers, but in short: Doesn't look like github release download, which really just downloads the git code as at a point, is going to work for ppp project, and come to think of it I find it more and more strange that I've not run into this crap elsewhere.

The only way to include ./configure (and any others) into the release archive for those generated downloads, is likely going to be to do one of:

  1. Commit them into the repository (I don't like this).
  2. Create the release, download the github one, extract, generate, archive, add as release artifact.

I don't like either option.

@paulusmack
Copy link
Collaborator

Not to mention the .tar.gz at https://download.samba.org/pub/ppp/ppp-2.5.1.tar.gz is double-compressed:

Whoops! Fixed now.

@paulusmack
Copy link
Collaborator

I could create a tag called '2.5.1' easily enough, and maybe redo the github release. That wouldn't fix the missing configure script, though.

@jkroonza
Copy link
Contributor

It would not no.

@paulusmack
Copy link
Collaborator

Unless anyone can see a way to get the github release to include the configure script, I don't think there is anything to do here (except maybe to remember to create a tag called '2.5.2' next time).

@jkroonza
Copy link
Contributor

@paulusmack

For what it's worth, I concur.

I'm not aware of a way to include that into the archive created by github. As such, I suggest:

tag as '2.5.2' rather than 2.5.1

Perform required to create the "not in git files" and remove "git only files", and create archive from that.

Attach to the release as release artifact.

Might be a good thing to script most of that perhaps, so that after the tag has been created you can simply do scripts/create_release_archive (or similar) which will then download the tag archive (which should exclude files tagged with export-ignore by way of .gitattributes), extract, create configure files (run autogen.sh) ... and then recompress that, ready to be attached to the release.

I'm happy to take a shot at such a script for you if you so desire. Done similar things before, just never integration into the gh cli tools to actually make and upload the releases, but happy to mess with that. Would potentially enable you just running ./make_release 2.5.2 which would do everything required for you (including creating the tags and releases potentially). Capacity is better at the moment, but still not abundant.

@paulusmack
Copy link
Collaborator

I'm happy to take a shot at such a script for you if you so desire. Done similar things before, just never integration into the gh cli tools to actually make and upload the releases, but happy to mess with that. Would potentially enable you just running ./make_release 2.5.2 which would do everything required for you (including creating the tags and releases potentially). Capacity is better at the moment, but still not abundant.

I would be interested to see that.

jkroonza added a commit to jkroonza/ppp that referenced this issue Dec 18, 2024
This relates to ppp-project#519 and addresses the portion where "we can also
exclude things like /.github/ from the release".

Signed-off-by: Jaco Kroon <[email protected]>
@jkroonza
Copy link
Contributor

@paulusmack please check if this will work for you:

https://github.com/jkroonza/release-script

@Neustradamus
Copy link
Member

@jkroonza
Copy link
Contributor

@Neustradamus do you mean we need to rename the existing tags?

Note that my script does a little bit more than just tagging.

The running of ./autogen.sh hasn't been tested either, but I cannot see that it shouldn't work.

In short: it creates a tag, exports that tag (using git-archive), extracts, does the running of scripts (eg, autogen.sh but other mechanisms can be added too), and then re-compresses to the various release artifact options, before proceeding to create the release on github and uploading the artifacts.

If there is no autogen.sh to be run this is extremely round-about and pointless and one could purely rely on the github release process. I suspect this may well be why many projects do commit ./configure into the repository (I disagree with this approach).

For a second there I wondered about excluding the various .ac and .m4 files then I realised many distributions (Gentoo included) can and does apply patches and then re-bootstraps, so we should keep those).

paulusmack pushed a commit that referenced this issue Dec 30, 2024
This relates to #519 and addresses the portion where "we can also
exclude things like /.github/ from the release".

Signed-off-by: Jaco Kroon <[email protected]>
@paulusmack
Copy link
Collaborator

It appears that both make dist-gzip and github are clever enough to strip off the 'v' from a tag name such as "v2.5.2". So I think that's the best name to use, not "2.5.2" or "ppp-2.5.2".

@jkroonza your create-release script looks pretty good, my main nit is that I want to create a signed tag (git tag -u 2C63719F v2.5.2). I hacked that in myself, and then compared the tarballs made with make dist-gzip, with create-release, and github (downloaded using the 'tar.gz' button associated with the v2.5.2 tag). Here are the differences:

  • the tarball made with make dist-gzip doesn't include the following files: Changes-2.4, LICENSE.BSD, LICENSE.GPL-2, SECURITY.md, autogen.sh, pppd/srp-entry.8, sample, scripts/lcp_rtt_dump, scripts/lcd_rtt_explorer. (I have now fixed this by editing the various Makefile.am files.)
  • the tarball made with create-release includes a bunch of extra files and directories, presumably the result of running the ./configure script, such as: Makefile, autom4te.cache, chat/.deps, chat/Makefile, config.log, config.status, include/Makefile, libtool, pppd/.deps, pppd/Makefile, pppd/config.h, pppd/stamp-h1, pppd/stamp-h2, etc. I don't think I want them in the tarball.
  • the tarball made with make dist-gzip does include the following files: INSTALL, compile, config.guess, config.sub, depcomp, install-sh, ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4, missing, test-driver.
  • the tarball from github seems to be just exactly what's in the git repo.

For this release I went with make dist-gzip. It's out now.

@jkroonza
Copy link
Contributor

@paulusmack PRs welcome to add a mechanism to sign the tag.

You can exclude additional files by adding patterns to .gitattributes, eg Changes-* export-ignore, but looks like you added then to be included rather on the Makefile side.

Yes, those files look that you mention (Makefile etc) are the result of ./configure, they should not be in the tarball I don't think. Perhaps rather than running ./autogen I should simply look for configure.ac and perform:

autoreconf --install && autoreconf

rather than executing any found autogen.sh script?

The tarbal from github should be exactly what's in git, minus he export-ignore files in .gitattributes, + generated files by ./autogen.sh

INSTALL on my system after autgen.sh is a symbolic link to /usr/share/automake-1.16/INSTALL, so too for the other files listed in that bullet, creating a dummy release of those I only have the INSTALL ad m4/* in the archive as symlinks:

jkroon@plastiekpoot ~/projects/ppp/ppp-dummy-release (master) $ find . -type l
./INSTALL
./m4/ltversion.m4
./m4/ltoptions.m4
./m4/ltsugar.m4
./m4/lt~obsolete.m4
./m4/libtool.m4

There are two fixes here:

in autogen.sh drop the --symlink option on line 17.

in release-script, add -h to tar. Or above.

Your thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants