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

Build failure with v1.5.2: item not found in TypeParamBound #319

Closed
nategraf opened this issue Nov 8, 2024 · 2 comments · Fixed by #320
Closed

Build failure with v1.5.2: item not found in TypeParamBound #319

nategraf opened this issue Nov 8, 2024 · 2 comments · Fixed by #320

Comments

@nategraf
Copy link
Contributor

nategraf commented Nov 8, 2024

Hi team, I use borsh-derive as a dependency in my project and got this build error this morning. I'll get some more information and try to get a smaller reproduction case.

    Compiling borsh-derive v1.5.2
error[E0599]: no variant or associated item named `PreciseCapture` found for enum `TypeParamBound` in the current scope
   --> /home/ubuntu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/borsh-derive-1.5.2/src/internals/generics.rs:264:31
    |
264 |             | TypeParamBound::PreciseCapture(_) => {}
    |                               ^^^^^^^^^^^^^^ variant or associated item not found in `TypeParamBound`
@dj8yfo
Copy link
Collaborator

dj8yfo commented Nov 8, 2024

@nategraf well, a cargo update should help.

it got an update in syn from https://docs.rs/syn/2.0.77/syn/enum.TypeParamBound.html to https://docs.rs/syn/2.0.87/syn/enum.TypeParamBound.html.

it should not fail for --locked builds, as borsh version hasn't changed for those as well

but absolutely precisely and technically , yes, it's a omission/bug on borsh's side, so we'll update the precise minimum
required syn version https://github.com/near/borsh-rs/blob/master/borsh-derive/Cargo.toml#L28 and release that as 1.5.3

if something else is limiting the maximum version for syn in your dependency tree to be lower than https://docs.rs/syn/2.0.81/syn/enum.TypeParamBound.html, then cargo update won't help

that can typically be figured out with cargo tree --invert CLI command runs

@nategraf
Copy link
Contributor Author

nategraf commented Nov 8, 2024

Ah thank you. That is helpful. As you indicate, the Cargo.toml currently specifies syn with version = "2". As far as I can tell, it looks like PreciseCapture was introduced with version 2.0.81. With that, it would be good to specify this as the minimum version in your Cargo.toml. I've opened a PR to do so. No worries if this is not the right solution for you.

#320

This also provides enough info for us to work around the issue. We will specify syn = 2.0.81 in our own Cargo.toml for now.

SchmErik added a commit to risc0/risc0 that referenced this issue Nov 12, 2024
This is a workaround for near/borsh-rs#319

Co-authored-by: Victor Graf <[email protected]>
SchmErik added a commit to risc0/risc0 that referenced this issue Nov 12, 2024
This is a workaround for near/borsh-rs#319

---------

Co-authored-by: Victor Graf <[email protected]>
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 a pull request may close this issue.

2 participants