pngquant icon indicating copy to clipboard operation
pngquant copied to clipboard

Windows binaries version mismatch

Open atnbueno opened this issue 6 years ago • 10 comments

In the website it says "Binary for Windows (v2.12.0)" but the downloaded file reports an older version: "pngquant, 2.11.7 (January 2018), by Kornel Lesinski, Greg Roelofs."

atnbueno avatar Oct 28 '18 09:10 atnbueno

same to me in website says v2.12.2 but it report version 2.12.0

scr

phonphen avatar Oct 29 '18 02:10 phonphen

2.12.0 vs 2.12.2 is close enough :) The changes in .1 and .2 were for the build system, so there are no new features, and the changes don't make any difference to the executable once its built.

kornelski avatar Oct 29 '18 02:10 kornelski

Thanks for the update to 2.12.0, but I have a script to check if there are new versions of programs like yours (single .exe, no installer) and I don't see where to get the version of the most recent release for Windows other than the text "Binary for Windows (v2.12.2)" in https://pngquant.org/#download

Is there any other way I can get the real version of the Windows binary? (other than, of course, download the pngquant-windows.zip file, decompress and run the program to get it)

Right now I have it working because I've configured it to ignore the third number in the version, but that's a hack, not a solution.

P.S. Also tried with Sigcheck but no useful info there either.

atnbueno avatar Oct 29 '18 08:10 atnbueno

No, there's no way other than running pngquant -v

kornelski avatar Oct 29 '18 13:10 kornelski

I'm sorry I wasn't clear. I meant either the website or GitHub. Right now the website says "Binary for Windows (v2.12.2)" and the file linked says "pngquant, 2.12.0 (January 2018), by Kornel Lesinski, Greg Roelofs." so I had to make my script to use only "2.12" as the last version and it won't detect any "2.12.x" update.

The Sigcheck mention was in case there was an internal field (like "Product version") with the real version.

BTW, the Windows version says -v is a synonym for --verbose. [EDIT] Oh, I see, in Windows the option to get the version is -V (uppercase) or --version. [/EDIT]

atnbueno avatar Oct 29 '18 14:10 atnbueno

Merry Christmas to all!

@kornelski could you bring the msvc branch up to date with master? Also, I spend a little time to get this working and I successfully compiled a 64-bit MSVC 2019 static build:

C:\Users\xmr\Desktop\pngquant>rustc --version
rustc 1.40.0 (73528e339 2019-12-16)

C:\Users\xmr\Desktop>cargo version
cargo 1.40.0 (bc8e4c8be 2019-11-22)

C:\Users\xmr\Desktop\pngquant>cargo build --release --features=lcms2-static
   Compiling getrandom v0.1.13
   Compiling log v0.4.8
   Compiling cfg-if v0.1.10
   Compiling libc v0.2.66
   Compiling pkg-config v0.3.17
   Compiling vcpkg v0.2.8
   Compiling dunce v0.1.1
   Compiling dunce v1.0.0
   Compiling unicode-width v0.1.7
   Compiling rgb v0.8.14
   Compiling glob v0.3.0
   Compiling getopts v0.2.21
   Compiling wild v2.0.2
   Compiling jobserver v0.1.17
   Compiling num_cpus v1.11.1
   Compiling cc v1.0.48
   Compiling libz-sys v1.0.25
   Compiling libpng-sys v1.1.8
   Compiling lcms2-sys v2.4.8
   Compiling imagequant-sys v2.12.5 (C:\Users\xmr\Desktop\pngquant\lib)
   Compiling pngquant v2.12.2 (C:\Users\xmr\Desktop\pngquant)
warning: msvc-dist/ directory not present. MSVC builds may fail
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
warning: cl : Command line warning D9002 : ignoring unknown option '/arch:SSE2'
    Finished release [optimized] target(s) in 26.08s

.cargo/config:

[build]
rustflags = [
  "-C", "target-feature=+crt-static",
  "-C", "link-args=-RELEASE"
]

Now there are those warnings about /arch which technically are correct since SSE2 is redundant for x64. Not sure how to get rid of those but they are just warnings and shouldn't affect the binary.

I'm not super familiar with Rust, but it seems the binary works fine and should be faster (benchmarks welcome)

Would be nice if we could

  1. bring the msvc branch up to date with master (maybe just merge it?)
  2. incorporate the above config changes mostly the -RELEASE change because this adds a checksum (static linking is debatable I just prefer the binaries to not depend on anything including the MSVC runtime)

Happy to have some benchmarks from anyone following this thread and make these changes to the repo.

EDIT: BTW forgot to say we could probably automate the Windows builds with AppVeyor

XhmikosR avatar Dec 25 '19 11:12 XhmikosR

Can you point me to more info about the -RELEASE flag? Is it OK to always add it? I wonder if the cc crate should be adding it automatically.

kornelski avatar Dec 26 '19 22:12 kornelski

Automating Windows build with AppVeyor would be great.

kornelski avatar Dec 26 '19 22:12 kornelski

Can you point me to more info about the -RELEASE flag? Is it OK to always add it? I wonder if the cc crate should be adding it automatically.

Not always but for RELEASE builds it's fine. https://docs.microsoft.com/en-us/cpp/build/reference/release-set-the-checksum?view=vs-2019 Even though this is an executable, one can quickly see if the binary has been modified

XhmikosR avatar Dec 27 '19 07:12 XhmikosR

Automating Windows build with AppVeyor would be great.

I can try doing this in the next days, but first, you should cherry pick the one patch that the MSVC branch has and merge it to master so that we don't have a different branch for MSVC only.

XhmikosR avatar Dec 27 '19 08:12 XhmikosR