Skip to content

Update dependency tree and raise MSRV to 1.79 #235

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

Merged
merged 7 commits into from
Jun 11, 2025

Conversation

mtreinish
Copy link
Member

This commit updates the dependency tree to pull in the latest versions of all the dependencies which were now out of date. The exception is dev dependencies aren't update and also ra_ap_limit is held to 0.0.229 because newer releases require rust >= 1.80.0 which is higher than Qiskit >2.0's MSRV of 1.79. Accordingly this commit updates the MSRV to 1.79 to make sure there aren't any compatibility issues with older versions of Rust.

This commit updates the dependency tree to pull in the latest versions
of all the dependencies which were now out of date. The exception is
dev dependencies aren't update and also ra_ap_limit is held to 0.0.229
because newer releases require rust >= 1.80.0 which is higher than
Qiskit >2.0's MSRV of 1.79. Accordingly this commit updates the MSRV to
1.79 to make sure there aren't any compatibility issues with older
versions of Rust.
@mtreinish mtreinish requested a review from jlapeyre March 13, 2025 18:08
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain I quite got the motivation for raising the MSRV if we don't need 1.70 within this package, but I also don't have a problem shifting it to match Qiskit.

Comment on lines -79 to +80
let offset = span.start;
Report::build(ReportKind::Error, file_path, offset)
// .with_code(3)
Report::build(ReportKind::Error, (file_path, span.clone()))
.with_code(3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a behavioural change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure, I looked through the ariadne docs at the time I wrote this and I thought that it should work the same, but I might have screwed it up. It's been a busy few weeks so I don't remember the details

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I realise there's two changes highlighted. I just meant the commented-out .with_code got added back. I was assuming the other change was part of the upgrade.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified that the ariadne API has changed, so that the previous line errors. I looked in the docs as well, but was unable to find a concrete example of the new code. It looks like it might be this trait implementation; it's the only tuple argument that I find. My guess is that this preserves behavior.

[In a suggestion below, I removed the comments that are obsoleted by this change]

@mtreinish
Copy link
Member Author

I'm not certain I quite got the motivation for raising the MSRV if we don't need 1.70 within this package, but I also don't have a problem shifting it to match Qiskit.

I think I can probably roll it back, I think the only thing actively requiring 1.79 are some of the rust-analyzer dependencies. I just figured while I was doing this it's better to sync the MSRV to avoid building multiple versions of dependencies if possible.

Copy link
Collaborator

@jlapeyre jlapeyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused on the discussion regarding the MSRV. The reasonable thing is to raise it as high as necessary, but no higher. But apparently it's more complicated than that. Maybe determining the minimum version is too much work.

I'll pull this and build it, since it looks like some of the rationale behind changes has been lost in the mists of time.

@@ -361,7 +361,7 @@ where
_ => ascii_check(c, mode.characters_should_be_ascii()).map(Into::into),
};
let end = src.len() - chars.as_str().len();
callback(start..end, res.map(Into::into));
callback(start..end, res);
Copy link
Collaborator

@jlapeyre jlapeyre Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this is in your commit messages. I assume this is clippy and/or rustc that requires this change, right? And adding parens in a logic expression below, etc.

@@ -76,7 +76,7 @@ impl Input {
// }
pub(crate) fn is_joint(&self, n: usize) -> bool {
let (idx, b_idx) = self.bit_index(n);
self.joint[idx] & 1 << b_idx != 0
self.joint[idx] & (1 << b_idx) != 0
Copy link
Collaborator

@jlapeyre jlapeyre Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that clippy asked for this. My recollection is that if I added parens for clarity, clippy would say to remove them because they are not semantically necessary. But this looks like the opposite.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a new rule in Rust 1.86 they recommend using explicit paren because the precedence of bitwise operations isn't as widely known: https://rust-lang.github.io/rust-clippy/rust-1.87.0/index.html#precedence_bits

Rust 1.86 is relatively new only a couple of months old.

@jlapeyre
Copy link
Collaborator

I was unable to get clippy or rustfmt to complain about a few of the changes. But, they are fine.

If this update reduces potential burden on development of Qiskit, I am ok with it.

@jlapeyre jlapeyre merged commit 7a12427 into Qiskit:main Jun 11, 2025
7 checks passed
@mtreinish mtreinish deleted the bump-dep-tree branch June 11, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants