Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bbox-services: init at 0.6.0 #335821

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

imincik
Copy link
Contributor

@imincik imincik commented Aug 19, 2024

Description of changes

Add bbox services package.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@imincik
Copy link
Contributor Author

imincik commented Aug 19, 2024

Build is currently failing on

   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)

@pka
Copy link

pka commented Aug 19, 2024

I don't see why the build of the mbtiles package is failing. Which build command is executed? There are mutliple binaries in the bbox package. If you build in the bbox-server subdirectory, all standard services are included.

@imincik
Copy link
Contributor Author

imincik commented Aug 20, 2024

Which build command is executed?

cargo build -j 32 --target x86_64-unknown-linux-gnu --offline --profile release

is used .

@pka
Copy link

pka commented Aug 20, 2024

The build is successful on my machine and also on Github CI and in a Docker env. I'll open an issue in the mbtiles repo, maybe they have an idea.

@sikmir
Copy link
Member

sikmir commented Aug 25, 2024

Just in case, here is my attempt to package https://github.com/sikmir/nur-packages/blob/master/pkgs/geospatial/bbox/default.nix

@imincik
Copy link
Contributor Author

imincik commented Aug 26, 2024

@sikmir , thanks.

I tried to pick some ideas from your package (setting PROTOC var or setting cargoBuildFlags), but none of them helped. The error message is the same.

@pka
Copy link

pka commented Aug 26, 2024

Can you try setting SQLX_OFFLINE=true according to https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md#force-building-in-offline-mode ? (Current bbox version is 0.6.1, btw)

@pka
Copy link

pka commented Aug 26, 2024

Another thought. Maybe the .sqlx directory required for offline build got lost?

@imincik
Copy link
Contributor Author

imincik commented Aug 26, 2024

(Current bbox version is 0.6.1, btw)

Updated to 0.6.1. Thanks.

@imincik
Copy link
Contributor Author

imincik commented Aug 26, 2024

Can you try setting SQLX_OFFLINE=true according to https://github.com/launchbadge/sqlx/blob/main/sqlx-
cli/README.md#force-building-in-offline-mode ?

Setting this variable resulted in little change of error message:

error: `SQLX_OFFLINE=true` but there is no cached data for this query, run `cargo sqlx prepare` to update the query cache or unset `SQLX_OFFLINE`
   --> /build/bbox-services-0.6.1-vendor.tar.gz/mbtiles/src/mbtiles.rs:135:21

.

@pka
Copy link

pka commented Aug 26, 2024

Looks like the source directory /build/bbox-services-0.6.1-vendor.tar.gz/mbtiles/.sqlx/ is missing. Does the nixpkg toolchain somehow remove dot-files/directories from the tar.gz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants