Giter Club home page Giter Club logo

Comments (9)

niloc132 avatar niloc132 commented on May 18, 2024

I'm not sure about that specific error, but I do see you are using 0.18.1, and as of the first public release of j2cl the latest was 0.19.1 (current is 0.19.2), and in my experience j2cl almost always needs the latest version of bazel.

from j2cl.

jDramaix avatar jDramaix commented on May 18, 2024

Yes you need at least bazel 0.19.0. Could you try with an updated version of bazel? Thnaks

from j2cl.

dvekeman avatar dvekeman commented on May 18, 2024

Same result, slightly different output (maybe because I removed the out folders using git clean)

bazel shutdown 
rm -rf /private/var/tmp/_bazel_dvekeman
git clean -fdx
helloworld (master) $ bazel version && bazel build --verbose_failures src/main/java/com/google/j2cl/samples/helloworld:helloworld
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Build label: 0.19.2
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Nov 19 16:24:08 2018 (1542644648)
Build timestamp: 1542644648
Build timestamp as int: 1542644648
INFO: SHA256 (https://github.com/google/j2cl/archive/master.zip) = 6838b90443e9e8299ce55b47e57facb2a746120aed3c7c4eb88c8f9551e8fc86
INFO: SHA256 (https://github.com/bazelbuild/rules_closure/archive/master.zip) = 9ada09e1a4d6ed349e56f5969e19d60bee3c94bcaf5f3a0172fb3f443119c2be
INFO: SHA256 (https://github.com/google/protobuf/archive/v3.6.1.zip) = d7a221b3d4fb4f05b7473795ccea9e05dab3b8721f6286a95fffbffc2d926f8b
INFO: SHA256 (https://gwt.googlesource.com/gwt/+archive/master.tar.gz) = bcbd3b60436f7bf2ef9dcc4971a7b0b0504d6ef685502e868f8da62719f1c1d3
INFO: Analysed target //src/main/java/com/google/j2cl/samples/helloworld:helloworld (85 packages loaded, 1793 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_dvekeman/5beb477a3151b2f6be589952cc7c0456/external/com_google_protobuf/BUILD:70:1: undeclared inclusion(s) in rule '@com_google_protobuf//:protobuf_lite':
this rule is missing dependency declarations for the following files included by 'external/com_google_protobuf/src/google/protobuf/stubs/statusor.cc':
  '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h'
...
  '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_types/_os_inline.h'
  '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/math.h'
INFO: Elapsed time: 25,746s, Critical Path: 1,24s, Remote (0,00% of the time): [queue: 0,00%, setup: 0,00%, process: 0,00%]
INFO: 4 processes: 4 local.
FAILED: Build did NOT complete successfully

from j2cl.

gkdn avatar gkdn commented on May 18, 2024

Cannot reproduce this on my mac on bazel 0.19 nor 0.20. My guess is you are stuck to a bad version of a library.
Could you try bazel sync?

from j2cl.

dvekeman avatar dvekeman commented on May 18, 2024

I will try this on another mac later tonight too.

bazel sync

(assuming I have to run it in the helloworld directory)

helloworld (master) $ bazel sync
WARNING: Switched off --watchfs again... temporarily falling back to manually checking files for changes
INFO: SHA256 (https://github.com/google/j2cl/archive/master.zip) = 8891d851eb916d2daade94953cce45024e01ee4fc012b31d991bc8e36324b292
INFO: SHA256 (https://github.com/bazelbuild/rules_closure/archive/master.zip) = 9ada09e1a4d6ed349e56f5969e19d60bee3c94bcaf5f3a0172fb3f443119c2be
INFO: SHA256 (https://github.com/google/protobuf/archive/v3.6.1.zip) = d7a221b3d4fb4f05b7473795ccea9e05dab3b8721f6286a95fffbffc2d926f8b
INFO: SHA256 (https://gwt.googlesource.com/gwt/+archive/master.tar.gz) = 55562a37c7cab3a14dcf1aad7807119ba1baabdfc04ac28970e730bbe78e29e0

But no luck, same error. I do notice that the message varies, sometimes it's java_doc_comment.cc, sometimes statusor.cc.

My guess is you are stuck to a bad version of a library.

Any suggestions where to look?

Inside bazel:
./third_party/protobuf/3.6.1/src/google/protobuf/compiler/java/java_doc_comment.cc

#include <google/protobuf/compiler/java/java_doc_comment.h>

Should I have installed protocolbuffers? (apologies if I overlooked this in the guides somewhere).

I did (just) download, compiled and installed them. It did install a lot in /usr/local/include/google/protobuf/ however - for example - not the java_doc_comment.h.

$ ll /usr/local/include/google/protobuf/compiler/java
total 16
-rw-r--r--  1 root  staff  2945 Dec  4 17:58 java_generator.h
-rw-r--r--  1 root  staff  2931 Dec  4 17:58 java_names.h

Or am I on the wrong path now?

from j2cl.

niloc132 avatar niloc132 commented on May 18, 2024

Installing protobufs directly should not be required - bazel will grab the copy it needs.

I did end up running into odd XCode issues this weekend, but they were "resolved" by running bazel clean --expunge, forcing bazel to re-download and build each dependency. Ended up having to do this about once an hour as and when other things went wrong, will give bazel sync a try next time.

from j2cl.

dvekeman avatar dvekeman commented on May 18, 2024

I tried it from another computer. I'm getting a different error (can't judge whether I got past the previous error or not). This time I installed bazel using the bazel-0.20.0-installer-darwin-x86_64.sh

This error looks more like a temporary glitch (I do also get a 502 in the browser for this jar)

ERROR: java.io.IOException: Error downloading [http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/plugins/org.eclipse.jdt.core_3.14.0.v20180528-0519.jar]
helloworld dvekeman$ bazel clean --expunge && bazel sync && bazel build src/main/java/com/google/j2cl/samples/helloworld:helloworld
INFO: Invocation ID: fb1afddf-6547-41bc-8b62-39fc16c509c0
INFO: Starting clean.
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 52de440c-3901-4ad7-b98c-bcb580d71a91
INFO: SHA256 (https://github.com/google/j2cl/archive/master.zip) = 3829b46d7ece5052c210340264b407934aa32cf7bb112b1bb4fcf6ae3c982203
INFO: SHA256 (https://github.com/bazelbuild/rules_closure/archive/master.zip) = 9ada09e1a4d6ed349e56f5969e19d60bee3c94bcaf5f3a0172fb3f443119c2be
INFO: SHA256 (https://github.com/google/protobuf/archive/v3.6.1.zip) = d7a221b3d4fb4f05b7473795ccea9e05dab3b8721f6286a95fffbffc2d926f8b
INFO: SHA256 (https://gwt.googlesource.com/gwt/+archive/master.tar.gz) = cabc54ed63f3d38811bb07659171cb83f987533c6355639ae5fcd14820592304
ERROR: java.io.IOException: Error downloading [http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/plugins/org.eclipse.jdt.core_3.14.0.v20180528-0519.jar] to /private/var/tmp/_bazel_dvekeman/5beb477a3151b2f6be589952cc7c0456/external/org_eclipse_jdt_core/jar/downloaded.jar: GET returned 502 Bad Gateway
Building: no action
    Fetching @org_eclipse_jdt_core; fetching 110s

from j2cl.

dvekeman avatar dvekeman commented on May 18, 2024

I tried it from another computer. I'm getting a different error
The HTTP 502 was indeed a temporary glitch. It worked now

bazel clean --expunge && bazel sync && bazel build src/main/java/com/google/j2cl/samples/helloworld:helloworld
...
INFO: Elapsed time: 173,698s, Critical Path: 120,31s
INFO: 570 processes: 525 local, 45 worker.
INFO: Build completed successfully, 593 total actions
bazel version
INFO: Invocation ID: 090e555b-bd9d-47ab-a74d-7b122285a6d6
Build label: 0.20.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Nov 30 14:38:25 2018 (1543588705)
Build timestamp: 1543588705
Build timestamp as int: 1543588705

So there must indeed be something interfering on my other computer.

from j2cl.

ayyar avatar ayyar commented on May 18, 2024

Doing a clean worked for me.

bazel clean

from j2cl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.