philss / rustler_precompiled

Use precompiled NIFs from trusted sources in your Elixir code
181 stars 25 forks source link

Case sensitivity of checksums file #69

Closed tomtaylor closed 1 month ago

tomtaylor commented 5 months ago

I just spent a couple of hours banging my head against the wall about why the checksums for my library (h3geo) weren't being picked up when I deploy an application in CI. I'm on MacOS with a case insensitive file system and the CI server is on Linux with a case sensitive file system.

It turns out I was using mix rustler_precompiled.download h3geo --all, not mix rustler_precompiled.download H3Geo --all (spot the difference in case). This in turn produced checksum-Elixir.h3geo.exs, not checksum-Elixir.H3Geo.exs.

I published the file with the incorrect casing. The CI server then couldn't find the checksums file and errored out.

Running this again with mix rustler_precompiled.download H3Geo --all didn't replace the file with the correct case - the original casing was preserved until I deleted the checksum file entirely.

Now I've spotted this, it works correctly, but it'd be great if this could be made foolproof in the future!

philss commented 5 months ago

@tomtaylor interesting! I will investigate If this can be avoided. Probably if we check for the presence of the module, it should tell it is invalid if the name doesn't match.