-
Notifications
You must be signed in to change notification settings - Fork 33
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
Loading macros from buckaroo dependencies #371
Comments
hmm i'm pretty sure that worked in the past. |
According to the Bazel docs:
So we cannot use function outputs or variables in a The reason the actual workspace name has a weird hash appended is to ensure that even when there are two different versions of the same package somewhere in the resolution tree there is not a name collision. I will have to think further about how this might work. |
I'm not getting something. The package which contains |
Buckaroo is a tool that fetches packages containing Buck or Bazel projects. It downloads them to a folder local to the project (a bit like Buckaroo packages are usually identified by a name like
The challenge now is that the user wants to load a macro from a package. We can get the workspace name using a function generated by Buckaroo: load("//buckaroo:defs.bzl", "buckaroo_workspace")
someproject_workspace = buckaroo_workspace("github.com/someorg/someproject")
someproject_workspace # github_someorg_someproject_aabbccdd But we cannot use this variable in a
Perhaps you can give some insight into how we can achieve this in Bazel? |
I've given this some thought and I don't think this is possible. I am by no means an expert on Bazel so take this with a grain of salt. I would personally open a feature request and discuss this with the Bazel team. |
@nikhedonia Another option to consider is to add a |
Description
My goal is to use macros defined in a dependency's "bzl" file. This is even more useful when using Bazel, as Bazel provides custom rules in addition to macros.
From my understanding, labels of buckaroo cells should be use with the buckaroo macros and not written explicitly.
In Bazel mode, some hash is added to the workspaces' names. This makes the use of the macros mandatory.
The problem here is that the load statement in Buck and in Bazel accept string literal only.
Examples:
In Buck:
In Bazel:
Expected Behavior
Is there a proper way for loading macros with Buckaroo? How can I make it work?
Actual Behavior
In Buck:
In Bazel:
Context
Specifically, I'm trying to use protobuf's "proto_gen" rule/macro.
Your Environment
The text was updated successfully, but these errors were encountered: