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

[infra] Use kotlin standard libraries from the toolchain, as opposed to hard coded. #1225

Merged
merged 14 commits into from
Oct 9, 2024

Conversation

restingbull
Copy link
Collaborator

@restingbull restingbull commented Oct 4, 2024

Modifies the toolchain to provide a common set of stdlib for the builder and jdeps merger via the classpath advice on a java binary.

Also extends the examples/trivial to validate the built binary executes as part of testing the java/kotlin integration.

Aside from improving correctness, the hope is that this will fix the link error seen when upgrading to newer versions of kotlinc.

@restingbull restingbull force-pushed the restingbull-keep-metadata branch from 459be1f to 22c1cff Compare October 5, 2024 23:07
@restingbull restingbull marked this pull request as ready for review October 5, 2024 23:42
@restingbull restingbull requested a review from Bencodes October 5, 2024 23:42
@@ -27,3 +27,16 @@ ktlint_config(
experimental_rules_enabled = False,
visibility = ["//visibility:public"],
)

sh_test(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a skylib macro for this that asserts if something builds.

Probably worth using just to minimize the surface area of rules Kotlin a bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to run to test it. Building is easy -- but the kotlin/jvm integration will only fail if it doesn't run.

@restingbull restingbull changed the title [infra] Make stdlibs taken from the toolchain. [infra] Use kotlin standard libraries from the toolchain, as opposed to hard coded. Oct 6, 2024
@restingbull restingbull requested a review from Bencodes October 6, 2024 04:18
@@ -122,7 +126,7 @@ _kt_toolchain = rule(
),
"language_version": attr.string(
doc = "this is the -language_version flag [see](https://kotlinlang.org/docs/reference/compatibility.html)",
default = "2.0",
default = "1.9",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we going back to an older version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't merge?

@restingbull restingbull merged commit e51619c into master Oct 9, 2024
2 checks passed
@restingbull restingbull deleted the restingbull-keep-metadata branch October 9, 2024 23:29
@agluszak
Copy link
Contributor

Aside from improving correctness, the hope is that this will fix the link error seen when upgrading to newer versions of kotlinc.

Yes, this seems to work!

@agluszak
Copy link
Contributor

master...agluszak:agluszak/fix I got 2.0 working in this branch!

this is //:rules_kotlin_release from master, needed for bootstrapping

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

Successfully merging this pull request may close these issues.

4 participants