Repository navigation
Drop the printers crate; print via lp/lpstat CLI (no CUPS link) - #6
Merged
Merged
Conversation
…UPS link) The toolbar Print action depended on the `printers` crate, which links CUPS (`-lcups`) on Linux. That forced `libcups2-dev` at build time for the entire workspace — rsplot, rsdm, and adl2rsdm all link rsplot, so even the adl2rsdm converter's test suite failed to link without it. Replace the crate with a small command-line shell-out to `lp` / `lpstat` so a default build links no CUPS library: - New `print_cli` module: `system_printers()` (`lpstat -e`), `default_printer()` (`lpstat -d`), `spool_file()` (`lp -d <printer>`). When `lp`/`lpstat` are absent (e.g. Windows) it degrades to an empty list / no default, which the callers already treat as "no destination". - The print dialog's enumeration and the `print_graph` / `print_graph_to` / `print_to_printer` submit path route through it; the public `print_graph` / `print_graph_to` signatures are unchanged. - Drop `printers` from Cargo.toml and `libcups2-dev` from the CI apt list. - CHANGELOG [Unreleased]: Changed + Removed. Behavior change: printing now requires lp/lpstat on PATH (CUPS on Linux/macOS); platforms without them (e.g. Windows) lose the print path that the printers crate previously provided via winspool. Verified cups-free on a machine without libcups.so: `cargo clippy --workspace --all-targets -- -D warnings` clean; `cargo test --workspace --no-run` links every test binary with no -lcups; rsplot lib 1625, rsdm lib 339, and the adl2rsdm suite (lib 140, bin 3, compiles.rs 5, opens.rs 2) all pass.
physwkim
force-pushed
the
chore/drop-printers-cups
branch
from
July 19, 2026 11:25
6ba8e78 to
fced114
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop the
printerscrate — print vialp/lpstatCLI (no CUPS link)Why
The toolbar Print action depended on the
printerscrate, which links CUPS(
-lcups) on Linux. That madelibcups2-deva build-time requirement for thewhole workspace: rsplot, rsdm, and adl2rsdm all link rsplot, so even the
adl2rsdm converter's test suite (
cargo test -p adl2rsdm) failed to linkwithout it (
rust-lld: error: unable to find library -lcups).What
Replace the crate with a small CLI shell-out so a default build links no CUPS library:
print_climodule:system_printers()(lpstat -e),default_printer()(
lpstat -d),spool_file()(lp -d <printer>). Missinglp/lpstat(e.g. Windows) → empty list / no default, which callers already treat as
"no destination".
print_graph/print_graph_to/print_to_printersubmit path route through it. Publicprint_graph/print_graph_tosignatures unchanged.printersfromCargo.tomlandlibcups2-devfrom the CI apt list.[Unreleased].Behavior change
Printing now requires
lp/lpstaton PATH (CUPS on Linux/macOS). Platformswithout them (e.g. Windows) lose the print path the
printerscrate previouslyprovided via winspool. Public API signatures are unchanged. Recorded in the
CHANGELOG.
Verified (cups-free, on a machine without
libcups.so)cargo clippy --workspace --all-targets -- -D warnings— cleancargo test --workspace --no-run— every test binary links, no-lcupscompiles.rs5,opens.rs2) — all pass