Skip to content

Pin kotlin to latest version(2.1.21) #12442

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sureshe456
Copy link
Contributor

Description

  1. Pin kotlin to latest version(2.1.21)
  2. In Kotlin 2.x,Run kapt with -Kapt-mode=stubsAndApt and use kotlinc for the final compilation step.
  3. In Kotlin 2.x, kotlinc-js requires additional arguments, even when checking versions. Simply running kotlinc-js -version now fails unless other required options are provided.

Related issue:

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

@sureshe456 sureshe456 marked this pull request as ready for review July 8, 2025 08:47
@Copilot Copilot AI review requested due to automatic review settings July 8, 2025 08:47
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR pins Kotlin to version 2.1.21 and updates the macOS tooling tests to work with Kotlin 2.x, adjusting kapt and kotlinc-js invocations.

  • Refactor tests to explicitly invoke each Kotlin tool with the correct flags for version 2.x.
  • Remove custom Homebrew bottle pinning for Kotlin in favor of the default latest installation.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
images/macos/scripts/tests/BasicTools.Tests.ps1 Replace generic TestCases loop with individual It blocks and update Kotlin tool flags.
images/macos/scripts/build/install-common-utils.sh Comment out custom Kotlin pinning logic so Homebrew installs the default latest version.

Comment on lines +132 to +139
#Describe "Kotlin" {
#$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlinc-jvm", "kotlinc-js")

#It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
#"$toolName -version" | Should -ReturnZeroExitCode
#}
#}

Copy link
Preview

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

The commented-out generic Describe "Kotlin" block and associated lines can be removed to clean up dead code and avoid confusion.

Suggested change
#Describe "Kotlin" {
#$kotlinPackages = @("kapt", "kotlin", "kotlinc", "kotlinc-jvm", "kotlinc-js")
#It "<toolName> is available" -TestCases ($kotlinPackages | ForEach-Object { @{ toolName = $_ } }) {
#"$toolName -version" | Should -ReturnZeroExitCode
#}
#}
# (Removed the commented-out block entirely)

Copilot uses AI. Check for mistakes.

Comment on lines +18 to +25
#kotlin)
# Pin kotlin bottle to 2.1.10 due to an issue with the latest version
# https://youtrack.jetbrains.com/issue/KT-76169/kotlinc-js-version-and-kapt-version-returning-non-zero-status-code-on-v2.1.20
kotlin_commit="442af88a2925f8c0e079eaf4fa62261133d2d7c4"
kotlin_rb_link="https://raw.githubusercontent.com/Homebrew/homebrew-core/$kotlin_commit/Formula/k/kotlin.rb"
kotlin_rb_path=$(download_with_retry "$kotlin_rb_link")
brew install "$kotlin_rb_path"
;;
#kotlin_commit="442af88a2925f8c0e079eaf4fa62261133d2d7c4"
#kotlin_rb_link="https://raw.githubusercontent.com/Homebrew/homebrew-core/$kotlin_commit/Formula/k/kotlin.rb"
#kotlin_rb_path=$(download_with_retry "$kotlin_rb_link")
#brew install "$kotlin_rb_path"
#;;
Copy link
Preview

Copilot AI Jul 8, 2025

Choose a reason for hiding this comment

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

[nitpick] Instead of commenting out the entire Kotlin case, consider removing these commented lines or adding a note explaining that the default Homebrew install will now be used, to keep the script concise.

Copilot uses AI. Check for mistakes.

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.

1 participant