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

Compiling protos creates illigal r#Self raw identifier #225

Closed
jpittis opened this issue Jan 11, 2020 · 6 comments
Closed

Compiling protos creates illigal r#Self raw identifier #225

jpittis opened this issue Jan 11, 2020 · 6 comments

Comments

@jpittis
Copy link

jpittis commented Jan 11, 2020

Bug Report

Version

0.1.0-beta.1

Platform

Linux archlinux 5.4.2-arch1-1 #1 SMP PREEMPT Thu, 05 Dec 2019 12:29:40 +0000 x86_64 GNU/Linux

Description

When compiling with tonic_build, I'm running into the following error:

error: `Self` cannot be a raw identifier

Which seems to be complaining about the following line in the generated protobufs:

  #[prost(message, tag="5")]
  r#Self(super::SelfConfigSource),
}

I'm gonna do some digging into what this means. I'm also happy to post a reproducible repo if that's preferred, I just wasn't sure if this was a proper bug or if I'm doing something wrong.

@LucioFranco
Copy link
Member

@jpittis this looks related to the prost crate. Looks like you are generating some proto that has the use of the word Self?

@jpittis
Copy link
Author

jpittis commented Jan 11, 2020

Yup! Here's the proto file I'm generating from:

https://github.com/envoyproxy/data-plane-api/blob/master/envoy/api/v2/core/config_source.proto#L164

Looks like the field is called self:

SelfConfigSource self = 5;

Any suggestions on how to proceed? Should I cross post this with the prost crate?
Gonna look there to see if anyone has had similar issues.

@jpittis
Copy link
Author

jpittis commented Jan 11, 2020

Here's a relevant prost issue: https://github.com/danburkert/prost/issues/179

@jpittis
Copy link
Author

jpittis commented Jan 11, 2020

Sees like the fix was added with danburkert/prost@f51cbb2 which is on master.

@jpittis
Copy link
Author

jpittis commented Jan 11, 2020

Ah I think this is the issue. prost-build forces 0.5.0 which does not include the latest prost master that includes the fix.

@jpittis
Copy link
Author

jpittis commented Jan 11, 2020

Given tonic-build does not have a dependency on the 0.5.0 prost with the bug (Cargo.toml), I don't see much point in keeping this issue open.

@jpittis jpittis closed this as completed Jan 11, 2020
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

No branches or pull requests

2 participants