Skip to content

Conversation

mtreinish
Copy link
Member

Summary

In the recently merged #14203 the bincode dependency was added to the qiskit-synthesis crate to provide a binary serialization of the computed basic approximations. However, under the covers this library is using serde and it depends on having anything passed to it be serde serializable. When building the qiskit-synthesis crate by itself the hashbrown crate does not enable the serde feature meaning it doesn't derive the necessary serialization traits for serde. This didn't show up in a full build because other libraries pulled in as part of the build cause serde to be enabled for hashbrown. This commit fixes this by adding the serde feature to the Cargo.toml for hashbrown to ensure we're building with the feature required in the crate using it.

This also takes the opportunity to fix some small clippy lint issues identified by the latest stable version of clippy in the synthesis crate which were introduced in #14203 and #13929.

Details and comments

@mtreinish mtreinish added this to the 2.1.0 milestone Jun 3, 2025
@mtreinish mtreinish requested a review from a team as a code owner June 3, 2025 20:37
@mtreinish mtreinish added priority: high Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository labels Jun 3, 2025
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@mtreinish mtreinish mentioned this pull request Jun 3, 2025
jakelishman
jakelishman previously approved these changes Jun 3, 2025
@jakelishman jakelishman enabled auto-merge June 3, 2025 20:39
@mtreinish mtreinish force-pushed the resolve-the-sk-bincode-serde-hashbrown-quagmire branch from 43990d7 to 603803e Compare June 3, 2025 20:45
In the recently merged Qiskit#14203 the bincode dependency was added to the
qiskit-synthesis crate to provide a binary serialization of the computed
basic approximations. However, under the covers this library is using
serde and it depends on having anything passed to it be serde
serializable. When building the qiskit-synthesis crate by itself the
hashbrown crate does not enable the serde feature meaning it doesn't
derive the necessary serialization traits for serde. This didn't show up
in a full build because other libraries pulled in as part of the build
cause serde to be enabled for hashbrown. This commit fixes this by
adding the serde feature to the Cargo.toml for hashbrown to ensure we're
building with the feature required in the crate using it.

This also takes the opportunity to fix some small clippy lint issues
identified by the latest stable version of clippy in the synthesis crate
which were introduced in Qiskit#14203 and Qiskit#13929.
@jakelishman jakelishman added this pull request to the merge queue Jun 3, 2025
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jun 3, 2025
This commit adds a new step to the rust unit test CI job that runs cargo
check on each of our crates in isolation to ensure that they all build
on their own. This will prevent issues like what was fixed in Qiskit#14526
from popping up again (which has happened before).
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request Jun 3, 2025
This commit adds a new step to the rust unit test CI job that runs cargo
check on each of our crates in isolation to ensure that they all build
on their own. This will prevent issues like what was fixed in Qiskit#14526
from popping up again (which has happened before).
Merged via the queue into Qiskit:main with commit 37756f2 Jun 3, 2025
26 checks passed
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15427494068

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 16 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.01%) to 87.893%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 1 93.23%
crates/transpiler/src/passes/unitary_synthesis.rs 1 94.57%
crates/circuit/src/symbol_expr.rs 2 75.12%
crates/qasm2/src/parse.rs 12 96.68%
Totals Coverage Status
Change from base Build 15424467133: -0.01%
Covered Lines: 81384
Relevant Lines: 92594

💛 - Coveralls

@mtreinish mtreinish deleted the resolve-the-sk-bincode-serde-hashbrown-quagmire branch June 3, 2025 21:51
github-merge-queue bot pushed a commit that referenced this pull request Jun 4, 2025
This commit adds a new step to the rust unit test CI job that runs cargo
check on each of our crates in isolation to ensure that they all build
on their own. This will prevent issues like what was fixed in #14526
from popping up again (which has happened before).
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
In the recently merged Qiskit#14203 the bincode dependency was added to the
qiskit-synthesis crate to provide a binary serialization of the computed
basic approximations. However, under the covers this library is using
serde and it depends on having anything passed to it be serde
serializable. When building the qiskit-synthesis crate by itself the
hashbrown crate does not enable the serde feature meaning it doesn't
derive the necessary serialization traits for serde. This didn't show up
in a full build because other libraries pulled in as part of the build
cause serde to be enabled for hashbrown. This commit fixes this by
adding the serde feature to the Cargo.toml for hashbrown to ensure we're
building with the feature required in the crate using it.

This also takes the opportunity to fix some small clippy lint issues
identified by the latest stable version of clippy in the synthesis crate
which were introduced in Qiskit#14203 and Qiskit#13929.
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
This commit adds a new step to the rust unit test CI job that runs cargo
check on each of our crates in isolation to ensure that they all build
on their own. This will prevent issues like what was fixed in Qiskit#14526
from popping up again (which has happened before).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog priority: high Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants