<@UEU1NDQCD> i’ve found a pretty embarassing bug i...
# arrow-contributors
m
@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
@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
Feels free to create a PR in arrow-gradle-config with that fix if you want 🙂
i
Arrow integrations has its CI with Java 15 so we need to change that
m
right..
i
AFAIK arrow-gradle doesnt need changes for that
j
@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
Do you know if it comes in 1.7 ? Or is already in 1.6.21?
j
we added the workaround mentioned in the issue, but as @mitch is mentioning, it looks like it is not working
i
Arrow gradle in arrow-integrations isnt on the alpha release we published this week
j
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
ohh
j
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
the alphas are really helpful
please keep them 😭
j
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
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
ahh okay
i
But arrow-endpoints alpha was published successfully, so we can publish a new stable version
🙌 1
j
but it is sucessfully pubolished with Gradle metadata wrong, no?
using java 15
or you mean upgrading to the arrow gradle config alpha
m
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
yeah we used the another workaround
check the youtrack issue
👀 1
m
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
@mitch the workaround was in 0.10.3-alpha.2
so endpoints is not using it
m
right..
j
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
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
I will create a PR in arrow gradle config but if you want feels free to create it :)
m
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
okay, really thank you for your help ;)
i
Thanks @mitch for the insight :)
m
Oh right java / toolchain might not be needed i just realised we just need to set the apiElements as well
j
i think java toolchain looks cleaner than the current workaround
but not sure about his integration with kmp
m
what can possibly go wrong 😅
j
we can merge it and do an alpha release
if it doesn't work, we go for toolchain
m
🤞
ok that’s it for my battery, i’m checking out haha. good luck Javier, thanks again.
j
depending on the status of mavencentral servers, it should be available in 10-20 min
👍 1
thank you indeed 😛
m
i’m gonna sleep for now and try in the morning while i bake my bread
j
which command are you running to check the variants version?
m
outgoingVariants
Copy code
gradle :arrow-integrations-jackson-module:outgoingVariants
👍 1
j
nice, thank you! see you 🙂
looks like it works @mitch
thank you 😄
message has been deleted
m
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
@mitch did it work?
m
Yep it does! 🙌
🙌🏾 1
i
Awesome thanks @mitch for raising this up