bazelbuild / bazelbuild/rules_closure

Invalid Order: Compile

Open
#258 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
159
Forks
111
PR merge metrics
No merged PRs in 30d

Description

Hey all,
I'm very new to Bazel and I'm looking to use this library to build a Javascript project. I created a dummy project to test this on, and it's literally one JS source file that has a console.log and I keep getting this error: `Invalid Order: Compile`.

To even get this far, I had to to find and replace `set` to `depset` because i am using version `0.4.1`. I can't use `0.4.2` because it doesn't work with Bazel 0.10.X and above (this is another problem).

Any help would be very appreciated. Thanks!!!

Bazel version:
```
Build label: 0.11.0-homebrew
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sun May 1 04:50:25 +50118 (1519414519825)
Build timestamp: 1519414519825
Build timestamp as int: 1519414519825
```

**FULL ERROR**
```
ERROR: /Users/jorgedavila/Desktop/test-bzel/web/BUILD:4:1: in closure_js_library rule //web:main_lib:
Traceback (most recent call last):
File "/Users/jorgedavila/Desktop/test-bzel/web/BUILD", line 4
closure_js_library(name = 'main_lib')
File "/private/var/tmp/_bazel_jorgedavila/b57ddc8c1dd7b1475c170e1610dad3f5/external/io_bazel_rules_closure/closure/compiler/closure_js_library.bzl", line 32, in _impl
collect_transitive_js_srcs(ctx)
File "/private/var/tmp/_bazel_jorgedavila/b57ddc8c1dd7b1475c170e1610dad3f5/external/io_bazel_rules_closure/closure/private/defs.bzl", line 79, in collect_transitive_js_srcs
depset(order = "compile")
Invalid order: compile
ERROR: Analysis of target '//web:main_lib' failed; build aborted: Analysis of target '//web:main_lib' failed; build aborted
INFO: Elapsed time: 0.133s
FAILED: Build did NOT complete successfully (0 packages loaded)
```

Contributor guide

Open the contributing guide

Research direction

Start with closure/private/defs.bzl at collect_transitive_js_srcs and closure/compiler/closure_js_library.bzl at the reported call site. Reproduce the dummy JavaScript build with rules_closure 0.4.1 and Bazel 0.11.0, then compare the behavior with 0.4.2; done means the target reaches analysis without the Invalid Order error or the supported-version limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.