Neargye / magic_enum

Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
MIT License
4.99k stars 445 forks source link

Releasing the same Version multiple times changes Hash, breaks VCPKG #373

Closed anders-wind closed 3 months ago

anders-wind commented 3 months ago

We are seeing the following error in our build system:

 Building magic-enum:sanitize-x64-linux@0.9.6...
/home/runner/work/etpa/etpa/triplets/sanitize-x64-linux.cmake: info: loaded overlay triplet from here
/home/runner/work/etpa/etpa/vcpkg/buildtrees/versioning_/versions/magic-enum/fe937a79aa8b2eb99d8877aa47ffcf8ad796eef5: info: installing overlay port from here
-- Downloading https://github.com/Neargye/magic_enum/archive/v0.9.6.tar.gz -> Neargye-magic_enum-v0.9.6.tar.gz...
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from /home/runner/work/etpa/etpa/vcpkg/vcpkg-bundle.json
[DEBUG] Failed to open: /home/runner/work/etpa/etpa/vcpkg/vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Detected CI environment: GitHub_Actions
[DEBUG] 1000: execute_process(curl --fail -L https://github.com/Neargye/magic_enum/archive/v0.9.6.tar.gz --create-dirs --output /home/runner/work/etpa/etpa/vcpkg/downloads/Neargye-magic_enum-v0.9.6.tar.gz.3213.part)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after   487587 us
[DEBUG] Trying to hash /home/runner/work/etpa/etpa/vcpkg/downloads/Neargye-magic_enum-v0.9.6.tar.gz.3213.part
[DEBUG] /home/runner/work/etpa/etpa/vcpkg/downloads/Neargye-magic_enum-v0.9.6.tar.gz.3213.part has hash fa3792e9c69c57e437d6325b7659cf25e6cbdda3326ffeaf0411d9838822095b15306f322ad2ebd5ec68b905ef2aed08880d2507e7d8a8559ab3c5be6c8ce99c
error: Missing Neargye-magic_enum-v0.9.6.tar.gz and downloads are blocked by x-block-origin.
error: File does not have the expected hash:
url: https://github.com/Neargye/magic_enum/archive/v0.9.6.tar.gz
File: /home/runner/work/etpa/etpa/vcpkg/downloads/Neargye-magic_enum-v0.9.6.tar.gz.3213.part
Expected hash: 6154c816446e115f3b164df79ab8d8088eb76b632ee3fdc82ea17cc7ae8d04652c83e5cc587c2c4b334889904b101ba08a04c5837103af260768e93df17cc263
Actual hash: fa3792e9c69c57e437d6325b7659cf25e6cbdda3326ffeaf0411d9838822095b15306f322ad2ebd5ec68b905ef2aed08880d2507e7d8a8559ab3c5be6c8ce99c

As far as I can see 0.9.6 was released a few weeks ago here: https://github.com/Neargye/magic_enum/actions/runs/9724762931 But just now a new 0.9.6 was released: https://github.com/Neargye/magic_enum/actions/runs/10366898949

This changes the hash of the release. A lot of package managers (vcpkg included) uses hash to check that packages have not been maliciously modified.

anders-wind commented 3 months ago

I guess my wish is that releases do not get re-released in the future 👍

anders-wind commented 3 months ago

See https://github.com/microsoft/vcpkg/issues/40429 for vcpkg issue hopefully tracking the solution of this

FangCunWuChang commented 3 months ago

I hit this

anders-wind commented 3 months ago

https://github.com/microsoft/vcpkg/pull/40430 for a vcpkg fix

Neargye commented 3 months ago

@anders-wind I apologize for this problem, in the future I will be much more careful.

Neargye commented 3 months ago

@anders-wind and thanks for fix!

anders-wind commented 3 months ago

@anders-wind and thanks for fix!

No problem! Thanks for the reply 👍