-
Notifications
You must be signed in to change notification settings - Fork 701
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
rewriting static
string in generated bindings
#2852
Comments
rewriting static
string in generated headerrewriting static
string in generated bindings
On which OS? This works for me on trunk and on the crates.io crate... that string is nowhere in the source code... |
We're having similar trouble in our setup. A commonality between those is that we're also more "in the embedded area". We haven't managed to track down the source of the string either, but I did find that it is emitted as part of the bindgen generation (an strace shows that the odd string is written in the same write call as the rest of what our bindings.wrtite_to_file produces). I can reproduce this on Debian GNU/Linux with a current nightly Rust installed through rustup; the issue does not appear with stable. |
Correction: The string is not necessarily written in the same process: I mistook the contiguious read from the built file for a write. The write actually originates from a some process writing it to file descriptor 1, its stdout -- which makes the whole thing appear more like some printf that escaped debugging. |
… and it is rustfmt, where it is already reported: rust-lang/rustfmt#6210 (So I'd guess this is a duplicate, and we all wait for a new nightly where the offending line is reverted). |
Thanks! Yeah let´s close as a dupe of rust-lang/rustfmt#6210 |
I'm getting this when converting SentryPeer conf to its Rust bindings 868 times! Any ideas? Running:
|
Update your Rust nightly version, going forward 1-2 days will suffice.
|
Ah, I totally forgot I was on nightly. I was doing some miri stuff for finding a leak for a book I'm writting. Thanks! How did you spot that? |
That was a weird day, everyone was looking for it at the same time (and,
as it happened in this issue, reported it all over downstream to ensure
there is something referencable). I myself first (obviously, in
hindsight) had trouble reproducing the CI failures until I updated
nightly, and eventually looked at strace output to see where those
strange strings were coming from). At the time I had it, the rustfmt
issue was already open and almost fixed.
|
Oh, wow. Something hard to forget then! Thanks for replying so quickly. |
Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results
The generated bindings should compile properly and not contain arbitrary strings.
notes:
Builder::generate
frombuild.rs
The text was updated successfully, but these errors were encountered: