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

[ci] Cargo doc step jq error #1228

Open
joshlf opened this issue May 10, 2024 · 1 comment
Open

[ci] Cargo doc step jq error #1228

joshlf opened this issue May 10, 2024 · 1 comment
Labels
experience-medium This issue is of medium difficulty, and requires some experience

Comments

@joshlf
Copy link
Member

joshlf commented May 10, 2024

In CI, this error has been happening, but not blocking merges thanks to a lack of set -e:

jq: error: syntax error, unexpected '[', expecting FORMAT or QQSTRING_START (Unix shell quoting issues?) at <top-level>, line 1:
.packages[] | select(.name == "zerocopy").metadata.docs.rs."rustdoc-args".[]                                                                          
jq: 1 compile error
@joshlf joshlf added the experience-medium This issue is of medium difficulty, and requires some experience label May 29, 2024
zoo868e pushed a commit to zoo868e/zerocopy that referenced this issue Jun 4, 2024
@zoo868e
Copy link
Contributor

zoo868e commented Jun 4, 2024

Hi @joshlf,

I've made progress on the issue at hand and managed to correct the jq command that extracts the rustdoc-args from Cargo.toml. Unfortunately, this fix has uncovered a series of subsequent errors.

Initially, the CI failed on the Cargo doc job due to the generate-link-to-definition flag in rustdoc. This issue had not previously arisen because the rustdoc-args were not being correctly passed, hence the job had never failed.

To address this, I've moved the generate-link-to-definition flag to RUSTDOCFLAGS and included a conditional check for the nightly toolchain. After that, there is issue related to the use of #![feature] as indicated by the following error:

error[E0554]: `#![feature]` may not be used on the stable release channel
   --> src/lib.rs:271:22
    |
271 | #![cfg_attr(doc_cfg, feature(doc_cfg))]
    |                     

Hence I move the --cfg doc_cfg from rustdoc-args to RUSTDOCFLAGS, since feature() is exclusive to the nightly toolchain.

Given these developments, it appears we no longer require flag extraction from the metadata since we've eliminated all features specific to Cargo.toml. Nevertheless, I have preserved the flag querying logic for potential future use with stable flags.

Best regards,
Matt

zoo868e pushed a commit to zoo868e/zerocopy that referenced this issue Jun 4, 2024
This commit addresses several issues related to the generation of Rust
documentation:
1. Corrects the extraction of `rustdoc-args` from `Cargo.toml`,
   resolving google#1228
2. Transfers `rustdoc` flags that are exclusive to the `nightly`
   toolchain from `rustdoc-args` in `Cargo.toml` to `RUSTDOCFLAGS`. This
   ensures that the documentation generation process is aligned  with
   the correct toolchain environment.
3. Add `set -eo pipefail` in the CI job `Cargo doc` to enhance the
   robustness of the CI pipeline.
zoo868e pushed a commit to zoo868e/zerocopy that referenced this issue Jun 4, 2024
This commit addresses several issues related to the generation of Rust
documentation:
1. Corrects the extraction of `rustdoc-args` from `Cargo.toml`,
   resolving google#1228
2. Transfers `rustdoc` flags that are exclusive to the `nightly`
   toolchain from `rustdoc-args` in `Cargo.toml` to `RUSTDOCFLAGS`. This
   ensures that the documentation generation process is aligned  with
   the correct toolchain environment.
3. Add `set -eo pipefail` in the CI job `Cargo doc` to enhance the
   robustness of the CI pipeline.
zoo868e added a commit to zoo868e/zerocopy that referenced this issue Jun 4, 2024
This commit addresses several issues related to the generation of Rust
documentation:
1. Corrects the extraction of `rustdoc-args` from `Cargo.toml`,
   resolving google#1228
2. Transfers `rustdoc` flags that are exclusive to the `nightly`
   toolchain from `rustdoc-args` in `Cargo.toml` to `RUSTDOCFLAGS`. This
   ensures that the documentation generation process is aligned  with
   the correct toolchain environment.
3. Add `set -eo pipefail` in the CI job `Cargo doc` to enhance the
   robustness of the CI pipeline.
zoo868e added a commit to zoo868e/zerocopy that referenced this issue Jun 4, 2024
This commit addresses several issues related to the generation of Rust
documentation:
1. Corrects the extraction of `rustdoc-args` from `Cargo.toml`,
   resolving google#1228
2. Transfers `rustdoc` flags that are exclusive to the `nightly`
   toolchain from `rustdoc-args` in `Cargo.toml` to `RUSTDOCFLAGS`. This
   ensures that the documentation generation process is aligned  with
   the correct toolchain environment.
3. Add `set -eo pipefail` in the CI job `Cargo doc` to enhance the
   robustness of the CI pipeline.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experience-medium This issue is of medium difficulty, and requires some experience
Projects
None yet
Development

No branches or pull requests

2 participants