Building linkerd for Windows


#1

We’re researching running linkerd on Windows and so far we’ve been successful on Cygwin and Git Bash. We can’t build from source, but we can run the .exec that we download.

We would like to know if it’s possible to somehow compile from source on Windows? And secondarily, compile to a jar we can run using Windows jvm.

I’ve built a ‘hello world’ scala app in Windows and even packaged it as a jar, but I can’t do the same with the linkerd source. We currently get an error when it gets to the .protoc portion of the build process.

Running ./sbt compile in git bash, we get:

[info] Done updating.
java.lang.RuntimeException: error occured while compiling protobuf files: Cannot run program "./protoc": CreateProcess error=193, %1 is not a valid W                       in32 application
        at sbtprotobuf.ProtobufPlugin$.executeProtoc(ProtobufPlugin.scala:70)
        at sbtprotobuf.ProtobufPlugin$.sbtprotobuf$ProtobufPlugin$$compile(ProtobufPlugin.scala:86)
        at sbtprotobuf.ProtobufPlugin$$anonfun$sourceGeneratorTask$1$$anonfun$5.apply(ProtobufPlugin.scala:115)
        at sbtprotobuf.ProtobufPlugin$$anonfun$sourceGeneratorTask$1$$anonfun$5.apply(ProtobufPlugin.scala:114)
        at sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:235)
        at sbt.FileFunction$$anonfun$cached$1.apply(Tracked.scala:235)
        at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:249)
        at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3$$anonfun$apply$4.apply(Tracked.scala:245)
        at sbt.Difference.apply(Tracked.scala:224)
        at sbt.Difference.apply(Tracked.scala:206)
        at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:245)
        at sbt.FileFunction$$anonfun$cached$2$$anonfun$apply$3.apply(Tracked.scala:244)
        at sbt.Difference.apply(Tracked.scala:224)
        at sbt.Difference.apply(Tracked.scala:200)
        at sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:244)
        at sbt.FileFunction$$anonfun$cached$2.apply(Tracked.scala:242)
        at sbtprotobuf.ProtobufPlugin$$anonfun$sourceGeneratorTask$1.apply(ProtobufPlugin.scala:117)
        at sbtprotobuf.ProtobufPlugin$$anonfun$sourceGeneratorTask$1.apply(ProtobufPlugin.scala:112)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35)
        at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:235)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Cannot run program "./protoc": CreateProcess error=193, %1 is not a valid Win32 application
        at java.lang.ProcessBuilder.start(Unknown Source)
        at sbt.SimpleProcessBuilder.run(ProcessImpl.scala:349)
        at sbt.AbstractProcessBuilder.run(ProcessImpl.scala:128)

We’ve tried hacking the sbt build file and substituting the Win version of protocol buffers, but to no avail.


#2

related to https://github.com/linkerd/linkerd/issues/1397