Using Plotly.rs in CI with `static_export_wd_download` fails
还没有人认领这个 Issue。
- 主要语言
- Rust
- 星标
- 1.5k
- 派生
- 128
- PR 合并指标
- 30 天内没有已合并 PR
描述
I have a GitHub Actions CI that has been building with plotly.rs fine for a year, but started failing today. I was building with this:
plotly = { version = "0.13.5", features = ["kaleido", "kaleido_download"] }
which failed due to errors like this:
error[E0412]: cannot find type `Table` in crate `crc`
--> /Users/bart/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lzma-rust2-0.15.3/src/xz.rs:33:33
|
33 | const CRC32: crc::Crc<u32, crc::Table<16>> =
| ^^^^^ not found in `crc`
It turns out that under my project I have two versions of crc being used, and somehow (because plotly_kaleido uses it as a build-dependency? Shouldn't cargo handle this fine?) they are colliding:
❯ cargo tree -p crc@2.1.0 -i
crc v2.1.0
└── lzma-rust2 v0.15.3
└── zip v7.1.0
[build-dependencies]
└── plotly_kaleido v0.13.6
└── plotly v0.13.5
My project uses sqlx:
❯ cargo tree -p crc@3.4.0 -i
crc v3.4.0
└── sqlx-core v0.8.6
├── sqlx v0.8.6
So instead of fighting plotly_kaleido, it being deprecated, I switched to this:
plotly = { version = "0.14", features = ["static_export_geckodriver", "static_export_wd_download"] }
Which works fine on my local machine, but when I build in GitHub actions on the generic ubuntu runner, I get this
warning: plotly_static@0.1.0: You can specify WEBDRIVER_PATH to an existing chromedriver/geckodriver installation to avoid downloads.
warning: plotly_static@0.1.0: You can override browser detection using BROWSER_PATH environment variable.
warning: plotly_static@0.1.0: geckodriver selected but not installed, will be downloaded ...
error: failed to run custom build command for `plotly_static v0.1.0`
Caused by:
process didn't exit successfully: `/__w/foo/bar/target/debug/build/plotly_static-60b220e432895492/build-script-build` (exit status: 1)
--- stdout
cargo:rerun-if-changed=src/lib.rs
cargo::rerun-if-changed=/github/home/.local/bin
cargo::warning=You can specify WEBDRIVER_PATH to an existing chromedriver/geckodriver installation to avoid downloads.
cargo::warning=You can override browser detection using BROWSER_PATH environment variable.
cargo::warning=geckodriver selected but not installed, will be downloaded ...
--- stderr
Error: Failed to detect browser path for geckodriver
Caused by:
0: Failed to run command
1: cannot find binary path
warning: build failed, waiting for other jobs to finish...
My assumption would be that static_export_wd_download takes care of downloading whatever rendering engine I'd need. Maybe I'm misunderstanding the requirements for not using kaleido, but seems like some sort of bug.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
先从 plotly_static 构建脚本以及 static_export_geckodriver/static_export_wd_download 功能配置入手,然后在通用 Ubuntu GitHub Actions runner 上复现该故障。将浏览器和驱动程序的检测路径与成功的本地构建进行比较;完成的标准是,文档中所述的 CI 设置能够完成静态导出,且不再出现报告的构建脚本错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- github-actions, rust
- 领域
- ci-cd, data-visualization
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 35/100