question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues running on Windows

See original GitHub issue

Ok, I don’t use Windows myself (ugh), but some of my coworkers do. There are issues running this on Windows:

  1. The compiler is run with an invalid path that contains a leading “/”. Here is the debug output from Gradle:
11:48:22.846 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command 'C:\jdk1.8.0_191\bin\java.exe''. Working directory: H:\source\myproject\lib-proto Command: C:\jdk1.8.0_191\bin\java.exe -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -jar /C:/Users/Me/.gradle/caches/modules-2/files-2.1/com.github.marcoferrer.krotoplus/kroto-plus-compiler/0.1.3/620b2a278b4d4beed80320bb4800339967f850d7/kroto-plus-compiler-0.1.3.jar H:\source\myproject\lib-proto/src/main/proto H:\source\myproject\lib-proto\build/extracted-include-protos/main -default-out H:\source\myproject\lib-proto\build\generated\source\proto\main\kotlin -writers 3 -StubOverloads -o|H:\source\myproject\lib-proto\build\generated\source\proto\main\kotlin|-coroutines -MockServices -o|H:\source\myproject\lib-proto\build\generated\source\proto\main\kotlin -ProtoTypeBuilder
...
11:48:22.874 [ERROR] [system.err] Error: Unable to access jarfile /C:/Users/Me/.gradle/caches/modules-2/files-2.1/com.github.marcoferrer.krotoplus/kroto-plus-compiler/0.1.3/620b2a278b4d4beed80320bb4800339967f850d7/kroto-plus-compiler-0.1.3.jar

Note the leading slash on the -jar argument.

  1. I don’t know if this is an issue in this plugin or in the upstream protobuf gradle plugin, but when adding the kroto code gen plugin to the protobuf plugin, the build fails with the error:
Execution failed for task ':generateProto'.
> protoc: stdout: . stderr: --kroto_out: protoc-gen-kroto: %1 is not a valid Win32 application.

Looking at the --debug logs, it looks like a --plugin parameter is addd to the call to protoc, with the following value:

 --plugin=protoc-gen-kroto=C:\Users\Me\.gradle\caches\modules-2\files-2.1\com.github.marcoferrer.krotoplus\protoc-gen-kroto-plus\0.1.3\3c41d071d04c8558822447643894490e33a857b7\protoc-gen-kroto-plus-0.1.3-jvm8.jar

but protoc is assuming the jar file is an executable it can run. I have tried associating “.jar” files with “java” (and this seems to have worked), but for some reason when running via protoc, the same “not a valid Win32 application” error still happens.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:26 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
marcoferrercommented, Mar 13, 2020

@fitzsia2 So originally the kroto+ plugin was not able to execute on windows environments. Version 0.6.0 introduced a native executable to mitigate this issue. But the problem still exists where the : in the path to the configuration file is mistaken by the protobuf compiler as an option delimiter. Currently in windows you still need to perform a small amount of path transformation to the configuration file to resolve correctly. You can see here how the project still relies on it.

Considering you had issues discovering this means that its not immediately clear to users and should be better documented. Thank you for bringing this to light.

                kroto {
                    outputSubDir = "java"
                    if(osdetector.os == "windows") {
                        // We want to relativize the configuration path
                        // because absolute paths cause issues in windows
                        // environments
                        option "ConfigPath=${krotoConfig.absolutePath.replace(System.getProperty("user.dir"), "").drop(1)}"
                    } else {
                        option "ConfigPath=$krotoConfig"
                    }
                }

https://github.com/marcoferrer/kroto-plus/blob/2b0b447d47f14da93b536ef238b379eb4cc6075c/build.gradle#L126

1reaction
marcoferrercommented, Dec 27, 2019

With 0.6.0 released, there is now an executable windows artifact available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot problems updating Windows - Microsoft Support
Have issues installing Windows updates? Start here. · Free up some drive space so you can run updates · Restart to apply installed...
Read more >
17 most common Windows 10 problems and how to fix them
1. Can't upgrade from Windows 7 or Windows 8 · 2. Can't upgrade to the latest Windows 10 version · 3. You have...
Read more >
Windows 10 Troubleshooting: The Most Common Problems ...
Issues updating to the latest version of Windows 10 · Not enough storage space to complete an update · Mouse cursor starts moving...
Read more >
Fix HP Laptop and PC Issues After Windows 10 Update or ...
An out-of-date graphics driver can cause the Windows update to fail and roll back. It is recommended to check and ensure that the...
Read more >
Troubleshoot gameplay, performance, and stability issues on ...
Run the Windows Store Apps troubleshooter · Download important or critical Windows updates · Check the system requirements · Make sure your PC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found