Qiskit / openqasm3_parser

Parser and semantic analyzer for the OpenQASM3 language
Apache License 2.0
10 stars 11 forks source link

Make code compile and lint cleanly under all relevant versions of rust #196

Open jlapeyre opened 5 months ago

jlapeyre commented 5 months ago

We need to have more reliable CI for all relevant versions of the rust toolchain. Is there a way to make this happen? I'd prefer to not to commit Cargo.lock.

In our GH CI, this is what runs with the default Rust version (is it maybe the latest stable?) https://github.com/Qiskit/openqasm3_parser/blob/5305ac349f69db705f0bd8e9f422bfd2c238f792/.github/workflows/main.yml#L26-L29

But for the MSRV, we do not run clippy in CI, and the command for running tests is slightly different.

https://github.com/Qiskit/openqasm3_parser/blob/5305ac349f69db705f0bd8e9f422bfd2c238f792/.github/workflows/main.yml#L41-L44

I found that occasionally upon pushing a PR, CI would fail because some component or dep is upgraded.

I tried some conditional compilation. For example here: https://github.com/Qiskit/openqasm3_parser/blob/5305ac349f69db705f0bd8e9f422bfd2c238f792/crates/oq3_syntax/src/ptr.rs#L34-L49

I think it helped, but I don't recall why I was not able to solve the problem completely.

Raghav-Bell commented 5 months ago

Followings are good references to resolve this issue: clone_copy issue reported [Roadmap] Lint groups Thanks