Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

tinkey commandline compile issues / bazel 0.16 and 0.17 / centos 7 / Oracle java 8 #131

Closed
smumey opened this issue Sep 19, 2018 · 4 comments

Comments

@smumey
Copy link

smumey commented Sep 19, 2018

I had issues with compiling tinkey with recent versions of bazel. For bazel 0.16.2 the javax.crypto package was not available (bazelbuild/bazel#5726); I was also unable to build with 0.17.1 which should have addressed this issue, but the build failed with a different error. See error output below. Note the bazel 0.16.2 run includes an attempt to 'fix' the bootclasspath, but fails with the same error without the bootclasspath argument.

I was able to build tinkey by reverting to bazel 0.15.2.

bazel 0.16.2

$ bazel build "--javacopt=-Xbootclasspath:/usr/java/jdk1.8.0_172-amd64/jre/lib/rt.jar:/usr/java/jdk1.8.0_172-amd64/jre/lib/jce.jar" tools/tinkey/...
INFO: Build options have changed, discarding analysis cache.
INFO: Analysed 7 targets (0 packages loaded).
INFO: Found 7 targets...
ERROR: /space/smumey/projects/examples/tink/java/src/main/java/com/google/crypto/tink/subtle/BUILD.bazel:18:1: Building java/src/main/java/com/google/crypto/tink/subtle/libsubtle.jar (11 source files) failed (Exit 1)
java/src/main/java/com/google/crypto/tink/subtle/EllipticCurves.java:38: error: package javax.crypto does not exist
import javax.crypto.KeyAgreement;
                   ^
java/src/main/java/com/google/crypto/tink/subtle/EngineFactory.java:29: error: package javax.crypto does not exist
import javax.crypto.Cipher;
                   ^
java/src/main/java/com/google/crypto/tink/subtle/EngineFactory.java:30: error: package javax.crypto does not exist
import javax.crypto.KeyAgreement;
...

bazel 0.17.1

$ bazel build tools/tinkey/...
INFO: Analysed 7 targets (72 packages loaded).
INFO: Found 7 targets...
ERROR: /space/smumey/projects/examples/tink/java/src/main/java/com/google/crypto/tink/util/BUILD.bazel:16:1: Building java/src/main/java/com/google/crypto/tink/util/libutil.jar (1 source file) failed: Worker process returned an unparseable WorkResponse!

Did you try to print something to stdout? Workers aren't allowed to do this, as it breaks the protocol between Bazel and the worker process.

---8<---8<--- Exception details ---8<---8<---
com.google.protobuf.InvalidProtocolBufferException$InvalidWireTypeException: Protocol message tag had invalid wire type.
	at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:115)
	at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:551)
	at com.google.protobuf.GeneratedMessageV3.parseUnknownFieldProto3(GeneratedMessageV3.java:305)
	at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse.<init>(WorkerProtocol.java:1936)
	at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse.<init>(WorkerProtocol.java:1886)
	at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse$1.parsePartialFrom(WorkerProtocol.java:2503)
	at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse$1.parsePartialFrom(WorkerProtocol.java:2497)
	at com.google.protobuf.AbstractParser.parsePartialFrom(AbstractParser.java:221)
	at com.google.protobuf.AbstractParser.parsePartialDelimitedFrom(AbstractParser.java:262)
	at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:275)
	at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:280)
	at com.google.protobuf.AbstractParser.parseDelimitedFrom(AbstractParser.java:49)
	at com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(GeneratedMessageV3.java:347)
	at com.google.devtools.build.lib.worker.WorkerProtocol$WorkResponse.parseDelimitedFrom(WorkerProtocol.java:2145)
	at com.google.devtools.build.lib.worker.WorkerSpawnRunner.execInWorker(WorkerSpawnRunner.java:329)
	at com.google.devtools.build.lib.worker.WorkerSpawnRunner.actuallyExec(WorkerSpawnRunner.java:159)
	at com.google.devtools.build.lib.worker.WorkerSpawnRunner.exec(WorkerSpawnRunner.java:115)
	at com.google.devtools.build.lib.exec.AbstractSpawnStrategy.exec(AbstractSpawnStrategy.java:107)
	at com.google.devtools.build.lib.exec.AbstractSpawnStrategy.exec(AbstractSpawnStrategy.java:75)
	at com.google.devtools.build.lib.exec.SpawnActionContextMaps$ProxySpawnActionContext.exec(SpawnActionContextMaps.java:362)`
	at com.google.devtools.build.lib.analysis.actions.SpawnAction.internalExecute(SpawnAction.java:288)
	at com.google.devtools.build.lib.analysis.actions.SpawnAction.execute(SpawnAction.java:295)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeActionTask(SkyframeActionExecutor.java:971)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.prepareScheduleExecuteAndCompleteAction(SkyframeActionExecutor.java:900)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.access$800(SkyframeActionExecutor.java:118)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:744)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:699)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:459)
	at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:505)
	at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:215)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
---8<---8<--- End of exception details ---8<---8<---

---8<---8<--- Start of log ---8<---8<---
-Xbootclasspath/p is no longer a supported option.
ion.
---8<---8<--- End of log ---8<---8<---
INFO: Elapsed time: 11.964s, Critical Path: 3.01s
INFO: 50 processes: 50 processwrapper-sandbox.
FAILED: Build did NOT complete successfully
@thaidn
Copy link
Contributor

thaidn commented Sep 21, 2018

We haven't touched Tinkey for a while, so this looks like a bug in Bazel.

The error message is "-Xbootclasspath/p is no longer a supported option", so it seems that this is Java being upset with Bazel.

Which Java version are you using?

@smumey
Copy link
Author

smumey commented Sep 21, 2018

I am using Java 8:
java version "1.8.0_172" Java(TM) SE Runtime Environment (build 1.8.0_172-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
I think the bug in the first case (Bazel 0.16.2) is with Bazel, but for 0.17.1, I'm not sure whether it's a case of the build file syntax changing or a bug with Bazel itself. Not being familiar with Bazel, it took me a fair bit of time to successfully buld tinkey.

@thaidn
Copy link
Contributor

thaidn commented Oct 4, 2018

I tried with 0.17.2 and encountered an issue similar to
bazelbuild/bazel#5997
bazelbuild/bazel#5594

I'm fixing it, and it looks like everything works fine again.

thaidn added a commit that referenced this issue Oct 4, 2018
…est).

Kokoro hasn't failed because its macOS and Ubuntu machines are using old Bazel versions.

Related issues:
#131
#136
bazelbuild/bazel#5997
bazelbuild/bazel#5594

PiperOrigin-RevId: 215787620
GitOrigin-RevId: 7b978f1374938e4b839f8357fc50d36b7ab96be5
@thaidn
Copy link
Contributor

thaidn commented Oct 4, 2018

Bazel 0.17.2 should work fine.

Please reopen if you still have any issues. Thanks!

@thaidn thaidn closed this as completed Oct 4, 2018
chuckx pushed a commit that referenced this issue Oct 10, 2018
…est).

Kokoro hasn't failed because its macOS and Ubuntu machines are using old Bazel versions.

Related issues:
#131
#136
bazelbuild/bazel#5997
bazelbuild/bazel#5594

PiperOrigin-RevId: 215787620
GitOrigin-RevId: 7b978f1374938e4b839f8357fc50d36b7ab96be5
chuckx pushed a commit that referenced this issue Oct 12, 2018
…est).

Kokoro hasn't failed because its macOS and Ubuntu machines are using old Bazel versions.

Related issues:
#131
#136
bazelbuild/bazel#5997
bazelbuild/bazel#5594

PiperOrigin-RevId: 215787620
GitOrigin-RevId: 7b978f1374938e4b839f8357fc50d36b7ab96be5
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants