https://kotlinlang.org logo
#arrow-contributors
Title
# arrow-contributors
m

mitch

05/28/2022, 10:38 AM
@Imran/Malic i’ve found a pretty embarassing bug in arrow-integrations-jackson-module - seems like that’s released for java 15 source compatibility. it works on maven but fails on gradle. 😭 https://github.com/arrow-kt/arrow-integrations/pull/93
j
we merged a PR with the last suggestion, but if it is not working, we should try the java/toolchain alternative here: https://github.com/arrow-kt/arrow-gradle-config
we would need to do
withJava
or something so in the KMP part, cc @Imran/Malic
m

mitch

05/28/2022, 12:57 PM
@Javier what version was the gradle config which has the fix previously? i remember there was a renovate pr bump for arrow-gradle-config a while back. What I know is the latest alpha.15 of arrow-integrations-jackson was using
0.10.2
. I needed to add java / toolchain to java 8 specifically in the corresponding module.
from my test locally adding that solves it. i tried that on various jdk, everything resolves to 8.
(disclaimer - i’m a gradle newbie)
j

Javier

05/28/2022, 12:59 PM
Feels free to create a PR in arrow-gradle-config with that fix if you want 🙂
i

Imran/Malic

05/28/2022, 12:59 PM
Arrow integrations has its CI with Java 15 so we need to change that
m

mitch

05/28/2022, 1:00 PM
right..
i

Imran/Malic

05/28/2022, 1:00 PM
AFAIK arrow-gradle doesnt need changes for that
j

Javier

05/28/2022, 1:00 PM
@Imran/Malic that is good IMO, the problem is Kotlin has a bug which has been solved
They haven't provided a solution to those death properties yet
i

Imran/Malic

05/28/2022, 1:01 PM
Do you know if it comes in 1.7 ? Or is already in 1.6.21?
j

Javier

05/28/2022, 1:02 PM
we added the workaround mentioned in the issue, but as @mitch is mentioning, it looks like it is not working
i

Imran/Malic

05/28/2022, 1:03 PM
Arrow gradle in arrow-integrations isnt on the alpha release we published this week
j

Javier

05/28/2022, 1:03 PM
yeah, with 1.7 those properties don't exist (we have tried to add arrow gradle config to arrow inject and we got that crash)
ahhh
then maybe the fix is not there
m

mitch

05/28/2022, 1:03 PM
ohh
j

Javier

05/28/2022, 1:03 PM
I think we should avoid publishing alphas in arrow gradle config
to allow renovate pick the new release automatically in all repos, what do you think @Imran/Malic?
m

mitch

05/28/2022, 1:03 PM
the alphas are really helpful
please keep them 😭
j

Javier

05/28/2022, 1:04 PM
yeah @mitch, but I mean only for the arrow gradle config repo, rest will keep them 🙂
👌 1
arrow-gradle-config is a repo which centralizes the entire Gradle configuration for all arrow organization repositories
i

Imran/Malic

05/28/2022, 1:04 PM
I think we should avoid publishing alphas in arrow gradle config
i think both is fine I was publishing an alpha since we wanted to get the release out for arrow-endpoints and I wasn‘t sure if it works
j

Javier

05/28/2022, 1:05 PM
ahh okay
i

Imran/Malic

05/28/2022, 1:05 PM
But arrow-endpoints alpha was published successfully, so we can publish a new stable version
🙌 1
j

Javier

05/28/2022, 1:05 PM
but it is sucessfully pubolished with Gradle metadata wrong, no?
using java 15
or you mean upgrading to the arrow gradle config alpha
m

mitch

05/28/2022, 1:09 PM
looking at arrow-endpoints, it does use
Copy code
arrowGradleConfig = "0.10.3-alpha.1"
and
Copy code
- name: Set up Java
        uses: actions/setup-java@v3.1.0
        with:
          distribution: 'adopt'
          java-version: '15'
looks like there’s no java/toolchain mentions
let me try pulling that locally and see its metadata
j

Javier

05/28/2022, 1:10 PM
yeah we used the another workaround
check the youtrack issue
👀 1
m

mitch

05/28/2022, 1:13 PM
oh this one? https://youtrack.jetbrains.com/issue/KT-45335/kotlinOptions-jvmTarget-conflicts-with-Gradle-variants#focus=Comments-27-4765781.0-0
Copy code
configurations["runtimeElements"].attributes {
    attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
}
or this other one? https://youtrack.jetbrains.com/issue/KT-52474/An-attribute-org-gradle-jvm-version-isn-t-set-correctly-while-up#focus=Comments-27-6102307.0-0 alt 1?
Copy code
tasks.withType(JavaCompile::class.java) {
    targetCompatibility = "1.8"
    sourceCompatibility = "1.8"
}
or alt2? java toolchain
Copy code
kotlin {
    jvmToolchain {
        languageVersion.set(JavaLanguageVersion.of(8))
    }
}
i’m pretty sure i tried suggestion 2, alt 1 - that did not work
j

Javier

05/28/2022, 1:13 PM
@mitch the workaround was in 0.10.3-alpha.2
so endpoints is not using it
m

mitch

05/28/2022, 1:14 PM
right..
j

Javier

05/28/2022, 1:14 PM
and we don't know if it works yet
can you try with that version please?
if it doesn't work we will have to use your workaround with java toolchain
m

mitch

05/28/2022, 1:14 PM
ok lemme try
🙏 1
hmm ok that didn’t seem too promising
trying gradle config alpha.2
using gradle config alpha.2
well this is interesting, the workaround “almost” works.. the api element was the wrong version but the runtime elements are of the right version!
@Javier fyi
i think we still need to use java / toolchain
j

Javier

05/28/2022, 1:28 PM
I will create a PR in arrow gradle config but if you want feels free to create it :)
m

mitch

05/28/2022, 1:28 PM
ok @Imran/Malic @Javier i’m going to check out for now, it’s almost midnight here. Will touch base again in the morning. 🤞 hopefully that’s enough data point. I’m quite convinced we need to use java / toolchain
👍 2
j

Javier

05/28/2022, 1:28 PM
okay, really thank you for your help ;)
i

Imran/Malic

05/28/2022, 1:29 PM
Thanks @mitch for the insight :)
m

mitch

05/28/2022, 1:36 PM
Oh right java / toolchain might not be needed i just realised we just need to set the apiElements as well
j

Javier

05/28/2022, 1:43 PM
i think java toolchain looks cleaner than the current workaround
but not sure about his integration with kmp
m

mitch

05/28/2022, 1:44 PM
what can possibly go wrong 😅
j

Javier

05/28/2022, 1:44 PM
we can merge it and do an alpha release
if it doesn't work, we go for toolchain
m

mitch

05/28/2022, 1:45 PM
🤞
ok that’s it for my battery, i’m checking out haha. good luck Javier, thanks again.
j

Javier

05/28/2022, 1:46 PM
depending on the status of mavencentral servers, it should be available in 10-20 min
👍 1
thank you indeed 😛
m

mitch

05/28/2022, 1:47 PM
i’m gonna sleep for now and try in the morning while i bake my bread
j

Javier

05/28/2022, 1:47 PM
which command are you running to check the variants version?
m

mitch

05/28/2022, 1:47 PM
outgoingVariants
Copy code
gradle :arrow-integrations-jackson-module:outgoingVariants
👍 1
j

Javier

05/28/2022, 1:48 PM
nice, thank you! see you 🙂
looks like it works @mitch
thank you 😄
message has been deleted
m

mitch

05/28/2022, 11:58 PM
that’s awesome! is that alpha.3 ?
👌 awesome confirmed that I’ve also got the same 🙌 - i’ve updated the PR https://github.com/arrow-kt/arrow-integrations/pull/93 i’ve assigned you and Imran to review. @Imran/Malic @Javier
2
i

Imran/Malic

06/03/2022, 10:33 AM
@mitch did it work?
m

mitch

06/03/2022, 10:34 AM
Yep it does! 🙌
🙌🏾 1
i

Imran/Malic

06/03/2022, 10:48 AM
Awesome thanks @mitch for raising this up
4 Views