Skip to content

fix: allow plotly_static to compile without driver features#402

Open
RedZapdos123 wants to merge 3 commits into
plotly:mainfrom
RedZapdos123:fix/plotly-static-default-compilation
Open

fix: allow plotly_static to compile without driver features#402
RedZapdos123 wants to merge 3 commits into
plotly:mainfrom
RedZapdos123:fix/plotly-static-default-compilation

Conversation

@RedZapdos123
Copy link
Copy Markdown
Contributor

@RedZapdos123 RedZapdos123 commented Jun 1, 2026

Description:

Issue #400 reported that fresh workspace builds fail because plotly_static requires either chromedriver or geckodriver at compile time, even when static export is not being used.

This PR changes plotly_static so that it compiles cleanly without a selected driver feature. That fixes bare workspace builds and no-feature plotly test builds from a fresh clone.

The explicit driver requirement for actual static export is still preserved:

  • chromedriver and geckodriver remain mutually exclusive
  • attempting static export without a selected driver backend now returns a clear runtime error instead of failing the whole workspace build

This PR also suppresses no-driver build-script unused warnings, since allowing featureless plotly_static builds makes much of the driver setup code intentionally unused in that configuration.

Closes #400.

Checklist:

  • I have reviewed all changes in this PR myself.
  • I have reproduced the fresh workspace build failure on current main in WSL.
  • I have run cargo check --workspace in WSL.
  • I have run cargo test -p plotly --no-run in WSL.
  • I have run cargo clippy -p plotly_static --no-default-features -- -D warnings -A deprecated in WSL.
  • I have run cargo clippy -p plotly_static --features chromedriver,webdriver_download -- -D warnings -A deprecated in WSL.
  • I have run BROWSER_PATH=$HOME/.local/share/plotly-ci/firefox/firefox/firefox cargo clippy -p plotly_static --features geckodriver,webdriver_download -- -D warnings -A deprecated in WSL.
  • I have run a real Firefox-backed export test in WSL using cargo test -p plotly plot::tests::save_to_png --features plotly_ndarray,plotly_image,static_export_geckodriver,static_export_wd_download,debug -- --nocapture.
  • I have run the full plotly package tests in WSL using cargo test -p plotly --features plotly_ndarray,plotly_image,static_export_chromedriver,debug.

After the fix:

Screenshot 2026-06-02 140657

@RedZapdos123 RedZapdos123 force-pushed the fix/plotly-static-default-compilation branch from 9f6a051 to 95481dc Compare June 1, 2026 20:35
@RedZapdos123 RedZapdos123 changed the title fix: add default feature to plotly_static to fix workspace compilation fix: bypass compile-time driver enforcement in plotly_static Jun 1, 2026
@RedZapdos123 RedZapdos123 marked this pull request as draft June 1, 2026 20:39
When checking out the repository fresh and running `cargo check` at the workspace root, compilation fails because `plotly_static` has no driver features enabled by default.

This commit resolves the compilation error by:
1. Adding `default = ["chromedriver"]` to `plotly_static/Cargo.toml` features.
2. Making Chrome configurations conditional on `not(feature = "geckodriver")` to allow Firefox (`geckodriver`) to take priority when both features are active simultaneously (e.g. in CI pipelines).
3. Replacing the mutual exclusion compile error in `build.rs` with a compiler warning.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123 RedZapdos123 force-pushed the fix/plotly-static-default-compilation branch from 95481dc to 6011077 Compare June 1, 2026 20:50
Allow plotly_static to compile without driver features so fresh workspace builds and no-feature plotly test builds no longer fail.

Keep chromedriver/geckodriver mutually exclusive for actual export use, return a runtime error when export is attempted without a driver feature, and suppress the no-feature build-script unused warnings that trigger a rustc ICE on stable.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123 RedZapdos123 changed the title fix: bypass compile-time driver enforcement in plotly_static fix: allow plotly_static to compile without driver features Jun 2, 2026
Normalize plotly_static/Cargo.toml line endings to LF so the PR diff reflects the actual feature change instead of whole-file EOL churn.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@RedZapdos123 RedZapdos123 marked this pull request as ready for review June 2, 2026 08:39
@RedZapdos123 RedZapdos123 force-pushed the fix/plotly-static-default-compilation branch from d85b1b8 to 7c1781b Compare June 2, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh workspace builds fail because plotly_static requires a driver feature

2 participants