Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs.rsのビルドがコケてる #12

Closed
sksat opened this issue Jan 2, 2022 · 39 comments · Fixed by #14 or #19
Closed

docs.rsのビルドがコケてる #12

sksat opened this issue Jan 2, 2022 · 39 comments · Fixed by #14 or #19

Comments

@sksat
Copy link
Owner

sksat commented Jan 2, 2022

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

どうやらdocs.rsの自動ビルドはNetwork Access完全にダメっぽい.正しい.

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

Git submoduleにすべきかなあとも思ったけど,欲しいのはJSON Schemaだけなんだよなと思ってやめたんだよな

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

お?.gitmodulebranch = TAGいけるじゃん

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

お?.gitmodulebranch = TAGいけるじゃん

いけないけどね

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

あと実はcargo publish時に自分でビルドしたやつ持ってけたりしないんかな

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

cargo packageがまずそういうかんじじゃないな

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

ローカルにJSON Schemaが入ってたらそれを使うようにする & cargo publish --allow-dirty,がいいかもしれない.ちょっと気持ち悪いけれど(CIでやるようにすれば多少マシではある)

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

GitHub Actionsからcargo publishすんのって若干どうよと思わなくもなかったが,よく考えたら crates.io がGitHubでログインしてる(というかそれしかできない)ので別にいいかになった

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

まだうまくいくかはわからんためreopen

@sksat sksat reopened this Jan 2, 2022
@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

mainで

$ cargo clean
$ cargo b --features build-with-local-schema
$ cargo publish --features default,build-with-local-schema --allow-dirty --no-verify

を実行

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

待機会場
https://docs.rs/crate/rdfmt/latest/builds

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

しかしこれだと結局Gitで管理されてないだけでcrateのtarballにはjsonschema埋まってんだよな

@sksat
Copy link
Owner Author

sksat commented Jan 2, 2022

あ, #10 とかマージした後なのにpatch上げちゃった

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

ここでコケたあ

fs::remove_dir_all(&schema_dir).unwrap();

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

v0.1.2をリリースして再実行

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

またコケとる

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

それはそうなんだわ

fs::create_dir(&schema_dir).unwrap();

Result::unwrap() on an Err value: Os { code: 17, kind: AlreadyExists, message: "File exists" }', build.rs:50:33

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

v0.1.3をリリースして再試行

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

https://docs.rs/crate/rdfmt/0.1.3/builds/485724

thread 'rustc' panicked at 'could not find markdown in source', src/librustdoc/passes/mod.rs:181:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'extern-html-root-url'

error: could not document `rdfmt`

カス!!!!!!!!

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

まずdocs.rsでrust-toolchainが効かない(Cargo.lockから見る)のがカスでしょ

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

うわー,マジでnightlyでcargo docしたら死ぬわ

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

crate-versionがまず2020年に入ったやつっぽいな

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

$ cargo +nightly b -Z crate-versions
warning: flag `-Z crate-versions` has been stabilized in the 1.47 release, and is no longer necessary
  The crate version is now automatically added to the documentation.

   Compiling rdfmt v0.1.3 (/home/sksat/prog/rdfmt-rs)
    Finished dev [unoptimized + debuginfo] target(s) in 0.92s

アーハン

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

$ env RUSTDOCFLAGS='-v' cargo doc
thread 'rustc' panicked at 'could not find markdown in source', src/librustdoc/passes/mod.rs:199:48
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

error: Unrecognized option: 'crate-version'

error: could not document `rdfmt`

Caused by:
  process didn't exit successfully: `rustdoc --edition=2021 --crate-type lib --crate-name rdfmt src/lib.rs -o /home/sksat/prog/rdfmt-rs/target/doc --cfg 'feature="default"' --error-format=json --json=diagnostic-rendered-ansi -C metadata=4f4a0f890cba6fe6 -L dependency=/home/sksat/prog/rdfmt-rs/target/debug/deps --extern schemafy=/home/sksat/prog/rdfmt-rs/target/debug/deps/libschemafy-7a2d8e102fe8fcd2.so --extern serde=/home/sksat/prog/rdfmt-rs/target/debug/deps/libserde-7d419297a6d8d214.rmeta --extern serde_json=/home/sksat/prog/rdfmt-rs/target/debug/deps/libserde_json-be1c91fe357b9688.rmeta --extern serde_variant=/home/sksat/prog/rdfmt-rs/target/debug/deps/libserde_variant-76267bb47169b2ba.rmeta -v --crate-version 0.1.3` (exit status: 1)

だめだが

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

結構前に入ってるので普通にバグってる?

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

あーいやこれcrate-versionをオーバーライドするためのPRか

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

beta(1.58.0)だと大丈夫だな

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

しかし当たり前だけどここらへんのテストは通ってんだよな
https://github.com/rust-lang/cargo/blob/35e82eb45f10de09e2a4b8e5f15a1c9adbd34680/tests/testsuite/doc.rs#L1923-L1952

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

error: Unrecognized option: 'crate-version'ばかり気にしてたけど,よく見たらその前にここでpanicしてんだよな
https://github.com/rust-lang/rust/blob/abbead78f7ab2d27ebf556970695472d1cdad44e/src/librustdoc/passes/mod.rs#L199

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

src/lib.rsにdoc commentが皆無だとこのexpectが爆発するようになっている(ただしこのコードは3年前: rust-lang/rust@ee10d99 からあるがnightlyでだけ発動する).
src/lib.rsにdoc commentを追加するとこのexpectは爆発しなくなるが,error: Unrecognized option: 'crate-version'は相変わらず出現する.

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

そろそろ再現用PR切るか.docs.rs固有の問題ではなくなったし.

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

何もしてないのにexpect爆発が消えた...なぜ...

@sksat sksat mentioned this issue Jan 3, 2022
@sksat sksat closed this as completed in #19 Jan 3, 2022
@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

v0.2.0-rc.1をリリースして再試行

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

気絶してたがビルド通ってそう

@sksat
Copy link
Owner Author

sksat commented Jan 3, 2022

大丈夫そうだな.0.2.0リリースするか

@sksat
Copy link
Owner Author

sksat commented Jun 24, 2024

なんも覚えてないけどそろそろ直ってないですかね

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant