maplibre / martin

Blazing fast and lightweight PostGIS, MBtiles and PMtiles tile server, tile generation, and mbtiles tooling.
https://martin.maplibre.org
Apache License 2.0
2.33k stars 215 forks source link

[NixOS] mbtiles build error at query! macros #1482

Closed pka closed 6 days ago

pka commented 3 months ago

A NixOS package build fails with:

   Compiling mbtiles v0.9.1
error: set `DATABASE_URL` to use query macros online, or run `cargo sqlx prepare` to update the query cache
   --> /build/bbox-services-0.6.0-vendor.tar.gz/mbtiles/src/mbtiles.rs:135:21
    |
135 |         let query = query! {"SELECT tile_data from tiles where zoom_level = ? AND tile_column = ? AND tile_row = ?", z, x, y};
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `query` (in Nightly builds, run with -Z macro-backtrace for more info)

I can't reproduce it myself. Any ideas?

nyurik commented 3 months ago

hmm, need to look at it in depth. I am a bit overbooked at the moment (just got back from a vacation), will try to get to it soonish

CommanderStorm commented 6 days ago

In https://github.com/NixOS/nixpkgs/pull/335821#issuecomment-2310017703 it was stated that .sqlx is missing, which is needed for startup.

I don't think this is an issue with martin, but rather with how said package is build => lets track it in said PR instead