phly / keep-a-changelog

Tools for manipulating CHANGELOG.md files in Keep A Changelog format, including tagging and releasing.
https://phly.github.io/keep-a-changelog/
BSD 2-Clause "Simplified" License
182 stars 23 forks source link

The phar for 2.11.0 is broken #101

Open glensc opened 3 years ago

glensc commented 3 years ago

Bug Report

Q A
BC Break no
Version 2.11.0

Summary

Latest .phar is broken, tested with:

➔ php74  ~/Downloads/keep-a-changelog.phar --version
PHP Fatal error:  Uncaught Error: Class '_HumbugBoxe3316aeaf337\Composer\InstalledVersions' not found in phar:///Users/glen/Downloads/keep-a-changelog.phar/vendor/ocramius/package-versions/src/PackageVersions/Versions.php:32
glensc commented 3 years ago

2.10.1 seems ok:

➔ php74  ~/Downloads/keep-a-changelog\ \(1\).phar --version
keep-a-changelog 2.10.1
weierophinney commented 3 years ago

This appears to be due to updating to ocramius/package-versions v2, which proxies to the internal functionality provided by Composer for exposing package versions... which evidently doesn't play nicely with the way we build our phar.

@heiglandreas Have you seen similar on any other projects you work on?

heiglandreas commented 3 years ago

Not yet @weierophinney. Will dig into it on the weekend.

weierophinney commented 3 years ago

I've figured out a solution that bypasses it (basically, using the tag as provided to the workflow as the version, and slipstreaming that into the bin/keep-a-changelog script); this may actually be slightly better for PHAR purposes, but it also means maintaining both the original script and a .dist file, which always leads to mismatches. I'll keep my changes locally, and see if you can find another solution, @heiglandreas :)