git clone https://garage44.eu/jeroen/cartopolis.git.. /crates/viewer/Cargo.toml
# `carto-view` — a quick look at a vector tile's ground.
#
# Reads the same tiles the client reads and runs the same tessellation
# (`cartopolis_geo`), then draws it. Nothing new on the wire and no new format:
# what it shows is what the client would build from the same bytes.
#
# **Why not the client itself.** Looking at a change to the ground meant launching
# it — sign-in, tile streamer, the interface, and a capture waiting for all of it to go
# quiet, six minutes a viewpoint on a software renderer. This is seconds, and the
# same input gives the same picture.
#
# It does **not** depend on `cartopolis`: it would rebuild whenever the client
# changed — 121.8 MB of link, and the thing under active development — so the
# instrument would be as unstable as what it is meant to give a fixed reading of.
# And a fault in shared rendering code would appear identically in both, which is
# the one case a harness has to be able to tell apart.
#
# `bevy.workspace = true` takes the client's exact feature set, so the engine is
# compiled once for the workspace and this costs one more link rather than a
# second Bevy.
[package]
name = "cartopolis_viewer"
version.workspace = true
edition.workspace = true
license.workspace = true
[[bin]]
name = "carto-view"
path = "src/main.rs"
# No tests: what it draws is `cartopolis_geo`'s, and that is where the suite is.
# Left on, `cargo test --workspace` links a 57 MB harness to run zero of them.
test = false
[features]
# **Dynamic linking, for the edit-and-look loop.** Statically linking Bevy copies
# ~150 MB of object code into the executable on *every* rebuild, which is most of
# what a change to the mesh code costs here. With this the link resolves symbols
# against a shared library instead.
#
# Off by default and never for anything shipped — it needs the library beside the
# binary. `cargo run -p cartopolis_viewer --features fast-dev` is the loop; a plain
# build is what CI and everything else gets.
#
# Note it does fork the engine's feature set, so the first build with it compiles
# Bevy again and keeps a second set of artifacts. That is the price of the fast
# loop and it is paid once.
fast-dev = ["bevy/dynamic_linking"]
[dependencies]
anyhow.workspace = true
bevy.workspace = true
# Not used by a line of code here, and required anyway. The engine's tone-mapping
# lookup tables drag in a compressed texture format whose decompressor has no
# default backend, so *something* in the build has to name one or `bevy_image`
# refuses to compile. The client names it as a direct dependency and the harness
# has to make the identical choice — a different one would be a different feature
# set, and a different feature set is the whole engine compiled twice.
#
# Two dependencies now exist here purely to keep that resolution identical (the
# other is the Linux windowing backend below). That is the standing cost of an
# independent harness sharing one engine build, and it is cheaper than the
# alternative in both build time and confidence.
bevy_image.workspace = true
# One blocking request, for `--ahn`. The client's async stack is its own; a
# harness run asks the height service once and exits.
ureq.workspace = true
# For `--site`: the decks atlas published and the BGT cell files, as JSON.
serde_json.workspace = true
clap.workspace = true
# For `--texture`, which writes a road class's generated surface straight out as
# a PNG. Bevy reaches `image` internally (a screenshot converts through it) but
# re-exports nothing nameable, and the workspace already builds this exact
# version for `cartopolis_geo`, so this is one dependency edge and no new crate.
image.workspace = true
tracing.workspace = true
cartopolis_core = { path = "../core" }
cartopolis_geo = { path = "../geo" }
# Wayland windowing is Linux-only, and the client adds it on exactly this target
# predicate. **Matching it is not optional, for two separate reasons.** Without a
# backend winit does not merely lack a window — it refuses to compile at all
# ("the platform you're compiling for is not supported"), so a headless binary
# that never opens one still needs it. And a feature set that differs from the
# client's resolves bevy to a second artifact, which is the whole engine compiled
# twice; cargo unions features only across what is actually in the build, so
# `cargo build -p cartopolis_viewer` alone does not inherit the client's.
[target.'cfg(target_os = "linux")'.dependencies]
bevy = { workspace = true, features = ["wayland"] }
[lints]
workspace = true