feat(rust_common): allow compile actions to declare more outdirs#3737
feat(rust_common): allow compile actions to declare more outdirs#3737alexeagle wants to merge 2 commits intobazelbuild:mainfrom
Conversation
|
@UebelAndre ping! |
illicitonion
left a comment
There was a problem hiding this comment.
This generally looks reasonable - could you add a small test showing this working? Thanks!
|
@illicitonion done, thanks PTAL |
ddd7571 to
e410375
Compare
|
Test failures do not look related to my change, FWICT |
illicitonion
left a comment
There was a problem hiding this comment.
Generally looks good, thanks! A couple of small things :)
|
Ok we're down to a real test failure! |
2efdf44 to
5917e2e
Compare
|
@illicitonion I'm trying to fix, but I don't know either Rust or Windows and don't have local repro. I believe the bug is in the test, not the three-line prod change, can I just tag the test to skip on windows? |
|
@illicitonion ping! would like to merge before I give up on contributing... |
|
Sorry for the delay here - it looks like even with the test skipping, CI was flaking, but hopefully looks good now! |
|
Here's the real-world macro where I use this feature, as an example: |
|
I now have to rebase this patch at customer sites to get @blorente fixes, can we merge it please. |
|
Ping, it has been another month. Do I need to fork? |
|
@UebelAndre is this being held back for some reason? Daniel is good with it, so can he merge? |
Head branch was pushed to by a user without write access
e7f7f15 to
0868aa6
Compare
This technique is sometimes needed when a proc_macro derives information from the build, and it needs to be consumed by some other tool.
For example this one generates a JSON file as an intermediate output
https://github.com/napi-rs/napi-rs/blob/main/crates/macro/src/expand/typedef/type_def.rs#L11-L12
and then expects developers to call this via a Node.js binary which wraps rustc and also transforms that file to a TypeScript type definition file.
Under Bazel, this is better modeled as a rust_shared_library that produces the binding file (
.soor.dylibfor example) along with that JSON output, then run the Node.js binary as a separate target.