Closed pierreis closed 5 years ago
Ha funny, I literally just tried to do the exact same thing (i.e. get started with ktor in bazel) and that seems to start downloading something for me:
maven_repository(
name = "ktor",
repositories = {
"https://dl.bintray.com/kotlin/ktor": [
"io.ktor:ktor-server-netty",
"io.ktor:ktor-server-host-common",
"io.ktor:ktor-server-core",
"io.ktor:ktor-utils-jvm",
"io.ktor:ktor-utils",
"io.ktor:ktor-http-jvm",
"io.ktor:ktor-http",
"io.ktor:ktor-http-cio",
"io.ktor:ktor-network",
],
"http://dl.bintray.com/kotlin/kotlinx": [
"org.jetbrains.kotlinx:kotlinx-io-jvm",
"org.jetbrains.kotlinx:kotlinx-io",
"org.jetbrains.kotlinx:kotlinx-coroutines-io-jvm",
"org.jetbrains.kotlinx:kotlinx-coroutines-io",
]
},
deps = [
"io.ktor:ktor-server-netty:1.0.0-beta-3",
],
)
It is a bit cumbersome though to have to specify each package that should be downloaded from a separate repository. Would it be possible to just add a list of additional repositories and these rules would try to download every dependency from every repository in order until the first successful download?
As a side note @pierreis are you trying to get this to run with rules_kotlin
? That is what I am trying and I have been failing for the last few hours. So if you do get it done and you could link an example repo or gist or something that would be much appreciated.
And I see on the other side that you also have more or less the same error as me when trying to use Kotlin 1.3. Interesting :) Couldn't make it work either, but your snipped helped a lot for the dependencies.
Would help not having to mention the origin of all dependencies though.
ah cool, yeah a little of topic but I have given up for now with kotr, as either I get issues with not having 1.3 or when trying to use 0.9.5 I start getting errors like
Caused by: org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call '...' into
... the app code snippet ...
Cause: Not generated
Cause: Couldn't obtain compiled function body for ....
File being compiled at position: (34,39) in ...
The root cause was thrown at: InlineCodegen.kt:515
...
Not sure if you have run into a similar issue like that.
Actually, it seems that this error comes from the fact that all dependencies are imported by rules_maven
, including Kotlin itself, which causes a conflict.
Excluding it from the maven rule works:
maven_repository(
name = "ktor",
repositories = {
"https://dl.bintray.com/kotlin/ktor": [
"io.ktor:ktor-server-netty",
"io.ktor:ktor-server-host-common",
"io.ktor:ktor-server-core",
"io.ktor:ktor-utils-jvm",
"io.ktor:ktor-utils",
"io.ktor:ktor-http-jvm",
"io.ktor:ktor-http",
"io.ktor:ktor-http-cio",
"io.ktor:ktor-network",
],
"http://dl.bintray.com/kotlin/kotlinx": [
"org.jetbrains.kotlinx:kotlinx-io-jvm",
"org.jetbrains.kotlinx:kotlinx-io",
"org.jetbrains.kotlinx:kotlinx-coroutines-io-jvm",
"org.jetbrains.kotlinx:kotlinx-coroutines-io",
]
},
deps = [
"io.ktor:ktor-server-netty:1.0.0-beta-3",
],
omit = [
"org.jetbrains.kotlin:"
]
)
Closing this as it appears no action item.
I'm trying to add a dependency on Ktor, with the following definition:
However, the rule doesn't seem to do anything: no dependency is fetched, and no closed configuration is generated.
Is this behavior expected?
--
The behavior for deps fetched from Maven Central is correct.
WORKSPACE is as follows: