Skip to content

Conversation

sunng87
Copy link
Member

@sunng87 sunng87 commented Jul 2, 2025

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#6088

What's changed and what's your intention?

This PR is to make greptimedb buildable in nix flake environment.

It:

  • update sqlparser version to add greptime suffix
  • add buildRustPackages section in nix flake

@happysalada this is only a draft, feel free to fork and optimize it.

I'm currently blocked by a compile issue that only happens with nix build:

       > error: failed to run custom build command for `otel-arrow-rust v0.1.0 (https://github.com/open-telemetry/otel-arrow?rev=5d551412d2a12e689cde4d84c14ef29e36784e51#5d551412)`
       >
       > Caused by:
       >   process didn't exit successfully: `/build/source/target/release/build/otel-arrow-rust-b3314aee2ac07afd/build-script-build` (exit status: 101)
       >   --- stdout
       >   cargo:rerun-if-changed=experimental/arrow/v1/arrow_service.proto
       >   cargo:rerun-if-changed=/build/cargo-vendor-dir/otel-arrow-rust-0.1.0/../../proto/opentelemetry/proto/
       >
       >   --- stderr
       >
       >   thread 'main' panicked at /build/cargo-vendor-dir/otel-arrow-rust-0.1.0/build.rs:32:10:
       >   Failed to compile protos.: Custom { kind: Other, error: "protoc failed: Could not make proto path relative: experimental/arrow/v1/arrow_service.proto: No such file or directory\n" }
       >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@github-actions github-actions bot added size/S docs-not-required This change does not impact docs. labels Jul 2, 2025
@happysalada
Copy link

Hey thank you for this, let me try to have a look at this this weekend.

@sunng87
Copy link
Member Author

sunng87 commented Jul 7, 2025

The root case is nix's rust build system will overwrite the CARGO_MANIFEST_PATH to an absolute path /build/rust-cargo-vendor/..., but the otel-arrow-rust's build.rs failed to access it because this path doesn't exist at all I guess?

Even if I modified build.rs in otel-arrow-rust and replaced CARGO_MANIFEST_PATH to . it still doesn't build.

@happysalada
Copy link

In quickwit we had to adf patches for that exact failure. I was imagining it would be a similar fix

https://github.com/NixOS/nixpkgs/blob/master/pkgs%2Fby-name%2Fqu%2Fquickwit%2Fpackage.nix

@happysalada
Copy link

As soon as i get time in front of a computer i can check. Just had my second kid, so it might take me a bit, but ill get there.

@sunng87
Copy link
Member Author

sunng87 commented Jul 8, 2025

@happysalada congrats! take you time, this is not a hurry task.

sunng87 added 3 commits July 9, 2025 19:03
Flake lock file updates:

• Updated input 'fenix':
    'github:nix-community/fenix/c39a78eba6ed2a022cc3218db90d485077101496?narHash=sha256-L0jzm815XBFfF2wCFmR%2BM1CF%2BbeIEFj6SxlqVKF59Ec%3D' (2025-04-27)
  → 'github:nix-community/fenix/61b4f1e21bd631da91981f1ed74c959d6993f554?narHash=sha256-dJj8TUoZGj55Ttro37vvFGF2L%2BxlYNfspQ9u4BfqTFw%3D' (2025-07-01)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/d8887c0758bbd2d5f752d5bd405d4491e90e7ed6?narHash=sha256-fxvRYH/tS7hGQeg9zCVh5RBcSWT%2BJGJet7RA8Ss%2BrC0%3D' (2025-04-26)
  → 'github:rust-lang/rust-analyzer/eaf37e2c98b66ff7f7a0ac04e4cada39e51fde4b?narHash=sha256-oaGMVdCcI32y6jQ7RE0%2BCqshZngfI19XnY31eYjdinI%3D' (2025-06-30)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/7c43f080a7f28b2774f3b3f43234ca11661bf334?narHash=sha256-rqc2RKYTxP3tbjA%2BPB3VMRQNnjesrT0pEofXQTrMsS8%3D' (2025-05-25)
  → 'github:NixOS/nixpkgs/b43c397f6c213918d6cfe6e3550abfe79b5d1c51?narHash=sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y%3D' (2025-06-29)
@sunng87 sunng87 force-pushed the chore/flake-build branch from f6f7621 to a3df4d1 Compare July 10, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs. size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants