Coder Social home page Coder Social logo

Comments (21)

songzhiy avatar songzhiy commented on July 28, 2024 1

OK, I know what you mean.
I try to fix docker first. If I meet kotlin compiler problem again then add some info.

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024 1

Hey, friend, I have solved this problem by your advise. Thanks!
First, I try to revert script to --mount type=bind,source=/home/${USERNAME}/.cache/bazel,target=/home/${USERNAME}/.cache/bazel \ , but docker tell me the path is not exist!
So I have to solve MacOs /home path.
MacOs /home path cant create files under normal. But you can use this to solve it.
`
1、sudo vim /etc/auto_master

2、annotate /home code. such as

#/home auto_home -nobrowse,hidefromfinder

3、sudo automount
`

Then you can mkdir in /home.
But when I run rundevmode.sh, docker also tell me the path not found!
My another friend let me to check docker's settings which can set FILE SHARING. When I add file sharing, every thing is all right!

Your another idea I dont try it now. But I think it also useful.
By the way, the script might be adduser --uid $UID -gid $GID --home /Users $UNAME

Thanks again in the end ! :)

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Let's keep our discussion here to help other developers experiencing similar problem.

I'm using

IntelliJ IDEA 2021.1.1 Preview (Ultimate Edition)
Build #IU-211.7142.13, built on April 21, 2021
Kotlin: 211-1.4.32-release-IJ7142.3

What is the compiler error message?

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

Sorry, my environment has problem since last Friday. I have to retry it from step 1.
But now I cant step to last step.
I first repo android studio source code by
repo init -u https://android.googlesource.com/platform/manifest -b studio-4.2.0
( I see your repo script use studio-4.2.0 tag :) )
Then repo sync.
Then I step by step guide.
1、setup aosp_root environment.
2、run script:
sh ./rundevmode.sh
3、cd /aosp/src && sh /aosp/builder/patches/runpatches.sh
4、/aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts
When I step to build artifacts, I get some errors.

ERROR: /home/song/.cache/bazel/_bazel_song/325c777acdc528b97587554a77ea357b/external/protobuf_repo/BUILD:93:1: C++ compilation of rule '@protobuf_repo//:protobuf_lite' failed (Exit 1) src/main/tools/process-wrapper-legacy.cc:58: "execvp(external/native_toolchain/host/linux-x86/clang-r365631b/bin/clang, ...)": No such file or directory Target //tools/adt/idea/android:artifacts failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 52.154s, Critical Path: 1.25s INFO: 44 processes: 44 processwrapper-sandbox. FAILED: Build did NOT complete successfully
It seems that my ndk problem?
And this is my second time to retry it. Your readme says docker and the host has some shared directories. I dont know if it's because of the cache?

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

if it's because of the cache

Maybe. Maybe you invoked bazel from host machine and it downloaded mac toolchain instead of linux. It is not about NDK. It is about gcc/g++. Which files do you have inside [/home/song/.cache/bazel/_bazel_song/325c777acdc528b97587554a77ea357b/]external/native_toolchain/host? Try to remove .cache/bazel completely and start /aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts again.

Another suggestion is to use Linux as host, because I never tried these scripts on Mac.

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

Yeah! You are right!
Last Friday I build success because of I repo source code by docker.
But today my docker running on Mac always get error when I run script:
cd /aosp/src && sh /aosp/builder/scripts-vcs/runrepo.sh
So,I think can me avoid this script.

Which files do you have inside/home/song/.cache/bazel/_bazel_song/325c777acdc528b97587554a77ea357b/]external/native_toolchain/host
I show host is a substitute file and I choose show origin file. It tips me cant find origin file.

Try to remove .cache/bazel completely and start /aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts again.
This way I have try it. But not work.

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Ah. I see. Something wrong with your checkout. host is pointing to

lrwxrwxrwx 1 andrei andrei  49 мая  7 20:02 BUILD.bazel -> /aosp/src/tools/base/bazel/toolchains/clang.BUILD
lrwxrwxrwx 1 andrei andrei  30 мая  7 20:02 host -> /aosp/src/prebuilts/clang/host
lrwxrwxrwx 1 andrei andrei  38 мая  7 20:02 studio-extra -> /aosp/src/prebuilts/clang/studio-extra
-rw-rw-r-- 1 andrei andrei 121 мая  7 20:02 WORKSPACE

/aosp/src/prebuilts/clang/host is checked out from here: https://android.googlesource.com/platform/prebuilts/clang/host by repo tool

What kind of error does sh /aosp/builder/scripts-vcs/runrepo.sh return?

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

But when I run repo sync from MacOs terminal had not found error message.
I have /aosp/src/prebuilts/clang/host and /aosp/src/prebuilts/clang/studio-extra directories.
Your means that something wrong when pointing to? The reason has to do with MacOs?

What kind of error does sh /aosp/builder/scripts-vcs/runrepo.sh return?
erro[0149] error waiting for container: invalid character 'u' looking for beginning of value
Then the docker died... When I run script again. Docker tell me : Error response from daemon: Bad response from Docker engine #5283

I think the problem is not associated with your script.Because last Friday I had met. But when I tried it again. Succeed!
Today always get error :(
I try to use old docker version. But also failed.

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

repo checks out different repositories when checking out on different OS. See https://android.googlesource.com/platform/manifest/+/refs/tags/studio-4.2.0/default.xml#36 (lines 36-38).

  <project path="prebuilts/clang/host/darwin-x86" name="platform/prebuilts/clang/host/darwin-x86" clone-depth="1" groups="notdefault,platform-darwin" />
  <project path="prebuilts/clang/host/linux-x86" name="platform/prebuilts/clang/host/linux-x86" clone-depth="1" groups="notdefault,platform-linux" />
  <project path="prebuilts/clang/host/windows-x86" name="platform/prebuilts/clang/host/windows-x86" clone-depth="1" groups="notdefault,platform-windows" />

you need linux repositories (because later bazel will build on linux).

You can patch the XML, or checkout prebuilts/clang/host/linux-x86 repository manually, but if I was you, I'd first fixed docker, because it is absolutely needed for build anyway.

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

Here is the kotlin compile error:
Kotlin: [Internal Error] org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Failed to generate expression: KtProperty File being compiled: (13,3) in /Users/song/AndroidProject/studio-master-dev/tools/idea/platform/execution-impl/src/com/intellij/execution/impl/BeforeRunTaskHelper.kt The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$typeMappingConfiguration$1.processErrorType(KotlinTypeMapper.kt:122) at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:340) at org.jetbrains.kotlin.codegen.ExpressionCodegen.genStatement(ExpressionCodegen.java:465) at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1342) at org.jetbrains.kotlin.codegen.ExpressionCodegen.generateBlock(ExpressionCodegen.java:1287) at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:56) at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitBlockExpression(CodegenStatementVisitor.java:22) at org.jetbrains.kotlin.psi.KtBlockExpression.accept(KtBlockExpression.java:79) at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:316) at org.jetbrains.kotlin.codegen.ExpressionCodegen.genStatement(ExpressionCodegen.java:465) at org.jetbrains.kotlin.codegen.ExpressionCodegen.gen(ExpressionCodegen.java:422) at org.jetbrains.kotlin.codegen.ExpressionCodegen.returnExpression(ExpressionCodegen.java:1846) at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$FunctionDefault.doGenerateBody(FunctionGenerationStrategy.java:64) at org.jetbrains.kotlin.codegen.FunctionGenerationStrategy$CodegenBased.generateBody(FunctionGenerationStrategy.java:86) at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:649) at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethodBody(FunctionCodegen.java:484) at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:260) at org.jetbrains.kotlin.codegen.FunctionCodegen.generateMethod(FunctionCodegen.java:165) at org.jetbrains.kotlin.codegen.FunctionCodegen.gen(FunctionCodegen.java:136) at org.jetbrains.kotlin.codegen.MemberCodegen.genSimpleMember(MemberCodegen.java:197) at org.jetbrains.kotlin.codegen.PackagePartCodegen.generateBody(PackagePartCodegen.java:98) at org.jetbrains.kotlin.codegen.MemberCodegen.generate(MemberCodegen.java:129) at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generateFile(PackageCodegenImpl.java:149) at org.jetbrains.kotlin.codegen.PackageCodegenImpl.generate(PackageCodegenImpl.java:70) at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generatePackage(CodegenFactory.kt:77) at org.jetbrains.kotlin.codegen.DefaultCodegenFactory.generateModule(CodegenFactory.kt:62) at org.jetbrains.kotlin.codegen.KotlinCodegenFacade.compileCorrectFiles(KotlinCodegenFacade.java:35) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.generate(KotlinToJVMBytecodeCompiler.kt:595) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:211) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:154) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1500) at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Error type encountered: [ERROR : <LOOP IN SUPERTYPES>] (ErrorType). at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$typeMappingConfiguration$1.processErrorType(KotlinTypeMapper.kt:122) at org.jetbrains.kotlin.load.kotlin.DescriptorBasedTypeSignatureMappingKt.mapType(descriptorBasedTypeSignatureMapping.kt:83) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.mapType(KotlinTypeMapper.kt:274) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$writeGenericArguments$1$1.invoke(KotlinTypeMapper.kt:365) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$writeGenericArguments$1$1.invoke(KotlinTypeMapper.kt:364) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$Companion.writeGenericArguments(KotlinTypeMapper.kt:1523) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericArguments(KotlinTypeMapper.kt:364) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericArguments(KotlinTypeMapper.kt:354) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericType(KotlinTypeMapper.kt:307) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.access$writeGenericType(KotlinTypeMapper.kt:83) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$mapType$1.invoke(KotlinTypeMapper.kt:277) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$mapType$1.invoke(KotlinTypeMapper.kt:276) at org.jetbrains.kotlin.load.kotlin.DescriptorBasedTypeSignatureMappingKt.mapType(descriptorBasedTypeSignatureMapping.kt:145) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.mapType(KotlinTypeMapper.kt:274) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$writeGenericArguments$1$1.invoke(KotlinTypeMapper.kt:365) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$writeGenericArguments$1$1.invoke(KotlinTypeMapper.kt:364) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$Companion.writeGenericArguments(KotlinTypeMapper.kt:1523) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericArguments(KotlinTypeMapper.kt:364) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericArguments(KotlinTypeMapper.kt:354) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.writeGenericType(KotlinTypeMapper.kt:307) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.access$writeGenericType(KotlinTypeMapper.kt:83) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$mapType$1.invoke(KotlinTypeMapper.kt:277) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper$mapType$1.invoke(KotlinTypeMapper.kt:276) at org.jetbrains.kotlin.load.kotlin.DescriptorBasedTypeSignatureMappingKt.mapType(descriptorBasedTypeSignatureMapping.kt:145) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.mapType(KotlinTypeMapper.kt:274) at org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.mapTypeArgument(KotlinTypeMapper.kt:228) at org.jetbrains.kotlin.codegen.ExpressionCodegen.getOrCreateCallGenerator(ExpressionCodegen.java:2959) at org.jetbrains.kotlin.codegen.ExpressionCodegen.getOrCreateCallGenerator(ExpressionCodegen.java:2940) at org.jetbrains.kotlin.codegen.ExpressionCodegen.invokeMethodWithArguments(ExpressionCodegen.java:2705) at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:42) at org.jetbrains.kotlin.codegen.Callable$invokeMethodWithArguments$1.invoke(Callable.kt:41) at org.jetbrains.kotlin.codegen.OperationStackValue.putSelector(StackValue.kt:79) at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:125) at org.jetbrains.kotlin.codegen.StackValue.put(StackValue.java:118) at org.jetbrains.kotlin.codegen.ExpressionCodegen.initializeLocalVariable(ExpressionCodegen.java:4658) at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitProperty(ExpressionCodegen.java:4526) at org.jetbrains.kotlin.codegen.ExpressionCodegen.visitProperty(ExpressionCodegen.java:119) at org.jetbrains.kotlin.psi.KtProperty.accept(KtProperty.java:58) at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitKtElement(CodegenStatementVisitor.java:31) at org.jetbrains.kotlin.codegen.CodegenStatementVisitor.visitKtElement(CodegenStatementVisitor.java:22) at org.jetbrains.kotlin.psi.KtVisitor.visitExpression(KtVisitor.java:182) at org.jetbrains.kotlin.psi.KtVisitor.visitDeclaration(KtVisitor.java:29) at org.jetbrains.kotlin.psi.KtVisitor.visitNamedDeclaration(KtVisitor.java:398) at org.jetbrains.kotlin.psi.KtVisitor.visitProperty(KtVisitor.java:57) at org.jetbrains.kotlin.psi.KtProperty.accept(KtProperty.java:58) at org.jetbrains.kotlin.codegen.ExpressionCodegen.genQualified(ExpressionCodegen.java:316) ... 50 more
I am using:
`
IntelliJ IDEA 2021.1.1 (Community Edition)
Build #IC-211.7142.45, built on April 30, 2021
Runtime version: 11.0.10+9-b1341.41 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 12

Kotlin: 211-1.4.32-release-IJ7142.27
`

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

I can annotate some code that make kotlin compiler problem gone.
But I meet another problem. This problem I had met on last Friday.
When I use IntelliJ 2020 version,It also report this problem.
import androidx.work.inspection.WorkManagerInspectorProtocol import androidx.work.inspection.WorkManagerInspectorProtocol.Command import androidx.work.inspection.WorkManagerInspectorProtocol.Event import androidx.work.inspection.WorkManagerInspectorProtocol.TrackWorkManagerCommand import androidx.work.inspection.WorkManagerInspectorProtocol.WorkInfo import androidx.work.inspection.WorkManagerInspectorProtocol.WorkUpdatedEvent /Users/song/AndroidProject/studio-master-dev/tools/adt/idea/app-inspection/inspectors/workmanager/model/src/com/android/tools/idea/appinspection/inspectors/workmanager/model/WorkManagerInspectorClient.kt:18:8 Kotlin: Unresolved reference: androidx

I found /Users/song/AndroidProject/studio-master-dev/tools/adt/idea/app-inspection/inspectors/workmanager/model/BUILD use
java_import( name = "unb.workmanager-inspector-proto", jars = ["//prebuilts/tools/common/app-inspection/androidx/work:workmanager_inspector_proto.jar"], tags = [ "manual", "unb", ], visibility = ["//visibility:public"], )
But I cant found the jar in that directory(prebuilts/tools/common/app-inspection/androidx/work),only have a workmanager-inspection.jar

Last Friday, I want to solve this problem.But failed. And environment was destroyed by me :(

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Kotlin: [Internal Error] is known bug in kotlin compiler itself. Just click Build > Build Project in IDEA (not Build > Rebuild Project) and hope that it will work this time.

workmanager_inspector_proto.jar is generated artifact. It should have been generated by

/aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts

Its full filename is $AOSP_ROOT/bazel-bin/prebuilts/tools/common/app-inspection/androidx/work/workmanager_inspector_proto.jar (note bazel-bin directory)

Probably, bazel build have not succeeded (or you have some problems with files sharing between host and docker)?

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

You can go to project structure and check if IDEA sees the jar
image

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

It seems that file sharing between host and docker...
image

I try to open bazel-in origin file. But failed. Show me cant find it's origin file.

cd /aosp/src && /aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts
This script I cant find error message. Why share failed?

This is my rundevmode.sh script:
`
set -ex

: "${AOSP_ROOT:?Need to set AOSP root directory (e.g. 'export AOSP_ROOT=/home/open/projects/studio-master-dev')}"

GROUPNAME=id -gn
GROUPID=id -g
USERID=id -u
MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
USERNAME="song"

echo "sh /aosp/builder/dev-local/setuplocaluser.sh $USERID $GROUPID $USERNAME $GROUPNAME" > $MYDIR/dev-local/setuplocaluserinvoker.sh

docker build --target builder-dev -t androidstudio-builder-dev:latest .

docker run -it --name rundevmode --rm
--mount type=bind,source=$AOSP_ROOT,target=/aosp/src
--mount type=bind,source=$MYDIR,target=/aosp/builder
--mount type=bind,source=/Users/${USERNAME}/.cache/bazel,target=/home/${USERNAME}/.cache/bazel
--mount type=bind,source=/Users/${USERNAME}/.m2,target=/home/${USERNAME}/.m2
--mount type=bind,source=/Users/${USERNAME}/.gradle,target=/home/${USERNAME}/.gradle
androidstudio-builder-dev:latest
`
I just add username and change file path. In docker home/song/.cache/bazel also has files.

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

So the problem is AOSP_ROOT/bazel-bin 、 bazel-out 、 bazel-src are not normal.
But I dont know how to fix it.

Add some info:
INFO: From Executing genrule //prebuilts/tools/common/app-inspection/androidx/work:java_jarjar_workmanager_inspector_proto: [main] INFO com.tonicsystems.jarjar.transform.JarTransformer - Transforming archive ZipArchive(/home/song/.cache/bazel/_bazel_song/325c777acdc528b97587554a77ea357b/sandbox/processwrapper-sandbox/3766/execroot/__main__/bazel-out/k8-fastbuild/bin/prebuilts/tools/common/app-inspection/androidx/work/lib_workmanager_inspector_proto_internal.jar)

`
Target //tools/adt/idea/android:artifacts up-to-date:

bazel-bin/tools/adt/idea/android/libandroid-core-proto.jar

bazel-bin/tools/base/deploy/installer/android-installer/test-installer

bazel-bin/tools/base/deploy/installer/android-installer/x86/installer

bazel-bin/tools/base/deploy/installer/android-installer/x86_64/installer

bazel-bin/tools/base/deploy/installer/android-installer/armeabi-v7a/installer

bazel-bin/tools/base/deploy/installer/android-installer/arm64-v8a/installer

bazel-bin/tools/base/deploy/installer/tests/fake_app

bazel-bin/tools/base/deploy/installer/tests/fake_device_proto.jar

bazel-bin/tools/base/deploy/installer/tests/fake_runas

bazel-bin/tools/base/deploy/installer/tests/fake_shell

bazel-bin/tools/base/deploy/proto/deploy_java_proto.jar

bazel-bin/tools/base/deploy/deployer/libjava_version.jar

bazel-bin/tools/base/profiler/perfetto-protos.jar

bazel-bin/tools/base/profiler/app/perfa.jar

bazel-bin/tools/base/profiler/app/perfa_okhttp.dex

bazel-bin/tools/base/profiler/native/trace_processor_daemon/traceprocessor_protos.jar

bazel-bin/tools/base/profiler/transform/profilers-transform.jar

bazel-bin/tools/base/transport/android/x86/transport

bazel-bin/tools/base/transport/android/armeabi-v7a/transport

bazel-bin/tools/base/transport/android/arm64-v8a/transport

bazel-bin/tools/base/transport/native/agent/android/x86/libjvmtiagent.so

bazel-bin/tools/base/transport/native/agent/android/x86_64/libjvmtiagent.so

bazel-bin/tools/base/transport/native/agent/android/armeabi-v7a/libjvmtiagent.so

bazel-bin/tools/base/transport/native/agent/android/arm64-v8a/libjvmtiagent.so

bazel-bin/tools/base/transport/proto/transport_java_proto.jar

bazel-bin/prebuilts/tools/common/app-inspection/androidx/sqlite/sqlite_inspector_proto.jar

bazel-bin/prebuilts/tools/common/app-inspection/androidx/work/workmanager_inspector_proto.jar

bazel-bin/tools/adt/idea/swingp/swing-instrumenter_deploy.jarjar.jar

bazel-bin/tools/analytics-library/protos/src/main/proto/libstudio.proto.jar

bazel-bin/tools/base/bazel/studio-grpc.jar

bazel-bin/tools/base/bazel/studio-proto.jar

bazel-bin/tools/base/build-system/gradle-api_neverlink.jar

bazel-bin/tools/base/ddmlib/libam-instrumentation-data-proto.jar

bazel-bin/tools/base/dynamic-layout-inspector/proto/layout_inspector_java_proto.jar

bazel-bin/tools/base/emulator/proto/emulator_java_proto.jar

bazel-bin/tools/base/game-tools/protos/game-tools-protos.jar

bazel-bin/tools/base/sdk-common/aia-manifest-jar-generator/proto.jar

bazel-bin/tools/base/third_party/kotlin/kotlin-m2repository.zip

bazel-bin/tools/base/tracer/trace_agent.jar

bazel-bin/tools/adt/idea/bleak/src/com/android/tools/idea/bleak/agents/libjnibleakhelper.a

bazel-bin/tools/adt/idea/bleak/src/com/android/tools/idea/bleak/agents/libjnibleakhelper.so

INFO: Elapsed time: 351.056s, Critical Path: 96.53s

INFO: 82 processes: 73 local, 8 processwrapper-sandbox, 1 worker.

INFO: Build completed successfully, 88 total actions
`
It seems build success?

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

Oh, When I run /aosp/src/tools/base/bazel/bazel build //tools/adt/idea/android:artifacts I got an error:
Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/home/song/.cache/bazel/_bazel_song/325c777acdc528b97587554a77ea357b/server/jvm.out')
I think this error is docker server's problem.And it has cache.So I retried it. Then build successful. This is why bazel failed?

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

Hey, friend~
I found these files in docker are exists!
So that means share files from docker to macOs is failed.
Only host(macOs) cant find these files.

`
song@bb6ca7c4fe7f:/aosp/src/bazel-bin/prebuilts/tools/common/app-inspection/androidx/work$ ls

_javac

lib_workmanager_inspector_proto_internal.jar-1.params

_workmanager_inspector_proto_internal_srcs.srcjar

lib_workmanager_inspector_proto_internal.jar_manifest_proto

_workmanager_inspector_proto_internal_srcs.srcjar.jar

lib_workmanager_inspector_proto_internal.jdeps

lib_workmanager_inspector_proto_internal-native-header.jar

workmanager_inspector_proto.jar

lib_workmanager_inspector_proto_internal.jar

workmanager_protocol.proto

lib_workmanager_inspector_proto_internal.jar-0.params
`

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Probably, this line should be adjusted to work on Mac:

--mount type=bind,source=/home/${USERNAME}/.cache/bazel,target=/home/${USERNAME}/.cache/bazel \

see https://github.com/andrei-kuznetsov/android-studio-builder/blob/c34cceaca09bd528cf3f10da3c5982f17bd463a1/rundevmode.sh#L17

It publishes bazel caches (that also contain build outputs) from docker to host.

You adjusted it as

--mount type=bind,source=/Users/${USERNAME}/.cache/bazel,target=/home/${USERNAME}/.cache/bazel

But bazel on linux created symlink

bazel-bin -> /home/${USERNAME}/.cache/bazel/_bazel_${USERNAME}/325c777acdc528b97587554a77ea357b/execroot/__main__/bazel-out/k8-fastbuild/bin

Which obviously points to right place in docker, but points to nowhere on mac

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Try to revert your changes. Just create folder on Mac /home/${USERNAME}/.cache/bazel. Files layout should be the same in docker and on host, otherwise symlinks will fail.

from android-studio-builder-1.

songzhiy avatar songzhiy commented on July 28, 2024

OK,I will try it~

from android-studio-builder-1.

andrei-kuznetsov avatar andrei-kuznetsov commented on July 28, 2024

Another idea: when creating a user in docker, you can specify its home directory to match one you have on Mac. See https://github.com/andrei-kuznetsov/android-studio-builder/blob/c34cceaca09bd528cf3f10da3c5982f17bd463a1/dev-local/setuplocaluser.sh#L14

E.g. add --home and something like this:

useradd -u $UID -g $GID --home <home/directory/path> $UNAME

from android-studio-builder-1.

Related Issues (6)

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.