jpcima / ysfx

Hosting library for JSFX
Apache License 2.0
161 stars 26 forks source link

CMake build fails with: `Checksum invalid: asm-nseel-x64-sse.asm` #17

Closed GavinRay97 closed 2 years ago

GavinRay97 commented 2 years ago

I suppose maybe I am supposed to regenerate the SHA or something? Unsure why this would happen on first build, as I haven't touched anything though.

Compiled with MinGW GCC 11 on Windows 11

====================[ Build | eel2 | RelWithDebInfo-MinGW ]=====================
CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe --build Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw --target eel2
[0/2] CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -P Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw\CMakeFiles\VerifyGlobs.cmake
[1/12] cmd.exe /C "cd /D Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -DSOURCE_FILE=Projects/tmp/ysfx/thirdparty/WDL/source/WDL/eel2/asm-nseel-x64-sse.asm -DCHECKSUM_FILE=Projects/tmp/ysfx/sources/eel2-gas/sources/ref-hash-sha512.txt -P Projects/tmp/ysfx/cmake/ValidateSHA512.cmake && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -E touch Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt"
FAILED: eel2-gas-validate-stamp.txt Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt 
cmd.exe /C "cd /D Projects\tmp\ysfx\cmake-build-relwithdebinfo-mingw && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -DSOURCE_FILE=Projects/tmp/ysfx/thirdparty/WDL/source/WDL/eel2/asm-nseel-x64-sse.asm -DCHECKSUM_FILE=Projects/tmp/ysfx/sources/eel2-gas/sources/ref-hash-sha512.txt -P Projects/tmp/ysfx/cmake/ValidateSHA512.cmake && CLion\ch-0\213.5744.123\bin\cmake\win\bin\cmake.exe -E touch Projects/tmp/ysfx/cmake-build-relwithdebinfo-mingw/eel2-gas-validate-stamp.txt"
CMake Error at Projects/tmp/ysfx/cmake/ValidateSHA512.cmake:31 (message):
  Checksum invalid: asm-nseel-x64-sse.asm
  ('aa5896ad4860cba62ec3450b55221f4985db4f79d83fc14dadd2f2aceae87cdfd8645f35160bf47bb7700046e3ecdd892aa74639130b910598ddb70515787ed8'
  !=
  'd4a4d8bf4d906f6a6cdbe54bc8a2699e01a11e1109a716c696fc3df96046422a71aea29ff643db4b23cf2b29a3ccd8dbb309a14bab327f13d7f2be461463bc02')

ninja: build stopped: subcommand failed.
jpcima commented 2 years ago

This is a cmake bug.. it doesn't compute the checksum right in some windows environments. I'd guess it's because it reads the files in text mode instead of binary. I've not checked yet if cmake has this problem reported upstream.

For now, pass cmake the option -DYSFX_SKIP_CHECKSUM=ON

GavinRay97 commented 2 years ago

That's what I get for using Windows. Terrible OS, should just re-clone the project to WSL2.

Thanks for the swift reply! 🙏

jpcima commented 2 years ago

Issue made at cmake bug tracker https://gitlab.kitware.com/cmake/cmake/-/issues/22936

jpcima commented 2 years ago

It turns out the problem is Git's line ending conversions. Problem solved