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

bughack: Force specific Scala 3 compiler for worksheets #4153

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Jul 14, 2022

Mdoc is currently being released for Scala 3.1.x, which means that if we use mdoc for worksheets it will not be able to run with a classpath containing any Scala 3.2.0 code. However, since mdoc should be comptable with any future Scala 3 version, we can force a later compiler version to run with it.

This efectively fixes the worksheet issue for later Scala 3 versions. That is until the interfaces change, but hopefully we use a very limited api, so this should never be an issue.

Fixes #4138

Mdoc is currently being released for Scala 3.1.x, which means that if we use mdoc for worksheets it will not be able to run with a classpath containing any Scala 3.2.0 code. However, since mdoc should be comptable with any future Scala 3 version, we can force a later compiler version to run with it.

This efectively fixes the worksheet issue for later Scala 3 versions. That is until the interfaces change, but hopefully we use a very limited api, so this should never be an issue.

Fixes scalameta#4138
@tgodzik tgodzik requested review from dos65, ckipp01 and kpodsiad July 14, 2022 14:17
Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

It looks like a valid workaround for metals. 🤔

However, I'm wondering what to do with mdoc. I suppose, projects that will switch on 3.2.x won't be able to work with mdoc if they have some custom modifiers.

@tgodzik
Copy link
Contributor Author

tgodzik commented Jul 17, 2022

Already got it working with a similar workaround in scalameta/mdoc#669

Copy link
Member

@dos65 dos65 left a comment

Choose a reason for hiding this comment

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

Ok, lets try this way

@tgodzik
Copy link
Contributor Author

tgodzik commented Jul 18, 2022

Ok, lets try this way

The only alternative is releasing for each binary version, which I would like to avoid 😅

@tgodzik tgodzik merged commit b40de1a into scalameta:main Jul 18, 2022
@tgodzik tgodzik deleted the force-compiler-version branch July 18, 2022 12:05
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.

Metals worksheet broken?
2 participants