compileKotlin warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
Asked Answered
J

1

1

The issue is similar to this:

Warning: the '-d' option with a directory destination is ignored because '-module' is specified

but with -Xbuild-file instead of -module:

warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified


EXAMPLE:

03:00:44 AM: Executing task 'compileKotlin'...

> Task :discoverMainScriptsExtensions

> Task :compileKotlin
Could not perform incremental compilation: Could not connect to Kotlin compile daemon
Could not connect to kotlin daemon. Using fallback strategy.

warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.0/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 21s
2 actionable tasks: 2 executed
03:01:06 AM: Task execution finished 'compileKotlin'.

NOTES:

  1. The warning appears during compileKotlin (or compileTestKotlin) task.

  2. I'm using Gradle v5.0 and Kotlin plugin v1.3.10.

  3. The issue doesn't exist when I execute the task on my remote machine that runs Linux. It's only on my (local) Windows machine.

  4. The issue is only when I use JDK > 8 (as Gradle's JVM).

  5. As you can see in the above example the issue is along with this message:

    Could not perform incremental compilation: Could not connect to Kotlin compile daemon

    Could not connect to kotlin daemon. Using fallback strategy.

    And my original problem is that! Its question is here. I think this issue should be the reason for that.

  6. This is some parts of the output log of the task when executing with --debug option (that I think is the most relevant). Especially see last [ERROR]:

    11:01:44 PM: Executing task 'compileKotlin --debug'...
    ...
    23:01:45.888 [DEBUG] [org.gradle.api.Project] [KOTLIN] Kotlin compiler args: -Xadd-compiler-builtins -Xbuild-file=C:\Users\I\AppData\Local\Temp\kjps11452575260818015211GradleKotlinJVM.script.xml -classpath D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk8\1.3.10\71d0fa967493eb76648b575edf1762cb2d0c7f10\kotlin-stdlib-jdk8-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk7\1.3.10\4d147bf43060dc43d61b096e24da1e67dfe0c032\kotlin-stdlib-jdk7-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.10\b178c1501609c6e4ee8be635513cb023a466457d\kotlin-stdlib-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.10\1b19d99229dcedad7caf50534dce38fe82845269\kotlin-stdlib-common-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar -d D:\Devel\IdeaProjects\GradleKotlinJVM\build\classes\kotlin\main -jvm-target 1.8 -Xload-builtins-from-dependencies -module-name GradleKotlinJVM -no-reflect -no-stdlib -Xplugin=D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-scripting-compiler-embeddable\1.3.10\e96a6125793c4ab0258119fcdce9d182f42d32b0\kotlin-scripting-compiler-embeddable-1.3.10.jar -verbose
    ...
    23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:\Program Files\Java\openjdk-11.0.1\bin\java -cp D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.3.10\adc9e577de39fba3db6d60662892118afedd713\kotlin-compiler-embeddable-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.3.10\dd02865be0351707554b16a896b766b2396cdafa\kotlin-reflect-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.10\b178c1501609c6e4ee8be635513cb023a466457d\kotlin-stdlib-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-script-runtime\1.3.10\1d2bac36f99b84e1493244f12629bc0756a3ff90\kotlin-script-runtime-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.10\1b19d99229dcedad7caf50534dce38fe82845269\kotlin-stdlib-common-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:\Users\I\AppData\Local\kotlin\daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.3.10\adc9e577de39fba3db6d60662892118afedd713\kotlin-compiler-embeddable-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.3.10\dd02865be0351707554b16a896b766b2396cdafa\kotlin-reflect-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.10\b178c1501609c6e4ee8be635513cb023a466457d\kotlin-stdlib-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-script-runtime\1.3.10\1d2bac36f99b84e1493244f12629bc0756a3ff90\kotlin-script-runtime-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.10\1b19d99229dcedad7caf50534dce38fe82845269\kotlin-stdlib-common-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar
    23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    23:01:48.134 [INFO] [org.gradle.api.Task] i: starting the daemon as: C:\Program Files\Java\openjdk-11.0.1\bin\java -cp D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.3.10\adc9e577de39fba3db6d60662892118afedd713\kotlin-compiler-embeddable-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.3.10\dd02865be0351707554b16a896b766b2396cdafa\kotlin-reflect-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.10\b178c1501609c6e4ee8be635513cb023a466457d\kotlin-stdlib-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-script-runtime\1.3.10\1d2bac36f99b84e1493244f12629bc0756a3ff90\kotlin-script-runtime-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.10\1b19d99229dcedad7caf50534dce38fe82845269\kotlin-stdlib-common-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar -Djava.awt.headless=true -Djava.rmi.server.hostname=127.0.0.1 -Xmx1536m -XX:MaxPermSize=512m -Dkotlin.environment.keepalive org.jetbrains.kotlin.daemon.KotlinCompileDaemon --daemon-runFilesPath C:\Users\I\AppData\Local\kotlin\daemon --daemon-autoshutdownIdleSeconds=7200 --daemon-compilerClasspath D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.3.10\adc9e577de39fba3db6d60662892118afedd713\kotlin-compiler-embeddable-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.3.10\dd02865be0351707554b16a896b766b2396cdafa\kotlin-reflect-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.3.10\b178c1501609c6e4ee8be635513cb023a466457d\kotlin-stdlib-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-script-runtime\1.3.10\1d2bac36f99b84e1493244f12629bc0756a3ff90\kotlin-script-runtime-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.3.10\1b19d99229dcedad7caf50534dce38fe82845269\kotlin-stdlib-common-1.3.10.jar;D:\Devel\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar
    23:01:48.134 [INFO] [org.gradle.api.Task] i: [daemon] OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
    23:01:48.134 [INFO] [org.gradle.api.Task] i: Received the message signalling that the daemon is ready
    23:01:48.134 [INFO] [org.gradle.api.Task] i: new daemon started, trying to find it
    23:01:48.137 [WARN] [org.gradle.api.Project] Could not perform incremental compilation: Could not connect to Kotlin compile daemon
    23:01:48.137 [WARN] [org.gradle.api.Project] Could not connect to kotlin daemon. Using fallback strategy.
    23:01:49.486 [LIFECYCLE] [system.err] 
    23:01:49.486 [ERROR] [system.err] logging: using Kotlin home directory <no_path>
    23:01:49.521 [ERROR] [system.err] logging: configuring the compilation environment
    23:01:50.538 [ERROR] [system.err] logging: loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]
    23:01:53.459 [ERROR] [system.err] warning: the '-d' option with a directory destination is ignored because '-Xbuild-file' is specified
    ...
    11:01:53 PM: Task execution finished 'compileKotlin --debug'.
    
Jubbah answered 6/1, 2019 at 23:53 Comment(0)
J
1

Solved. The issue is from unicode encoding issues (probably between NTFS and UTF-8). I reverted my personalizations of Windows' date & time formats and the issue disappeared. See my post in response to the original problem for more details.

Jubbah answered 8/1, 2019 at 1:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.