Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
ugh, we are re-creating it to avoid a race condition in the database class loader. unfortunately if we re-use a tmp dir, it sometimes breaks.
maybe we can use a sub folder of the already defined tmp dir if we are not doing it.
maybe we can use a sub folder of the already defined tmp dir if we are not doing it.
da...@google.com <da...@google.com> #3
Since you are using kapt are you sure you are passing java.io.tmpdir to Kotlin's compiler daemon and not Gradle's?
For example: ./gradlew <gradle-params> -Dkotlin.daemon.jvm.options="-Djava.io.tmpdir=path/to/a/folder" <task>
For example: ./gradlew <gradle-params> -Dkotlin.daemon.jvm.options="-Djava.io.tmpdir=path/to/a/folder" <task>
ru...@gtempaccount.com <ru...@gtempaccount.com> #4
That fixed my problem.
I was not aware that kapt would run in a different daemon.
Thanks for the help.
I was not aware that kapt would run in a different daemon.
Thanks for the help.
da...@google.com <da...@google.com>
da...@gmail.com <da...@gmail.com> #5
Thank you very much for this thread - I have been struggling with this problem for some time now and was finally able to get the kaptDebugKotlin task to succeed.
However, our tests - namely the testDebugUnitTest task - are still failing with the same exception:
27-Aug-2019 11:08:53 com.example.tv.persistence.room.RoomEpgOfflineStorageTest > getSortedProgramsForChannelForDayDao FAILED
27-Aug-2019 11:08:53 java.lang.RuntimeException at RoomEpgOfflineStorageTest.kt:234
27-Aug-2019 11:08:53 Caused by: com.almworks.sqlite4java.SQLiteException at RoomEpgOfflineStorageTest.kt:234
27-Aug-2019 11:08:53 Caused by: java.lang.UnsatisfiedLinkError at RoomEpgOfflineStorageTest.kt:234
Is there any other option I need to use to pass the new tmpdir to the daemon that's running the tests?
This is the Gradle command that is currently used:
./gradlew --no-daemon --no-build-cache --stacktrace -Djava.io.tmpdir=/appl/bamboo/bamboo-agent-home-5/xml-data/build-dir/MP-AN6-JOB1/tmp -Dkotlin.daemon.jvm.options="-Djava.io.tmpdir=/appl/bamboo/bamboo-agent-home-5/xml-data/build-dir/MP-AN6-JOB1/tmp" clean :tv:testDebugUnitTest
However, our tests - namely the testDebugUnitTest task - are still failing with the same exception:
27-Aug-2019 11:08:53 com.example.tv.persistence.room.RoomEpgOfflineStorageTest > getSortedProgramsForChannelForDayDao FAILED
27-Aug-2019 11:08:53 java.lang.RuntimeException at RoomEpgOfflineStorageTest.kt:234
27-Aug-2019 11:08:53 Caused by: com.almworks.sqlite4java.SQLiteException at RoomEpgOfflineStorageTest.kt:234
27-Aug-2019 11:08:53 Caused by: java.lang.UnsatisfiedLinkError at RoomEpgOfflineStorageTest.kt:234
Is there any other option I need to use to pass the new tmpdir to the daemon that's running the tests?
This is the Gradle command that is currently used:
./gradlew --no-daemon --no-build-cache --stacktrace -Djava.io.tmpdir=/appl/bamboo/bamboo-agent-home-5/xml-data/build-dir/MP-AN6-JOB1/tmp -Dkotlin.daemon.jvm.options="-Djava.io.tmpdir=/appl/bamboo/bamboo-agent-home-5/xml-data/build-dir/MP-AN6-JOB1/tmp" clean :tv:testDebugUnitTest
Description
Version used: 1.1.1
Devices/Android versions reproduced on: N/A
I am trying to build my android project in a build server where the tmp directory has the noexec flag.
To avoid using the default /tmp directory I use -Djava.io.tmpdir="path-to-a-folder".
Problem:
Everything seems to use the new tmpdir I provided, however the room database folder created by DatabaseVerifier is being created on the /tmp, not respecting the java.io.tmpdir path that I set on the gradle command.
This leads to a similar issue as described here:
Please note that I am using kapt as the annotation processor.
All my files related to Room are implemented Kotlin.
I am not sure if this is an issue or if there is any flag I can send to change the tmp folder specifically for kapt.
Can you guys help me with this?