https://kotlinlang.org logo
Join SlackCommunities
Powered by
# kontributors
  • t

    Tung97 Hl

    07/19/2023, 3:09 AM
    Hi everyone, I cloned the Kotlin repository and tried to build by the "gradle build" command. But I always receive an error. Please help me!
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':kotlin-stdlib:compileKotlin'.
    > Requesting vendor list failed: {"message":"Internal Server Error","_links":{"self":{"href":"/disco/v3.0/packages?jdk_version=6&distro=mandrel&operating_system=macos&latest=available&directly_downloadable=true","templated":false}},"_embedded":{"errors":[{"message":"Internal Server Error: Please provide a valid jdkVersion"}]}}
    d
    p
    • 3
    • 3
  • a

    Ahmed Elshaer

    07/19/2023, 11:27 PM
    Hi everyone, i'm new to contribution on Kotlin but this is something i wanted to do a long time ago, i want to start working on this issue https://youtrack.jetbrains.com/issue/KT-47553/Sequence.plus-implementation-optimization Can anyone let me know where can i do these changes ? i can only find the plus operator inside the generated package
    • 1
    • 1
  • p

    Piotr Krzemiński

    07/26/2023, 10:34 AM
    out of curiosity: is it by design that the main Kotlin repo sits under the JetBrains GitHub org instead of the dedicated Kotlin org? thoughts?
    👀 2
    👌 1
  • s

    scaventz

    08/24/2023, 8:33 AM
    I was able to run single test in IDE, but now I get an error: `No tests were found" What should I do to run single test like before?
    d
    • 2
    • 5
  • i

    Iaroslav Postovalov

    08/25/2023, 1:41 PM
    ?
    c
    • 2
    • 1
  • c

    Catherine

    08/25/2023, 1:43 PM
    Hi everyone, I want to contribute in Kotlin and need a little bit of your help. Actually, I cloned the repo https://github.com/JetBrains/kotlin But when I opened the project in my IDE(IntelliJ) it took 1.5 hours to build then another 45 mins to run tests which I had to stop in the middle as it was too much of waiting. This is too much of time and isn't sustainable for me to keep waiting that long. For now, I only want to get my hands on JS module https://github.com/JetBrains/kotlin/tree/master/js Is there any way possible that I could clone just that and don't have to worry for the other modules which would only increase build and testing times? What do you guys do?
    i
    c
    • 3
    • 3
  • d

    DrIgor

    08/29/2023, 9:06 PM
    Hi everyone, I decided to work on several Up-For-Grabs tasks from the kotlin idea plugin tracker. I realised that they require changes in both idea-plugin and kotlin repositories. Could anyone please explain how I can use artefacts from my local kotlin branch in the plugin? I have built libs from
    prepare/ide-plugin-dependencies/
    folder but I don't know how to use them in the plugin. I tried
    publish
    and
    publishToMavenLocal
    tasks, but it seems that they don't publish
    kotlin-*-for-ide
    jars to the repo. I also found
    plugins/kotlin/util/project-model-updater
    script which updates the plugin dependencies but it still need them to published. Thank you
    d
    • 2
    • 4
  • v

    Viorel Ștefan Alexandrescu

    09/26/2023, 1:57 PM
    Hello everyone! K🤘 I'm new around here, but I have decided recently I want to contribute to the Kotlin project in whatever way I can. Right now I would like to pick this issue up as it seems like a neat one to grab. Could someone instruct what am I to do next? More specifically if I just assign it to myself and start working on it. Many thanks in advance 😇
    b
    • 2
    • 17
  • n

    Niklas Konstenius

    10/30/2023, 4:06 PM
    Hi, I would like to contribute to the Kotlin standard library by adding some extension functions to
    Pair
    and
    Triple
    for transforming the individual components using a mapping function. This will make the two types more ergonomic to use in a functional programming context. I opened an issue on this here but it seems that there already existed a similar issue. I'm thinking something like this:
    Copy code
    val x = Pair(1,"Hello")
    val y = x.mapSecond { it.length }
    
    println(y) // prints (1, 5)
    The new extension function is
    mapSecond
    . And there will be a `mapFirst`for Pair also. For Triple I'll add
    mapFirst
    ,
    mapSecond
    and
    mapThird
    . Does this seem like a good idea? What are the chances that a PR will be merged?
  • n

    Nathan Fallet

    11/18/2023, 12:06 PM
    Hi everyone! I've been using Kotlin for like 2 years, and I love it. That's why I would love to contribute to it. I just had one question, do you know why the official Kotlin repo is in the JetBrains team (github.com/JetBrains/kotlin) while there is a Kotlin org (github.com/Kotlin)? Any way, I will take a look to opened issues on YouTrack and start making things on my free coming time (like every Friday for Open Source Friday :p)
    p
    v
    • 3
    • 2
  • c

    CLOVIS

    12/06/2023, 6:34 PM
    Hi! I just cloned the Kotlin repository, and I'm getting:
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    When using exclusive repository content in 'settings.pluginManagement.repositories', you cannot add repositories to 'buildscript.repositories'.
    For more information, please refer to <https://docs.gradle.org/8.2.1/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository> in the Gradle documentation.
    Is this known? I don't see anything related in the contribution guide
  • p

    Pim

    12/21/2023, 8:18 PM
    Hey everyone! I'm interested to learn how the Kotlin compiler works and eventually in contributing to the project. Right now I'm trying to read and learn as much as possible. I have cloned the repo and followed the steps described in https://github.com/JetBrains/kotlin/tree/master#building. I run
    openjdk 17.0.9
    and set
    kotlin.build.isObsoleteJdkOverrideEnabled=true
    in my
    local.properties
    . I tried running one of the important gradle tasks as follow:
    ./gradlew -Porg.gradle.java.installations.auto-detect=false compilerTest
    this fails with reason:
    Copy code
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':kotlin-stdlib-jdk8:compileModuleTestKotlin'.
    > Inconsistent JVM-target compatibility detected for tasks 'compileModuleTestJava' (9) and 'compileModuleTestKotlin' (11).
    I am not sure what's going wrong as I have not made any changes to the repo, and I followed the steps from the README. Could someone perhaps help me out? Thanks!
    d
    • 2
    • 8
  • g

    Girish Garg

    01/21/2024, 12:14 PM
    Hello. I am Girish from India 🇮🇳 I want to contribute to solving this issue https://youtrack.jetbrains.com/issue/KTIJ-1053/Find-usages-no-convention-usages-for-suspend-invoke-operator. Can someone please guide me on which parts of the codebase should I look into in order to get started? Thank you
    • 1
    • 2
  • d

    Daniel Karnaukh

    01/22/2024, 10:10 PM
    Hello everyone! I was thinking of specializing
    (mutable)setOf
    using reified genericsto account for enum sets, which are faster than your average
    HashSet
    for enums. However,
    (mutable)setOf
    stipulates that the returned set maintains insertion order, so I quickly wrote up a
    LinkedEnumSet
    and benchmarked it:
    Copy code
    BenchEnum.addEnum             avgt   25   1.643 ± 0.135  ns/op
    BenchEnum.addEnumSet          avgt   25   1.475 ± 0.050  ns/op
    BenchEnum.addMutableSet       avgt   25  10.844 ± 0.687  ns/op
    
    BenchEnum.containsEnum        avgt   25   1.354 ± 0.015  ns/op
    BenchEnum.containsEnumSet     avgt   25   1.260 ± 0.044  ns/op
    BenchEnum.containsMutableSet  avgt   25   2.800 ± 0.348  ns/op
    
    BenchEnum.iterateEnum        avgt   25  27.879 ± 0.350  ns/op
    BenchEnum.iterateEnumSet     avgt   25  10.458 ± 0.105  ns/op
    BenchEnum.iterateMutableSet  avgt   25   9.721 ± 0.097  ns/op
    
    BenchEnum.removeEnum          avgt   25   1.573 ± 0.140  ns/op
    BenchEnum.removeEnumSet       avgt   25   1.442 ± 0.091  ns/op
    BenchEnum.removeMutableSet    avgt   25   3.367 ± 0.803  ns/op
    In here,
    *Enum
    is the
    LinkedEnumSet
    ,
    *EnumSet
    is the
    java.util.EnumSet
    , and
    *MutableSet
    is the set returned by
    toMutableSet
    . As you can see,
    LinkedEnumSet
    is significantly faster than
    MutableSet
    except in the case of iteration, which I have no idea why. Does my idea to specialize
    (mutable)setOf
    (and the
    (mutable)mapOf
    possibly too) have any merit? Benchmark source can be found here.
  • a

    Anton Saatze

    02/01/2024, 9:58 AM
    Contribution Announcement: Kotlin/Native supporting RiscV https://youtrack.jetbrains.com/issue/KT-43854/Kotlin-Native-Linux-RISC-V-targets I just wanted to inform you, that I am writing my master thesis (final thesis of a university degree in germany) about my experience in extending the Kotlin/Native compiler to support RiscV and how I made it work. I am not really allowed to get support on that, except on tipps and hints, but the final document has to be written by my own. I am not sure, when I am allowed to release the output. I will clarify this with my contact at university. If i manage to support Kotlin/Native for RiscV processors, I will publish the result in the form of a PR. Thats what we agreed from beginning on. Current State: ✅ Added
    linux_riscv
    as native target ✅ Added cross-compile-toolchain (but not generated with the kotlin-native/tools/toolchain_builder/ utils. Its pretty outdated and I could not make it work within a few days, which I set as time constraint to test that) ✅ Compiled the Runtime for RiscV target + compiled stdlib for RiscV target ✅ Compiled a Hello World application as executable and executed it on Qemu ☑️ But, I had to increase the Linker version, since all dependencies were build with the ‘relaxation’ feature, which is not supported by the current Linker (ld.lld 11.1.0) ➡️ Therefore I built a newer version of the LLVM Backend and used its Linker which resulted in a working Hello World Executable for RiscV 👨‍💻 Currently I am working on writing the thesis • basics • important concepts • rough explanation how Kotlin/Native compiler works • what changes I had to apply • which challenges occurred • … and I am still • experimenting with compile flags • trying to use no relaxation for the entire build to avoid updating the Linker • trying to upgrade the llvm backend so that the linker does not have to be increased individually • testing if all expected stdlib functions are working • … For my final Contribution PR I will have to get in contact with the Jetbrains Kotlin Team how a newer Linker can be provided (independent of entire LLVM-Dependency) and how the Cross-compile-toolchain can be provided.
    🎉 5
    s
    • 2
    • 2
  • b

    baxter

    04/17/2024, 4:33 AM
    Hey folks! I know that the
    kotlin-kapt
    plugin is in maintenance mode, but there is a pretty severe file leak within the
    Kapt.kt
    file here. I found this occurring within the Gradle daemon each time that an app build occurred in an Android project. To emphasize the severity, assembling the APK in an Android Gradle build with a single project easily leads to 800+ open file descriptors in the Gradle daemon, with more files being opened in subsequent runs of
    assemble
    . In a real world case with a Gradle build that contains >5k projects, this leaves at least 3.5k open file descriptors (there are more, but that was the largest grouping of open files with a similar stack trace). I've reported the issue here: https://youtrack.jetbrains.com/issue/KT-67495/File-leak-in-when-building-with-kapt And a PR for the fix here: https://github.com/JetBrains/kotlin/pull/5290
  • f

    Felice Simone

    04/18/2024, 4:35 PM
    Hello, I'm new in this Slack, I want to contribute to the development of Kotlin Lang or KMM or Android, how can I proceed to receive something to do?
    👍 1
  • d

    Daniel Santos

    06/06/2024, 4:17 PM
    Hey everybody, it's a pleasure to be here, i'm a Java Developer and I set the goal to learn and master Kotlin in 2024 and I found out you guys are open-source, so as I always wanted to dive into the community of open-source development, i decided to dive in using the language I'm actually learning, I want to contribute in anything that I can
    👋 1
  • e

    eladkay

    06/17/2024, 9:09 AM
    Hi everyone, I'm trying to find where in the compiler's code are simple warnings implemented. Specifically I'm looking for the implementation of the unchecked cast warning. If anyone would point me to it, or even where the warnings are in general, that would be most appreciated
    d
    • 2
    • 2
  • s

    scaventz

    06/18/2024, 8:04 AM
    I'm not familiar with
    kotlin-native
    , and I just opened
    KlibToolLogger.kt
    resides in
    kotlin-native/klib/src/org/jetbrains/kotlin/cli/klib/
    and I noticed that there is no code inspection support or syntax error reporting in IDE. Is this intentional or have I not configured it correctly?
    d
    • 2
    • 2
  • j

    Joost Klitsie

    06/28/2024, 10:28 AM
    Hello dear people! I am using the Result class a lot in my daily life. The only thing that, in my humble opinion, is missing in it, is a way to flatMap results! Lets say I have to perform 2 jobs that depend on each other, both returning a result, it would be great to do use it in cases like this:
    Copy code
    fun fetchDataForLoggedInUser(): Result<String> = fetchLoggedInUserUseCase.run()
        .flatMap { user -> fetchDataForUserUseCase.run(user) }
    I of course made my own extension function (in the comment), but would you people agree that it would be a nice thing to add to the standard library as well?
    c
    • 2
    • 9
  • i

    Ivet

    08/07/2024, 9:39 AM
    Hello team, I am considering making a small contribution to BuildToolsApi. We are currently experimenting with integrating it into our build tool to simplify the integration of the incremental compiler. Following the contributing guidelines, I wanted to reach out first about the changes I am proposing. 1. Add an option to pass a custom fallback Classloader in SharedApiClassesClassLoader. We are using our own class loader which we require to be used if the name of the class does not start with allowedPackage. This change will be backward compatible thanks to default arguments. 2. Return null when mapping SourcesChanges.ToBeCalculated to ChangedFiles instead of ChangedFiles.Unknown() in icAdapters, which causes the module to be rebuilt (there is TODO for changing the logic). If I am not mistaken, null will force the compiler to calculate changed files itself. Since those are minor changes, I have not created Youtrack issues. Let me know if you have any concerns.
    d
    t
    • 3
    • 4
  • a

    Anton Saatze

    09/16/2024, 12:14 PM
    Announced a while ago: https://kotlinlang.slack.com/archives/C0BUHC9HD/p1706781493133269?thread_ts=1706781493.133269&amp;cid=C0BUHC9HD completed now: https://github.com/Tosaa/kotlin_native_on_riscv Feel free to read my master thesis how I adjusted the Kotlin Compiler to support RISC-V targets using a Linux Risc-V target on the Kotlin/Native Compiler.
    kodee pleased 2
    🔥 5
    h
    • 2
    • 2
  • k

    kaeawc

    09/18/2024, 11:04 AM
    Hiya 👋 I noticed something conflicting in the Kotlin documentation as well as some unexpected behavior when running Kotlin JVM Daemon via Gradle. Wanted to come here and ask what's the best way to go about contributing to the documentation of current behavior (and maybe a bugfix, we'll see) The documentation on Kotlin JVM args has a few different parts 1. Gradle daemon arguments inheritance
    If nothing is specified, the Kotlin daemon inherits arguments from the Gradle daemon. For example, in the
    gradle.properties
    file:
    Copy code
    org.gradle.jvmargs=-Xmx1500m -Xms500m
    2. Kotlin daemon's behavior with JVM arguments
    If the
    Xmx
    argument is not specified, the Kotlin daemon will inherit it from the Gradle daemon.
    🧵 for more details
    • 1
    • 7
  • b

    beatbrot

    10/30/2024, 12:53 PM
    Hi 🙂 I noticed that since quite a while, kotlin-osgi-bundle does not have a proper sources jar (see https://youtrack.jetbrains.com/issue/KT-28492). This has been an issue since 2018 and I created a PR that fixes it here.
    d
    t
    c
    • 4
    • 7
  • b

    baxter

    10/31/2024, 10:32 PM
    Hey folks, just nudging you all about this PR: https://github.com/JetBrains/kotlin/pull/5372 It fixes a file leak that occurs on the Kotlin daemon, which gets really bad when building larger projects.
    ✔️ 1
  • k

    kralli

    02/12/2025, 7:08 PM
    Hey, I opened this PR a while ago. Things were too busy at the time due the Kotlin 2.0 release and there has been no activity since. Would it be possible to have someone look over this? https://github.com/JetBrains/kotlin/pull/5194
    u
    • 2
    • 1
  • e

    efemoney

    04/14/2025, 4:51 PM
    I want to submit a PR to allow
    AbstractLongTimeSource
    (https://github.com/JetBrains/kotlin/blob/c56893d9c2c9be51df78acf98e6b6984b10407c5/libraries/stdlib/src/kotlin/time/TimeSources.kt#L28) &
    AbstractDoubleTimeSource
    be able to provide
    TimeMark
    s for _reading_s done outside of the time source. This is useful if you already have some readings you want to convert into time marks to be able to easily do duration calculations or interface with some other system that did those readings already. For example
    Copy code
    object UptimeMillisSource : AbstractLongTimeSource {
      override fun read() = SystemClock.uptimeMillis()
    }
    If I already have readings of
    SystemClock.uptimeMillis()
    from another system, I should be able to call:
    Copy code
    UptimeMillisSource.[ timeMarkOf | readingOf | readingToTimeMark | convert ](some: Long): TimeMark
    Any thoughts or I go ahead & submit a PR?
    j
    • 2
    • 2
  • a

    ankur samarya

    04/18/2025, 7:15 PM
    Hi Everyone, out of curiosity, I have a question. Why does Kotlin use eager initialization for object classes internally? Can someone share the design rationale behind choosing this approach over double-checked locking?
    e
    • 2
    • 5
  • r

    Ruslan Sakevych

    05/01/2025, 10:53 PM
    Hi! We've had a modified version of
    .zip
    function that errors if collection sizes differ (we call it
    .zipSameSize
    in our codebase @ Google) for some time now. It seems to be useful from the readability point of view. Most of the time ppl seem to zip equally sized collections and it would be erroneous situation if it was not the case, hence throw an exception. How do I go about trying to contribute this to the standard library?
    f
    • 2
    • 2