-
Notifications
You must be signed in to change notification settings - Fork 115
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
closure_library.BUILD can't be referenced across repositories #9
Comments
Assuming you've correctly included the repositories.bzl file, I'm not sure what would be causing that at first glance. Would you mind troubleshooting that for us? |
Sure. I'll let you know what I find out. |
It seems to be related to this entry in closure/repositories.bzl:
I've run into this problem before when including files from other projects as a repository. I suspect the problem is that bazel is looking for the build file in my project workspace instead of the io_bazel_rules_closure repository that I specified in my workspace file. I should be able to create a minimal setup to reproduce the issue and file it there. As a workaround I can copy the |
Yes definitely file an upstream bug for this, and have it reference this issue. |
Where are you copying the closure_library.BUILD file? I tried copying under %workspace%/closure/library/closure_library.BUILD but now I'm getting a cascade of BUILD files not found i.e.: every time I add one it complains about a new one. (it is possible that I'm doing something wrong too... pretty new to bazel myself) |
That's odd. When I copied it over, it continued complaining that the file didn't exist. I ran |
If you needed to run bazel clean, that's probably a bug. In theory, bazel should never ever require clean, because it's just that good. So if Bazel isn't being perfect, I'd advise filing a bug. |
opened bazelbuild/bazel#1075 |
@jart agreed. But that's a different bug from the one I just filed. |
opened bazelbuild/bazel#1076 for the necessary clean after copying build file. |
Looks like the suggested workaround for this issue is to use build_file_content instead of build_file. |
Also this is a known problem: bazelbuild/bazel#855 |
Yeah closure_library.BUILD is 1,032 LOC; there's a 0% chance we're using |
Should we update the readme with a workaround and reference to bazelbuild/bazel#855 then? |
@wolfgangmeyers I've updated the readme with a link to all "launch blocker" issues. |
FYI I fixed bazelbuild/bazel#855 yesterday |
I'll pull bazel from head and test |
Ok, I pulled the latest bazel from head and completely removed closure/* from my source tree. When building my closure_js_binary, getting a slightly different error now:
Let me know if a reproduction project would help with this. |
no, the source of the closure library needs to be changed so I guess you need to wait for the next release of Bazel to include that change. Because to work, you have to use labels |
@damienmg @jart I think that would be a change in rules_closure, right? Correct me if I'm wrong but the closure library source that's pulled in doesn't have any bazel-related files. The latest changes (fix for bazelbuild/bazel#855) are in the master branch of Bazel, right? |
Sorry I meant the source of the closure rules repositories. Basically you have to use str(Label("//closure/library:closure_library.BUILD")) instead of "/closure/library/closure_library.BUILD". |
So the definition in repositories.bzl looks like this currently:
When I update the build_file to use Label:
I also tried
Are there any other changes required other than updating the build_file to use a label? |
should be |
Awesome, thanks. New error, may be something needing refactoring?
py_binary declaration for jschecker.py:
|
This one is another error I am tracking down (see #32) |
btw there is a trick to use that feature from 0.2.1: create a custom skylark repository that use Label, it would also allow multiple build files in the repo and fix the issue described in the comment of the closure_library.BUILD file. |
To confirm: there is no reasonable workaround to allow building closure js binaries with bazel right now, and I should just wait for this issue to be resolved? Is there an ETA? Not trying to be annoying, just excited to use it! Thanks |
As far as I know, there's no reasonable workaround to using the Closure Rules at the moment, aside from copying the entire project into your source tree. I'm holding off on developing it until the launch blockers are fixed. |
fwiw I am cutting a canary tomorrow for 0.2.2. There should be the label On Wed, Apr 13, 2016 at 8:20 PM Justine Tunney [email protected]
|
Will the label fix help to resolve #32 ? |
#32 is fixed, isn't it? |
Looks like I forgot to subscribe to it :) - I'll test when I have time. |
I tried copying this project into my source tree, but it still didn't do it for me. WORKSPACE
BUILD
ERROR with 0.2.2 bazel
I have no idea what the error means. (If it's expected that copying into my project would not work, then feel free to disregard!) |
@robfig Can you try this instead?
Also note that I only had to copy the closure/ subdirectory of rules_closure into my project to get it working. |
Ah, I stripped the @io_bazel_rules_closure from everywhere since that would reference the remote repo instead of the rules that I copied into my source tree. The version that references @io_bazel_rules_closure had the same error and looks like this: WORKSPACE
BUILD
ERROR
|
Did you make sure to build bazel from HEAD? (I'm currently at bazelbuild/bazel@653869e) Also try using |
I was using release-0.2.2 -- I just built it at 653869e and it didn't change the outcome. If it helps, here is a snapshot of my workspace: |
@robfig check out robfig/undertow-bazel-closure-tools#1 |
Hah, thank you! now all of the individual targets build except the closure_template_java_library rule, which fails with
even after adding Guava to the deps. Anyway, it seems to be unrelated to this issue, so sorry for the noise and thanks for the assistance! |
Fix committed in #43 |
Upgrade travis builds to use bazel 0.2.2b. Update project paths to use str(Label(...)) fix documented in Issue bazelbuild#9. Implement missing should_generate_js_doc support.
When trying to build a closure_js_binary target, I'm now seeing this error:
The text was updated successfully, but these errors were encountered: