Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "-opt-in": Build results in "warning: '-Xuse-experimental' is deprecated..." #687

Closed
brettwooldridge opened this issue Feb 25, 2022 · 2 comments

Comments

@brettwooldridge
Copy link
Contributor

I am converting a project from Buck to Bazel, and it is mostly going smoothly, but build is emitting this warning:

INFO: From KotlinCompile //netld/org.ziptie.net:com-dancer-net { kt: 4, java: 30, srcjars: 0 } for darwin:
warning: '-Xuse-experimental' is deprecated and will be removed in a future release

My toolchain config looks like this:

load("@io_bazel_rules_kotlin//kotlin:core.bzl", "define_kt_toolchain")

define_kt_toolchain(
    name = "kotlin_toolchain",
    api_version = "1.5",
    jvm_target = "11",
    language_version = "1.5",
)

Running kotlin -version on the CLI returns:

Kotlin version 1.5.31-release-548 (JRE 17.0.2+8-LTS-86)

How can I get rid of the '-Xuse-experimental' warning?

@brettwooldridge
Copy link
Contributor Author

Replying to myself. This seems to eliminate the warning:

kt_kotlinc_options(
    name = "kt_kotlinc_options",
    x_use_experimental = False,
)

define_kt_toolchain(
    name = "kotlin_toolchain",
    api_version = "1.4",
    jvm_target = "11",
    kotlinc_options = "//:kt_kotlinc_options",
    language_version = "1.4",
)

However, this may turn off needed features. Kotlin is apparently now using -opt-in from 1.6 and -Xopt-in in earlier versions.

https://kotlinlang.org/docs/opt-in-requirements.html

@brettwooldridge brettwooldridge changed the title Every build results in "warning: '-Xuse-experimental' is deprecated..." Support "-opt-in": Build results in "warning: '-Xuse-experimental' is deprecated..." Feb 25, 2022
@Kernald
Copy link
Contributor

Kernald commented Mar 4, 2022

See #676.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants