mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
With the lockfile consistent again the build finally reaches this crate, and it
cannot be parsed:
error: failed to parse manifest at /code/rust/insightsql/parser/Cargo.toml
Caused by: error inheriting `serde_json` from workspace root manifest's
`workspace.dependencies.serde_json`
Caused by: failed to find a workspace root
The Dockerfile copies ONLY rust/insightsql/parser into the python stage — uv
resolves insightsql-parser-rs to that directory and maturin builds it there — so
rust/Cargo.toml is not in the image. A manifest that inherits across that
boundary can never parse.
Copying the root manifest instead does not fix it: it declares 20+ members, and
cargo would fail on every directory the image does not carry. Copying all of
rust/ into a python stage to build one wheel is worse.
So the crate stops reaching for a root it will not find. An empty `[workspace]`
makes it its own root, and the two inherited values are stated: serde_json 1.0,
matching rust/Cargo.toml's workspace.dependencies exactly, and the lint set
copied verbatim from workspace.lints rather than approximated — the first draft
of this commit invented a lint instead of reading the real ones, which would
have quietly changed what the crate refuses to compile.
Keep both in step with rust/Cargo.toml when it moves.
74 lines
3.3 KiB
TOML
74 lines
3.3 KiB
TOML
[package]
|
|
name = "insightsql_parser_rs"
|
|
# Versioned independently from the cpp parser in `common/insightsql_parser/setup.py`. Both started from the same InsightsQL grammar revision, but the Rust port is bumped on its own whenever the hand-rolled parser changes; each ships as its own PyPI wheel.
|
|
version = "1.3.107"
|
|
edition = "2021"
|
|
publish = false
|
|
|
|
[lib]
|
|
name = "insightsql_parser_rs"
|
|
# `cdylib` for the Python wheel that maturin builds; `rlib` so other Rust
|
|
# crates in the workspace can depend on the parser as a library if useful
|
|
# later. `cdylib` alone would break that.
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
# This crate has to resolve on its own, because it is built on its own.
|
|
#
|
|
# Dockerfile copies ONLY `rust/insightsql/parser` into the python stage — uv
|
|
# resolves insightsql-parser-rs to that directory and maturin builds it there —
|
|
# so `rust/Cargo.toml` is not in the image. Inheriting from the workspace across
|
|
# that boundary cannot work, and it failed exactly that way:
|
|
#
|
|
# error: failed to parse manifest at /code/rust/insightsql/parser/Cargo.toml
|
|
# Caused by: error inheriting `serde_json` from workspace root manifest's
|
|
# `workspace.dependencies.serde_json`
|
|
# Caused by: failed to find a workspace root
|
|
#
|
|
# Copying the root manifest instead would not fix it — it declares 20+ members
|
|
# and cargo would then fail on every directory the image does not carry. Copying
|
|
# all of `rust/` into a python stage to build one wheel is worse still.
|
|
#
|
|
# `[workspace]` empty makes this its own workspace root, so cargo stops
|
|
# searching upward rather than finding one it cannot read. The two inherited
|
|
# values are then stated here: serde_json matches the root's
|
|
# `workspace.dependencies` exactly (1.0), and lints are declared rather than
|
|
# inherited. Keep them in step with rust/Cargo.toml when that moves.
|
|
[workspace]
|
|
|
|
[lints.rust]
|
|
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] }
|
|
unstable_features = "forbid"
|
|
macro_use_extern_crate = "forbid"
|
|
let_underscore_drop = "deny"
|
|
non_ascii_idents = "deny"
|
|
trivial_casts = "deny"
|
|
trivial_numeric_casts = "deny"
|
|
unit_bindings = "deny"
|
|
|
|
[lints.clippy]
|
|
enum_glob_use = "deny"
|
|
|
|
[dependencies]
|
|
serde_json = { version = "1.0" }
|
|
# `abi3-py312` lets one wheel work on every Python 3.12+ via the stable
|
|
# CPython ABI — avoids shipping a separate wheel per minor Python.
|
|
# 0.28: cargo allows one pyo3 version per workspace (pyo3 has `links = "python"`),
|
|
# and rust/deltalite/python's pyarrow ingest (arrow 58 `pyarrow` feature) requires
|
|
# 0.28 — keep the two in lockstep or the workspace stops resolving.
|
|
pyo3 = { version = "0.28", features = ["extension-module", "abi3-py312"] }
|
|
|
|
[features]
|
|
default = []
|
|
# Compile the SanitizerCoverage `__sanitizer_cov_trace_pc_*` callbacks in
|
|
# `src/cov.rs` and expose `cov_snapshot()` / `cov_reset()` to Python. The
|
|
# actual edge-coverage instrumentation pass is requested via RUSTFLAGS in
|
|
# the same build:
|
|
# RUSTFLAGS="-C passes=sancov-module \
|
|
# -C llvm-args=-sanitizer-coverage-level=3 \
|
|
# -C llvm-args=-sanitizer-coverage-trace-pc-guard" \
|
|
# maturin develop --release --features coverage
|
|
# Production wheels never set this; the resulting wheel is the parser-parity
|
|
# grind's coverage-instrumented variant. See the "Coverage-instrumented build"
|
|
# section of `rust/insightsql/parser/README.md`.
|
|
coverage = []
|