bazelbuild / rules_gwt Goto Github PK
View Code? Open in Web Editor NEWBazel rules for GWT
License: Apache License 2.0
Bazel rules for GWT
License: Apache License 2.0
There is support for DevMode but not CodeSever.
ERROR: D:/github/pavi2410/appinventor/appinventor/appengine/BUILD.bazel:14:16: GWT compiling appinventor/appengine/GwtApp.war failed: (Exit 127): bash.exe failed: error executing command (from target //appinventor/appengine:GwtApp) C:\WINDOWS\system32\bash.exe -c ... (remaining 1 argument skipped)
/bin/bash: line 2: external/local_jdk/bin/java: No such file or directory
When I'm using dev mode with an annotation processor (dagger). The dev mode does not detect changes in the generated code, only detects the changes in my code. I have to restart dev mode every time and that's not very productive.
$ bazel info
bazel-bin: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/execroot/monorepo/bazel-out/darwin-fastbuild/bin
bazel-genfiles: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/execroot/monorepo/bazel-out/darwin-fastbuild/bin
bazel-testlogs: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/execroot/monorepo/bazel-out/darwin-fastbuild/testlogs
character-encoding: file.encoding = ISO-8859-1, defaultCharset = ISO-8859-1
command_log: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/command.log
committed-heap-size: 457MB
execution_root: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/execroot/monorepo
gc-count: 88
gc-time: 6017ms
install_base: /var/tmp/_bazel_fsousa/install/7d5da6db2b770633e7923fd0e464983d
java-home: /private/var/tmp/_bazel_fsousa/install/7d5da6db2b770633e7923fd0e464983d/_embedded_binaries/embedded_tools/jdk
java-runtime: OpenJDK Runtime Environment (build 11.0.2+7-LTS) by Azul Systems, Inc.
java-vm: OpenJDK 64-Bit Server VM (build 11.0.2+7-LTS, mixed mode) by Azul Systems, Inc.
max-heap-size: 3817MB
output_base: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294
output_path: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/execroot/monorepo/bazel-out
package_path: %workspace%
release: release 0.27.0
repository_cache: /var/tmp/_bazel_fsousa/cache/repos/v1
server_log: /private/var/tmp/_bazel_fsousa/187058d15007c884f8885295a818c294/java.log.nostradamus.fsousa.log.java.20190620-143343.15144
server_pid: 15144
used-heap-size: 236MB
workspace: /Users/fsousa/Projects/ipb/monorepo
Incompatible flag --incompatible_restrict_string_escapes will break rules_gwt once Bazel 1.2.1 is released.
Please see the following CI builds for more information:
Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration
Important: Please do NOT modify the issue title since that might break our tools.
https://buildkite.com/bazel/rules-gwt/builds/75#63496e61-792d-420f-b036-2d73dea73ec2
ERROR: /workdir/example/src/main/java/io/bazel/sample/BUILD:7:1: Couldn't build file example/src/main/java/io/bazel/sample/SampleApp.war: error executing shell command: '/bin/bash -c set -e
--
| external/local_jdk/bin/java -Xmx1G -cp bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp-deps_deploy.jar:bazel-out/k8-fastbuild/bin/example/src/main/jav...' failed (Exit 1) bash failed: error executing command
| (cd /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/36/execroot/io_bazel_rules_gwt && \
| exec env - \
| /bin/bash -c 'set -e
| external/local_jdk/bin/java -Xmx1G -cp bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp-deps_deploy.jar:bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp-deps_deploy-src.jar com.google.gwt.dev.Compiler -war bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/. -deploy bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/WEB-INF/deploy -extra bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.extra -strict -sourceLevel 1.8 io.bazel.sample.SampleApp
| cp -LR example/src/main/java/io/bazel/sample/public/WEB-INF example/src/main/java/io/bazel/sample/public/css example/src/main/java/io/bazel/sample/public/index.html bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output
| rm -rf bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/gwt-unitCache
| find bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output -type f \| sed '\''s:^bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/::'\'' > file_list
| root=`pwd`
| cd bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output; $root/external/bazel_tools/tools/zip/zipper/zipper Cc ../SampleApp.war @$root/file_list
| cd $root
| ')
| Execution platform: @bazel_tools//platforms:host_platform
|
| Use --sandbox_debug to see verbose messages from the sandbox: bash failed: error executing command
| (cd /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/36/execroot/io_bazel_rules_gwt && \
| exec env - \
| /bin/bash -c 'set -e
| external/local_jdk/bin/java -Xmx1G -cp bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp-deps_deploy.jar:bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp-deps_deploy-src.jar com.google.gwt.dev.Compiler -war bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/. -deploy bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/WEB-INF/deploy -extra bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.extra -strict -sourceLevel 1.8 io.bazel.sample.SampleApp
| cp -LR example/src/main/java/io/bazel/sample/public/WEB-INF example/src/main/java/io/bazel/sample/public/css example/src/main/java/io/bazel/sample/public/index.html bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output
| rm -rf bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/gwt-unitCache
| find bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output -type f \| sed '\''s:^bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output/::'\'' > file_list
| root=`pwd`
| cd bazel-out/k8-fastbuild/bin/example/src/main/java/io/bazel/sample/SampleApp.war.gwt_output; $root/external/bazel_tools/tools/zip/zipper/zipper Cc ../SampleApp.war @$root/file_list
| cd $root
| ')
| Execution platform: @bazel_tools//platforms:host_platform
|
| Use --sandbox_debug to see verbose messages from the sandbox
| May 07, 2019 9:50:24 AM java.util.prefs.FileSystemPreferences$1 run
| WARNING: Couldn't create user preferences directory. User preferences are unusable.
| May 07, 2019 9:50:24 AM java.util.prefs.FileSystemPreferences$1 run
| WARNING: java.io.IOException: No such file or directory
| Compiling module io.bazel.sample.SampleApp
| [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')
| INFO: Elapsed time: 17.948s, Critical Path: 4.84s
| INFO: 37 processes: 37 remote cache hit.
| FAILED: Build did NOT complete successfully
Incompatible flag --incompatible_no_implicit_file_export will be enabled by default in a future Bazel release [1], thus breaking rules_gwt.
The flag is documented here: bazelbuild/bazel#10225
Please check the following CI builds for build and test results:
Never heard of incompatible flags before? We have documentation that explains everything.
If you don't want to receive any future issues for rules_gwt or if you have any questions,
please file an issue in https://github.com/bazelbuild/continuous-integration
Important: Please do NOT modify the issue title since that might break our tools.
[1] The target release hasn't been determined yet. Our tool will update the issue title once the flag flip has been scheduled.
From the latest CI run (https://buildkite.com/bazel/bazelisk-plus-incompatible-flags/builds/28#93a20a9b-87b7-409a-9267-738b57fd1eba), this repository doesn't work with --incompatible_depset_is_not_iterable
.
Logs:
ERROR: /var/lib/buildkite-agent/builds/bk-docker-gjds/bazel-downstream-projects/rules_gwt/example/src/main/java/io/bazel/sample/BUILD:7:1: in _gwt_war rule //example/src/main/java/io/bazel/sample:SampleApp:
--
| Traceback (most recent call last):
| File "/var/lib/buildkite-agent/builds/bk-docker-gjds/bazel-downstream-projects/rules_gwt/example/src/main/java/io/bazel/sample/BUILD", line 7
| _gwt_war(name = 'SampleApp')
| File "/var/lib/buildkite-agent/builds/bk-docker-gjds/bazel-downstream-projects/rules_gwt/gwt/gwt.bzl", line 22, in _gwt_war_impl
| ":".join([dep.path for dep in all_deps])
| File "/var/lib/buildkite-agent/builds/bk-docker-gjds/bazel-downstream-projects/rules_gwt/gwt/gwt.bzl", line 22, in ":".join
| [dep.path for dep in all_deps]
| type 'depset' is not iterable. Use the `to_list()` method to get a list. Use --incompatible_depset_is_not_iterable=false to temporarily disable this check.
Documentation: https://docs.bazel.build/versions/master/skylark/depsets.html
Let me know if you need help
At bb9d9f7, build broken on Bazel CI:
https://buildkite.com/bazel/rules-gwt/builds/290#1226e35c-3b8e-4eb3-92e5-0946061bca53
I can also repro locally:
bazel build --nobuild //...
(...)
INFO: Call stack for the definition of repository 'remote_java_tools_linux' which is a http_archive (rule definition at /usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/a48b2a55f93b882b584aa1279610c783/external/bazel_tools/tools/build_defs/repo/http.bzl:292:16):
- /usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/a48b2a55f93b882b584aa1279610c783/external/bazel_tools/tools/build_defs/repo/utils.bzl:205:9
- /DEFAULT.WORKSPACE.SUFFIX:260:1
ERROR: /usr/local/google/home/laszlocsomor/stuff/rules_gwt/gwt/gwt.bzl:515:5: //external:gwt_gson depends on @gwt_gson_artifact//jar:jar in repository @gwt_gson_artifact which failed to fetch. no such package '@gwt_gson_artifact//jar': java.io.IOException: Error downloading [http://central.maven.org/maven2/com/google/code/gson/gson/2.6.2/gson-2.6.2.jar] to /usr/local/google/home/laszlocsomor/.cache/bazel/_bazel_laszlocsomor/a48b2a55f93b882b584aa1279610c783/external/gwt_gson_artifact/gson-2.6.2.jar: GET returned 501 HTTPS Required
Other Bazel CI projects also broke with similar errors. Culprit is, Maven repository no longer supports "http" fetches. Example fix in another repo: bazelbuild/codelabs#30
Hello :)
Bazel CI tells me (https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/791#f6a9c352-3007-46f6-9fb8-10fe681d821a) that rules_gwt use the tools defaults package, which will be removed in bazel 0.23. Please follow the migration instructions at https://docs.bazel.build/versions/0.19.2/skylark/backward-compatibility.html#disable-inmemory-tools-defaults-package
Thanks!
Following the instructions in README.md, I'm noticing that my sample application results in the following error:
ERROR: OMITTED/io_bazel_rules_gwt/gwt/gwt.bzl:66:41: name 'FileType' is not defined
Looking at the tarball currently specified in Setup, I see that gwt.bzl does include an undefined name FileType
on line 66 and 144.
_gwt_dev = rule(
implementation = _gwt_dev_impl,
attrs = {
"package_name": attr.string(mandatory=True),
"java_roots": attr.string_list(mandatory=True),
"deps": attr.label_list(mandatory=True, allow_files=FileType([".jar"])),
"modules": attr.string_list(mandatory=True),
"pubs": attr.label_list(allow_files=True),
"output_root": attr.string(default="."),
"dev_flags": attr.string_list(),
"jvm_flags": attr.string_list(),
},
executable = True,
)
It seems these were removed in the current version of gwt.bzl, but it is still used in the README.md and will result in a similar error message.
The last meaningful commits here, along with the last release, were 2 1/2 years ago by @ekuefler.
If no one maintains this, I think we should either start a discussion to find new maintainers, or archive the repository to clearly set community expectations.
If you use these rules and see this message, it would be great to comment that you depend on them.
Incompatible flag --incompatible_load_java_rules_from_bzl will break rules_gwt once Bazel 1.2.1 is released.
Please see the following CI builds for more information:
Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration
Important: Please do NOT modify the issue title since that might break our tools.
Current, they are included as binary dependencies, which makes them hard to use especially if you have a large multi module project.
Thanks,
Kostya
Hi,
I was wondering how the sample app could be modified to include a "web.xml" that is often found in WEB-INF?
I have the following error:
ERROR: /private/var/tmp/_bazel_kostik/4c8c2bd228bf93b7790b6dc4f1bd0724/external/io_bazel_rules_gwt/gwt/gwt.bzl:436:3: no such package '@gwt_user_artifact//jar': BUILD file not found on package path and referenced by '//external:gwt-user'
What can I do about it?
java.lang.NoClassDefFoundError: com/google/gson/JsonParseException
at com.google.gwt.thirdparty.debugging.sourcemap.SourceMapGeneratorV3.mergeMapSection(SourceMapGeneratorV3.java:310)
at com.google.gwt.core.linker.SymbolMapsLinker.link(SymbolMapsLinker.java:316)
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.invokeLinkForOnePermutation(StandardLinkerContext.java:384)
at com.google.gwt.dev.Link.finishPermutation(Link.java:483)
at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:445)
at com.google.gwt.dev.Link.link(Link.java:178)
at com.google.gwt.dev.Compiler.compile(Compiler.java:244)
at com.google.gwt.dev.codeserver.Recompiler.doCompile(Recompiler.java:362)
at com.google.gwt.dev.codeserver.Recompiler.compile(Recompiler.java:175)
at com.google.gwt.dev.codeserver.Recompiler.recompile(Recompiler.java:134)
at com.google.gwt.dev.codeserver.Outbox.recompile(Outbox.java:135)
at com.google.gwt.dev.codeserver.JobRunner.recompile(JobRunner.java:113)
at com.google.gwt.dev.codeserver.JobRunner.access$000(JobRunner.java:37)
at com.google.gwt.dev.codeserver.JobRunner$2.run(JobRunner.java:90)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: com.google.gson.JsonParseException
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 19 more
Incompatible flag --incompatible_no_implicit_file_export will break rules_gwt once Bazel 1.2.1 is released.
Please see the following CI builds for more information:
Questions? Please file an issue in https://github.com/bazelbuild/continuous-integration
Important: Please do NOT modify the issue title since that might break our tools.
There's a breakage of rules_gwt with Bazel@Head, see: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1915#87c0e4d2-ab64-423c-b8df-3e1929ea8ebd
Autosheriff determined it was caused by: bazelbuild/bazel@acbcedd
This line:
":".join([dep.path for dep in all_deps]),
would produce claspath that will not work on Windows. It should be ";" on this platform.
I have the same issue in Gerrit build: [1].
[1] https://github.com/GerritCodeReview/gerrit/blob/master/tools/bzl/gwt.bzl#L149
Bazel is planning to move away from native rules for external repositories to Skylark rules, mainly because bundling every version control system in bazel does not scale. As part of this effort, we plan to submit https://bazel-review.googlesource.com/c/bazel/+/55932 soon, which will cause bazel by default to insist that the skylark versions the git and http rules for external repositories be used. This can be disabled by a flag for at least the next 6 months, but we still would appreciate if you could adopt your repository to use the Skylark versions of those rules soon.
A test run of downstream projects with that flag flip in bazel enabled can be found at https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/286
For more background, see
Thanks.
@ekuefler, you may recall bazelbuild/bazel#1952 where we had a discussion about best practices for defining Maven dependencies.
With your approval, I would like to volunteer my time to migrate this project to what seems to be the emerging consensus. That would entail modifying gwt/gwt.bzl to use java_import_external.
Faster downloads, redundant URLs, connection retries, exponential backoff, connection reset recovery, fast failover, auto-avoidance of low-bandwidth mirrors, captive portal avoidance, and compliance with policies of certain great firewalls. See: bazelbuild/bazel@ed7ced0
Shorter names. You can say deps = ["@com_google_guava"]
instead of deps = ["@com_google_guava//jar"]
.
Dependency relationships are encoded into repositories. If you want //external:gwt_jetty
you currently need to depend on //external:gwt_jetty
AND //external:gwt_jetty-io
AND //external:gwt_jetty-util
because maven_jar didn't let you specify that jetty depended on those jars. With java_import_external, if you want jetty, you just depend on jetty.
Ability to set testonly = 1
which maven_jar doesn't do.
Ability to set licenses = ["notice"]
, etc. which maven_jar doesn't do.
Ability to define annotation processors. See Dagger example here.
If you find the technical merits of these developments compelling, let me know, and I'll move forward.
Side note: I have another cool repository rule I've developed called filegroup_external (source) which you may also find interesting. I'd love to hear your thoughts.
When I change a file, nothing gets recompiled. It seems that you use built jars which never change.
Hello dear rules owners,
I see that bazel@HEAD breaks rules_gwt: https://buildkite.com/bazel/bazel-with-downstream-projects-bazel/builds/386#49798f07-966a-4185-a433-b81c17c198f6
Would you mind taking a look? Thank you very much!
This is the announcement email:
We are very close to remove in-memory //tools/default* package in favor of using @bazel_tools//tools/jdk: and @bazel_tools//tools/cpp: instead.
The changes will be ready with next release.
Motivation:
//tools/default was initially created as virtual in-memory package. It generates content dynamically based on current configuration. There is no need of having //tools/defaults any more as LateBoundAlias can generate dynamic configuration-based label resolving. Also, having //tools/default makes negative impact on performance, and introduces unnecessary code complexity.
All references to //tools/defaults:* targets should be removed or replaced to corresponding target in @bazel_tools//tools/jdk: and @bazel_tools//tools/cpp: packages.
Scope of changes and impact:
All targets in //tools/default will not exist any more. If you have any references inside your BUILD or *.bzl files to any of its, then bazel will fail to resolve.
Migration plan:
Please replace all occurrences:
//tools/defaults:jdk
-- by @bazel_tools//tools/jdk:current_java_runtime
-- or/and @bazel_tools//tools/jdk:current_host_java_runtime
//tools/defaults:java_toolchain
-- by @bazel_tools//tools/jdk:current_java_toolchain
//tools/defaults:crosstool
-- by @bazel_tools//tools/cpp:current_cc_toolchain
-- or/and @bazel_tools//tools/cpp:current_cc_host_toolchain
-- if you need reference to libc_top, then @bazel_tools//tools/cpp:current_libc_top
These targets will not be supported any more:
//tools/defaults:coverage_report_generator
//tools/defaults:coverage_support
With 28d48b0, I believe we raised the ubuntu CI machine config from 16.04 to 18.04
Unfortunately, I don't think CI has ever passed on 18.04.
Example breakage:
https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2091#ad491a93-0152-4a50-a363-876f1318cb59
WARNING: java.io.IOException: No such file or directory
--
| Compiling module io.bazel.sample.SampleApp
| [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User'
Maybe something related to java version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.