plotly / plotly/plotly.rs

Using Plotly.rs in CI with `static_export_wd_download` fails

オープン
#379 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。