Skip to content
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

Bazel internal compile error #2268

Closed
vit1251 opened this issue Oct 7, 2022 · 6 comments
Closed

Bazel internal compile error #2268

vit1251 opened this issue Oct 7, 2022 · 6 comments

Comments

@vit1251
Copy link

vit1251 commented Oct 7, 2022

Description of the bug:

FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.NoClassDefFoundError: Could not initialize class com.google.devtools.build.lib.unsafe.StringUnsafe
        at com.google.devtools.build.lib.actions.ParameterFile.writeContent(ParameterFile.java:118)
        at com.google.devtools.build.lib.actions.ParameterFile.writeParameterFile(ParameterFile.java:111)
        at com.google.devtools.build.lib.analysis.actions.ParameterFileWriteAction$ParamFileWriter.writeOutputFile(ParameterFileWriteAction.java:170)
        at com.google.devtools.build.lib.exec.FileWriteStrategy.beginWriteOutputToFile(FileWriteStrategy.java:58)
        at com.google.devtools.build.lib.analysis.actions.FileWriteActionContext.beginWriteOutputToFile(FileWriteActionContext.java:49)
        at com.google.devtools.build.lib.analysis.actions.AbstractFileWriteAction.beginExecution(AbstractFileWriteAction.java:66)
        at com.google.devtools.build.lib.actions.Action.execute(Action.java:133)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$5.execute(SkyframeActionExecutor.java:907)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.continueAction(SkyframeActionExecutor.java:1076)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.run(SkyframeActionExecutor.java:1031)
        at com.google.devtools.build.lib.skyframe.ActionExecutionState.runStateMachine(ActionExecutionState.java:152)
        at com.google.devtools.build.lib.skyframe.ActionExecutionState.getResultOrDependOnFuture(ActionExecutionState.java:91)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:492)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:856)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.computeInternal(ActionExecutionFunction.java:349)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:169)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:590)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(byte[],byte) accessible: module java.base does not "opens java.lang" to unnamed module @6ca8564a [in thread "skyframe-evaluator 13"]
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:191)
        at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:184)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.<init>(StringUnsafe.java:75)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.initInstance(StringUnsafe.java:56)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.<clinit>(StringUnsafe.java:37)
        ... 21 more

What did you do, or what's a simple way to reproduce the bug?

$ git clone
$ bazel ...

What did you expect to happen?

Provide transaltor of Carbon

What actually happened?

Java exception ... output

Any other information, logs, or outputs that you want to share?

Any idea to use mezon or CMake instead some unusual for C world builder system

@jonmeow
Copy link
Contributor

jonmeow commented Oct 7, 2022

Sorry, we can't help you with bazel issues. If you'd like to file an issue with them, please report it at:
https://github.com/bazelbuild/bazel/issues/new?assignees=&labels=&template=bug_report.yml

Note, you should be using something like bazel 5.1.1 or 5.3.1. Can you please confirm you have a recent version with bazel version?

Also, it should be bazel build //explorer/... or similar, not bazel ...

@vit1251
Copy link
Author

vit1251 commented Oct 18, 2022

I use modern version bazel

Build label: 5.3.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Sep 21 14:59:28 2022 (1663772368)
Build timestamp: 1663772368
Build timestamp as int: 1663772368

But any reason to use Java toolchain to compile C ecosystem language. Most popular C/C++ toolcains is GMake, CMake and meson instead use Java or another one third party dependencies.

@vit1251
Copy link
Author

vit1251 commented Oct 18, 2022

Also I already use bazel build //explorer/...

$ bazel build //explorer/...
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 6f16fe52-e33c-4450-98ff-99a2f313ae36
INFO: Analyzed 597 targets (106 packages loaded, 4403 targets configured).
INFO: Found 597 targets...
[0 / 341] [Prepa] Creating source manifest for //explorer:gen_rtti [for host]
FATAL: bazel crashed due to an internal error. Printing stack trace:
java.lang.ExceptionInInitializerError
        at com.google.devtools.build.lib.actions.ParameterFile.writeContent(ParameterFile.java:118)
        at com.google.devtools.build.lib.actions.ParameterFile.writeParameterFile(ParameterFile.java:111)
        at com.google.devtools.build.lib.analysis.actions.ParameterFileWriteAction$ParamFileWriter.writeOutputFile(ParameterFileWriteAction.java:170)
        at com.google.devtools.build.lib.exec.FileWriteStrategy.beginWriteOutputToFile(FileWriteStrategy.java:58)
        at com.google.devtools.build.lib.analysis.actions.FileWriteActionContext.beginWriteOutputToFile(FileWriteActionContext.java:49)
        at com.google.devtools.build.lib.analysis.actions.AbstractFileWriteAction.beginExecution(AbstractFileWriteAction.java:66)
        at com.google.devtools.build.lib.actions.Action.execute(Action.java:133)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$5.execute(SkyframeActionExecutor.java:907)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.continueAction(SkyframeActionExecutor.java:1076)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.run(SkyframeActionExecutor.java:1031)
        at com.google.devtools.build.lib.skyframe.ActionExecutionState.runStateMachine(ActionExecutionState.java:152)
        at com.google.devtools.build.lib.skyframe.ActionExecutionState.getResultOrDependOnFuture(ActionExecutionState.java:91)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:492)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:856)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.computeInternal(ActionExecutionFunction.java:349)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:169)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:590)
        at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:382)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(byte[],byte) accessible: module java.base does not "opens java.lang" to unnamed module @1817d444
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Constructor.checkCanSetAccessible(Constructor.java:191)
        at java.base/java.lang.reflect.Constructor.setAccessible(Constructor.java:184)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.<init>(StringUnsafe.java:75)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.initInstance(StringUnsafe.java:56)
        at com.google.devtools.build.lib.unsafe.StringUnsafe.<clinit>(StringUnsafe.java:37)
        ... 21 more

Second alert is using a 597 internal dependencies? Since carbon-lang require track of dependencies it does not be a replace an C++.

You conceptually right understand that C/C++ standart library require more common structures but carbon on current state is not well solution.

@jonmeow
Copy link
Contributor

jonmeow commented Oct 18, 2022

Thanks! I've reported your issue to the bazel project at bazelbuild/bazel#16502. Unfortunately, while I use a mix of macOS, Debian, and Ubuntu, I'm not reproducing your issue on those platforms so I can't offer more help. If you can provide more information (OS you're using, bazel info release, other information), please add it to that issue.

If you're interested in digging a little to try to make it work, you might try installing an older version of bazel, for example 5.2.0 which was noted on bazelbuild/bazel#14548 as having a similar issue fixed; even though you have a higher version number, bazel may have a regression.

Regarding build systems in general, I think you might find #1519 helpful. chandlerc has a couple comments about why we're using bazel there, such as #1519 (comment).

Would it make sense to close this issue?

@vit1251
Copy link
Author

vit1251 commented Oct 18, 2022

Would it make sense to close this issue?

I think that yes. But can I ask before do u have an AUR package for ArchLinux Linux distro?

@jonmeow
Copy link
Contributor

jonmeow commented Oct 19, 2022

Given Carbon's experimental status, Carbon is not currently distributing packages for any platform. Packages for platforms will be considered once Carbon is ready for use.

@jonmeow jonmeow closed this as completed Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants