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
Adding support for new languages #623
Comments
There's the Discussions tab as well, but in practice the team doesn't seem to enforce a distinction much, so you should be good here too :) (I don't have good answers for your other questions, but figured I'd at least mention this.) |
The builtin C++ rules understand the builtin C++ providers. If your Next, I'd probably start looking in the cxx prelude rules (especially Another idea which is something I've been meaning to try but haven't found the time yet, is to use anon rules for this. Using anon rules you can invoke a rule from within another rule. So maybe there's a way your jai_static_library could set up the necessary actions and providers to build your .lib, but then invoke All of these are just ideas though, unsure if they'll work in practice. |
Hrm. I've tried poking around the Rust and Go preludes. They both references I feel like this should be simple. I can successfully run So close. There's just some small piece of glue that's missing. But I can't tell what it is. And afaict there is no "step debugger" for rules. So I can't step through Starlark code and figure anything out. |
I'm telling you what that missing piece of glue is 😃 It's that your jai_static_library rule doesn't return a provider that the C++ rules understand. The reason adding your cpp lib doesn't cause the jai lib to be built when you build the cpp lib is because the cpp lib doesn't know how to consume any of the providers returned by your jai lib in a way that would force the jai lib to be materialized. For example, when I build a C++ library (e.g something that was created with
You can eliminate some of these as being obviously irrelevant, so the ones you need to look into are:
Even some of these are probably irrelevant (I don't know the whole hierarchy of C++ providers in detail). You need to examine the One thing you have to undestand about buck2 is that it's lazy to the maximum extent possible. Adding a dep from A to B does nothing by itself. All it does is pass information about B into A. If A consumes this information, that's when it will cause work to happen in B. Imagine a hypothetical rule like Depending on what |
I think I maybe need a
|
Not an issue per se, but not sure where else to ask questions? Sorry.
I'm trying to add support for Jai. The intent is to build a Jai static library that can be linked into a C++ program. I've managed to cobble together a
jai_static_library
that successfully producesfoo.lib
. I've added that as adep
to my C++ executable.What I haven't been able to figure out is how to get
foo.lib
passed as a linker argument for the C++ executable. Presumably I need to put something into aProvider
. But I'm not sure what or how.Related, it would be nice if the Writing Rules documentation page was a little more complete. Right now it's an incomplete assortment of snippets. It'd be nice if it at least included at the bottom complete files.
The text was updated successfully, but these errors were encountered: