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

advpng installed on ubuntu, or OS X via homebrew, _does not_ have a proper version number #165

Closed
jayroh opened this issue Oct 12, 2018 · 14 comments

Comments

@jayroh
Copy link

jayroh commented Oct 12, 2018

On a recent install of ubuntu, installing advancecomp provides the advpng binary. However, when running advpng -V it returns unexpected output:

advpng -V
advancecomp vnone by Andrea Mazzoleni, http://www.advancemame.it

This causes the bin resolver to bail, when there's no proper version number

when :advpng, :gifsicle, :jpegoptim, :optipng
  capture("#{escaped_path} --version 2> #{Path::NULL}")[/\d+(\.\d+)+/]

Happy to provide a PR to handle this if it's helpful. Thanks!

@kaspergrubbe
Copy link
Contributor

kaspergrubbe commented Oct 12, 2018

Might be a good idea to make Andrea Mazzoleni and the advpng team (If any such organisation exist) know about this. They might not be aware that other developers depend on it.

@jayroh
Copy link
Author

jayroh commented Oct 12, 2018

That's a good idea. I'll see if I can find a good channel to report it over to him.

@jayroh
Copy link
Author

jayroh commented Oct 12, 2018

For what it's worth - this also happens with the version installed from homebrew

@kaspergrubbe
Copy link
Contributor

kaspergrubbe commented Oct 12, 2018

Yes, I can also verify your finding from the Homebrew version.

$ advpng
advancecomp vnone by Andrea Mazzoleni, http://www.advancemame.it
Usage: advpng [options] [FILES...]

Modes:
  -l, --list            List the content of the files
  -z, --recompress      Recompress the specified files
Options:
  -0, --shrink-store    Don't compress
  -1, --shrink-fast     Compress fast (zlib)
  -2, --shrink-normal   Compress normal (libdeflate)
  -3, --shrink-extra    Compress extra (7z)
  -4, --shrink-insane   Compress extreme (zopfli)
  -i N, --iter=N        Compress iterations
  -f, --force           Force the new file also if it's bigger
  -q, --quiet           Don't print on the console
  -h, --help            Help of the program
  -V, --version         Version of the program

But neither -V or --version reports the version:

$ advpng --version
advancecomp vnone by Andrea Mazzoleni, http://www.advancemame.it

$ advpng -V
advancecomp vnone by Andrea Mazzoleni, http://www.advancemame.it

The homebrew package version I have is version 2.1:

$ brew list --versions | grep advancecomp
advancecomp 2.1

@jayroh jayroh changed the title advpng installed on ubuntu has no proper version number advpng installed on ubuntu, or OS X via homebrew, _does not_ have a proper version number Oct 12, 2018
@toy
Copy link
Owner

toy commented Oct 12, 2018

After checking source: autover.sh is responsible for getting version for ./configure to put into a generated header, .version file is not there, so it relies on git tags. I presume something like absence of git binary is breaking the process of building ubuntu and homebrew packages and the version defaults to none.
It will be great if you can contact responsible teams or people about the issue. And I think they can understand if something can be improved in the configuration process of advancecomp.

I'll try to come up with some solution, although PR is always welcome.

@toy
Copy link
Owner

toy commented Oct 12, 2018

@kaspergrubbe
Copy link
Contributor

I was looking into changing the Homebrew package, which is defined here: https://github.com/Homebrew/homebrew-core/blob/master/Formula/advancecomp.rb

However, when reading the autover.sh script, the script will first look for a git-tag, if that fails it will look for a .version-file, if that fails, it will set the version to none.

The brew package fetches the source directly from the advancecomp project here:

url "https://github.com/amadvance/advancecomp/archive/v2.1.tar.gz"

I have downloaded the code myself, and I don't see any filed named .version, so maybe the maintainers simply forgot to release the code with the file, which is why we are seeing this behaviour.

@jayroh Did you reach out to @amadvance, or should I fire an e-mail in his direction?

@toy
Copy link
Owner

toy commented Oct 12, 2018

Wrong archive is fetched, it should be https://github.com/amadvance/advancecomp/releases/download/v2.1/advancecomp-2.1.tar.gz. The one that is used is archive of git repository which doesn't contain .version file, and the one I've linked is a release archive which I think is created from repository after running all auto* tools and running the script that generates .version file.

@jayroh
Copy link
Author

jayroh commented Oct 13, 2018

https://github.com/toy/image_optim/compare/versionless-advpng should fix the problem

This is a much better diff than the one I put together! Will this make its way into master?

@kaspergrubbe
Copy link
Contributor

@toy Nicely spotted, I will update the Homebrew package.

@jayroh
Copy link
Author

jayroh commented Oct 13, 2018

@kaspergrubbe I have not had a chance to email @amadvance - but maybe he'll see this issue and chime in. I'll post something over on sourceforge.

Looking through everything found here I think this is as much a problem with the "package" maintainers as it is with the build process itself. If done right, it's fine, but there's a lot of wiggle room in there to get it wrong.

@jayroh
Copy link
Author

jayroh commented Oct 13, 2018

Bug filed at the Ubuntu package bug tracker here: https://bugs.launchpad.net/ubuntu/+source/advancecomp/+bug/1797662

@toy
Copy link
Owner

toy commented Oct 13, 2018

Thank you both for handling changes in homebrew and ubuntu!
I'm going to merge the change and release new version.

@toy toy closed this as completed in ac98103 Oct 13, 2018
@jayroh
Copy link
Author

jayroh commented Oct 14, 2018

Excellent! Thank you so much @toy :)

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

No branches or pull requests

3 participants