Though I have `http_proxy` env variable set up pro...
# kotlin-native
a
Though I have
http_proxy
env variable set up properly
o
a
Nope
I am using Clion and I have provided the details as follows:
Sorry could not upload screenshot here so I uploaded in the channel
Even I tried with below settinngs in cmake file
set(ADDITIONAL_KONANC_FLAGS "-Dhttp.proxyHost=******** -Dhttp.proxyPort=*******") set(CMAKE_Kotlin_FLAGS "-Dhttp.proxyHost=********* -Dhttp.proxyPort=******")
but no result
o
could you please try
konanc
with -D options as suggested in the bug and let us know the result. Could you run other networked Java programs?
a
Yes I can run other java program using -Dhttp.proxyHost
I didnot get he konanc part. I am running from CLion using cmake. Where do I set these?
o
please download Kotlin/Native redistributable https://github.com/JetBrains/kotlin-native/releases/tag/v0.6.2 for your platform and run command line compiler called
konanc
. It will download all needed toolchains.
a
Copy code
$ ~/.konan/kotlin-native-linux-0.6.2/bin/konanc      
error: you have not specified any compilation arguments. No output has been produced.
o
build some sample from
samples
folder
a
First I set
export COMPILER_ARGS_linux='-Dhttp.proxyHost=**************** -Dhttp.proxyPort=********'
and then run
build.sh
. Still same error. After that I started gradle build with proxy args let see.
o
nope, try
./gradlew -D...
a
Just now tried with
./gradlew -Dhttp.proxyHost=*********** -Dhttp.proxyPort=****** build
but got this error
Copy code
> Task :csvparser:compileKonanCsvParserLinux 
Downloading native dependencies (LLVM, sysroot etc). This is a one-time action performed only on the first run of the compiler.
Cannot download a dependency: java.net.ConnectException: Connection timed out
Waiting 3.0 sec and trying again (attempt: 2/10).
o
hmm, are you sure this is correct proxy config? could you check that it matches your browser config?
a
Yes positively. The same gradle command build my java projects just fine
o
also try
-Dhttps.proxyHost=  -Dhttps.proxyPort=
a
Tried this too
None of these works
So any solution for this? Oh and this gradle setting just successfully downloaded gradle 4. 5 dist while building samples.
o
hard to tell, generally -D solution is known to work for cases we aware of. You could try to debug the download code, which is at https://github.com/JetBrains/kotlin-native/blob/master/shared/src/main/kotlin/org/jetbrains/kotlin/konan/util/DependencyDownloader.kt
oh, and try
./gradlew -stop
a
@olonho I tried many more methods. Only working solution is, I modified
run_konan
script as below
Copy code
java_opts=(-ea \
            -Djava.net.useSystemProxies=true \
            -Xmx3G \
            "-Djava.library.path=${NATIVE_LIB}" \
            "-Dkonan.home=${KONAN_HOME}" \
           -Dfile.encoding=UTF-8)
o
cool, then it means proxy servers you pass originally were not functional and so relying on system-wide proxy config worked. Likely you could pass same argument via
-D
switch.
a
No that did not work. Reading the shell scripts for linux I understand it is not propagating those args to the
run_konan
that's why it was not working. In place of
java.net.useSystemProxies
if I pass
http.proxyHost
and
http.proxyPort
in
run_konan
, that was also working. I choose the
java.net.useSystemProxies
as I don't have to pass host, port again. Can you please verify if those
-D
args are being passed from gradle script to
run_konan
properly?
a
We think we have found the root cause of issue and are working on the resolution. The progress is tracked within the following github issue: https://github.com/JetBrains/kotlin-native/issues/1446
👍 1