fix: allow plotly_static to compile without driver features#402
Open
RedZapdos123 wants to merge 3 commits into
Open
fix: allow plotly_static to compile without driver features#402RedZapdos123 wants to merge 3 commits into
RedZapdos123 wants to merge 3 commits into
Conversation
9f6a051 to
95481dc
Compare
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>
95481dc to
6011077
Compare
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>
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>
d85b1b8 to
7c1781b
Compare
2 tasks
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.
Description:
Issue #400 reported that fresh workspace builds fail because
plotly_staticrequires eitherchromedriverorgeckodriverat compile time, even when static export is not being used.This PR changes
plotly_staticso that it compiles cleanly without a selected driver feature. That fixes bare workspace builds and no-featureplotlytest builds from a fresh clone.The explicit driver requirement for actual static export is still preserved:
chromedriverandgeckodriverremain mutually exclusiveThis PR also suppresses no-driver build-script unused warnings, since allowing featureless
plotly_staticbuilds makes much of the driver setup code intentionally unused in that configuration.Closes #400.
Checklist:
mainin WSL.cargo check --workspacein WSL.cargo test -p plotly --no-runin WSL.cargo clippy -p plotly_static --no-default-features -- -D warnings -A deprecatedin WSL.cargo clippy -p plotly_static --features chromedriver,webdriver_download -- -D warnings -A deprecatedin WSL.BROWSER_PATH=$HOME/.local/share/plotly-ci/firefox/firefox/firefox cargo clippy -p plotly_static --features geckodriver,webdriver_download -- -D warnings -A deprecatedin WSL.cargo test -p plotly plot::tests::save_to_png --features plotly_ndarray,plotly_image,static_export_geckodriver,static_export_wd_download,debug -- --nocapture.plotlypackage tests in WSL usingcargo test -p plotly --features plotly_ndarray,plotly_image,static_export_chromedriver,debug.After the fix: