Skip to content

[1.x] Remove direct dependency on org.fusesource.jansi #7876

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

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

Friendseeker
Copy link
Member

@Friendseeker Friendseeker commented Nov 8, 2024

Motivation

  • Jansi development is inactive, with its last update all the way back in Oct 12, 2023
  • Jansi contains native code
  • sbt does not use Jansi all that much

Also recent Jansi-related tickets such as #7865 would not exist if we do not depend on org.fusesource.jansi.

Changes

  • Remove the usage of org.fusesource.jansi.AnsiConsole in sbt thin client
    • Since Windows 10 introduced ANSI support, org.fusesource.jansi.AnsiConsole is no longer necessary on Windows.
  • Remove the usage of Jansi's JNI methods, replacing them with equivalent methods from JLine3.

Addressing diamond dependency & sbtn build concern

Eugene pointed out that changing a dependency containing native code may cause breakage if

  • downstream of sbt uses the same dependency
    • historically diamond JLine dependency had broken sbt console
  • sbtn build may fail & become nonfunctional

This PR addresses the concern by testing sbtn console on a sample Scala 2.12.20, Scala 2.13.15 and Scala 3.3.4 project, against a sbtn executable built against the PR branch. No regression is identified.

Windows

image

Mac

Terminal used: IntelliJ IDE Terminal

3.3.4
image

2.13.15
image

2.12.20
image

Supersedes #7872

@Friendseeker Friendseeker changed the title [1.x] Remove dependency on org.fusesource.jansi [1.x] Remove direct dependency on org.fusesource.jansi Nov 8, 2024
@Friendseeker Friendseeker marked this pull request as ready for review November 15, 2024 08:30
@Friendseeker
Copy link
Member Author

Also opened #7877 (same PR but targeting 2.x branch) so if the reviewers decide that this change belongs to 2.x branch better we can merge #7877 and close #7876.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n eed3si9n merged commit 069ed90 into sbt:1.10.x Nov 17, 2024
10 checks passed
@Friendseeker Friendseeker deleted the remove-jansi branch November 17, 2024 05:26
@Friendseeker Friendseeker mentioned this pull request Nov 17, 2024
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.

2 participants