-
Notifications
You must be signed in to change notification settings - Fork 15
Description
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?)
openqasm3_parser/.github/workflows/main.yml
Lines 26 to 29 in 5305ac3
| - name: Clippy | |
| run: cargo clippy --all-targets -- -D warnings -D clippy::dbg_macro | |
| - name: Run tests | |
| run: cargo test --verbose -- --skip sourcegen_ast --skip sourcegen_ast_nodes |
But for the MSRV, we do not run clippy in CI, and the command for running tests is slightly different.
openqasm3_parser/.github/workflows/main.yml
Lines 41 to 44 in 5305ac3
| - name: Build | |
| run: cargo build --release --verbose | |
| - name: Run tests | |
| run: cargo test --verbose --lib --tests -- --skip sourcegen_ast --skip sourcegen_ast_nodes |
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:
openqasm3_parser/crates/oq3_syntax/src/ptr.rs
Lines 34 to 49 in 5305ac3
| impl<N: AstNode> Clone for AstPtr<N> { | |
| #[rustversion::before(1.74)] | |
| fn clone(&self) -> AstPtr<N> { | |
| AstPtr { | |
| raw: self.raw.clone(), | |
| _ty: PhantomData, | |
| } | |
| } | |
| #[rustversion::since(1.74)] | |
| fn clone(&self) -> AstPtr<N> { | |
| AstPtr { | |
| raw: self.raw, | |
| _ty: PhantomData, | |
| } | |
| } | |
| } |
I think it helped, but I don't recall why I was not able to solve the problem completely.