-
Notifications
You must be signed in to change notification settings - Fork 315
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
Associated constants don't take the prefix into account properly #238
Comments
I'm taking a look at this, will have to possibly add an alternative to LiteralExpr so that the prefixing can take place. |
Fix mozilla#238 This ensures that constants of a struct type have their type and the type of their underlying value expressions renamed in the case of a prefix.
Fix #238 This ensures that constants of a struct type have their type and the type of their underlying value expressions renamed in the case of a prefix.
Thank you @IGI-111 ! Secondly, something strange is going on when I run wgpu-bindings:
It looks like the compilation is successful, but something returns an error? |
Supporting As for that error message, which unwrap is failing here? Might be something completely unrelated. Can you post the backtrace? |
It's the cbindgen::Builder::new()
.with_crate(source_dir)
.with_config(config)
.with_parse_expand(&["wgpu-native"])
.generate()
.unwrap()
.write_to_file(crate_dir.join("wgpu.h")); |
That is quite a weird |
@IGI-111 how can I investigate this / provide more info? |
I'd start by figuring out where that Err is generated, and then finding the source of the failure, it's probably wise to pull out gdb here. Maybe run cbindgen on only part of the offending codebase, or on all files individually? I mean with a relatively minimal example we could start to speculate on the cause. Best you can do is open an issue with the smallest offending code you can find. |
@kvark I don't know the reason, but running It seems like the command cbindgen runs for
Sometimes this seems to produce empty output, and instead results in an exit status of 0 with that message in stderr and empty stdout. I'm not sure how to reproduce it consistently though, and Does anyone know why |
I'm able to reproduce this consistently now. λ "/Users/josh/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo" "rustc" "--lib" "--manifest-path" "/Users/josh/Projects/wgpu-native/wgpu-native/Cargo.toml" "-p" "wgpu-native:0.1.0" "--" "-Z""unstable-options" "--pretty=expanded" > out1
Compiling wgpu-native v0.1.0 (file:///Users/josh/Projects/wgpu-native/wgpu-native)
Finished dev [unoptimized + debuginfo] target(s) in 0.94s
λ "/Users/josh/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo" "rustc" "--lib" "--manifest-path" "/Users/josh/Projects/wgpu-native/wgpu-native/Cargo.toml" "-p" "wgpu-native:0.1.0" "--" "-Z""unstable-options" "--pretty=expanded" > out2
Finished dev [unoptimized + debuginfo] target(s) in 0.33s out1 contains the expanded source as expected. This reminded me of behavior I noticed with rust-clippy, so I went looking for a similar issue. It seems we're blocked by the same issue as rust-lang/rust-clippy#2604, so macro expansion will only work when recompilation is required. |
#234 is missing a test for preffixed bindings. This is what we get:
This doesn't compile, clearly, since there is no
TextureUsageFlags
.cc @IGI-111
The text was updated successfully, but these errors were encountered: