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

plugin option added twice #2708

Closed
tgodzik opened this issue Jan 31, 2024 · 14 comments · Fixed by #3151
Closed

plugin option added twice #2708

tgodzik opened this issue Jan 31, 2024 · 14 comments · Fixed by #3151
Labels
bug Something isn't working

Comments

@tgodzik
Copy link
Member

tgodzik commented Jan 31, 2024

Version(s)
1.1.2

Describe the bug
When using:

//project.scala
//> using plugin "org.virtuslab::besom-compiler-plugin:0.1.1-SNAPSHOT"

the plugin option is sometimes added twice, but it doesn't seem to reproduce always/

Expected behaviour
Plugin option is added once.

@tgodzik tgodzik added the bug Something isn't working label Jan 31, 2024
@Gedochao
Copy link
Contributor

Gedochao commented Feb 1, 2024

may be related to #2621, as I never really got it working stably with Bloop... 🤔
@tgodzik is it reproducible with --server=false?

@lbialy
Copy link

lbialy commented Feb 1, 2024

--server=false does not generate bloop's json files I'm afraid

@Gedochao
Copy link
Contributor

Gedochao commented Feb 2, 2024

--server=false does not generate bloop's json files I'm afraid

@lbialy but it does pass plugin options to the compiler

@lbialy
Copy link

lbialy commented Feb 2, 2024

There never was any issue with compilation by scala-cli, the error crashes metals and metals only.

@lbialy
Copy link

lbialy commented Feb 2, 2024

Passed you a repro with minimization via slack.

@keynmol
Copy link
Contributor

keynmol commented Mar 28, 2024

Tomasz suggests that this is what breaks Metals for me, diagnostics not being delivered.

//> using scala "3.3.3"
//> using options -Werror -Wunused:all -Wvalue-discard -Wnonunit-statement
//> using plugin "org.virtuslab::besom-compiler-plugin:0.2.2"
//> using dep "org.virtuslab::besom-core:0.2.2"
//> using dep "org.virtuslab::besom-aws:6.23.0-core.0.2"
//> using dep "org.virtuslab::besom-awsx:2.5.0-core.0.2"

import besom.*
import besom.api.aws, besom.api.awsx

@main def main = Pulumi.run {
  val bucket =
    // THIS IS AN ERROR        v  <---- over here
    aws.s3.Bucket("my-bucket", ws.s3.BucketArgs(forceDestroy = true))

  Stack.exports(
    bucketName = bucket.bucket
  )

}

CleanShot 2024-03-28 at 09 25 06

CleanShot 2024-03-28 at 09 30 28@2x

@lbialy
Copy link

lbialy commented Mar 28, 2024 via email

@pawelprazak
Copy link

Yeah, this is a massive pita for us. Two things actually trigger this. Compiler plugin is one thing. Second is //> using options -language:noAutoTupling No idea if this is the same problem or a completely different one.

I've seen also this being trigerred by -encoding:utf-8

tgodzik added a commit to tgodzik/scala-cli that referenced this issue Aug 30, 2024
I am still getting an issue with multiple same plugin options and my guess is that the distinct doesn't work, especially that it is hard to figure out what can actually be contained there. Moving distinct to the end should be a much safer option.

Related to VirtusLab#2708
Gedochao pushed a commit that referenced this issue Sep 2, 2024
I am still getting an issue with multiple same plugin options and my guess is that the distinct doesn't work, especially that it is hard to figure out what can actually be contained there. Moving distinct to the end should be a much safer option.

Related to #2708
@tgodzik
Copy link
Member Author

tgodzik commented Sep 2, 2024

After merging #3139 I think this should not happen again, we can revisit this in a couple of months to see it this happened for anyone

@lbialy
Copy link

lbialy commented Sep 2, 2024

I can test this immediately as besom compiler plugin breaks any scala-cli build, how can I download a nightly version of scala-cli?

@Gedochao
Copy link
Contributor

Gedochao commented Sep 3, 2024

how can I download a nightly version of scala-cli?

@lbialy

scala-cli --cli-version nightly

Or alternatively, just use artifacts from https://github.com/VirtusLab/scala-cli/releases/tag/nightly (just make sure the relevant changes were included there already)

@lbialy
Copy link

lbialy commented Sep 4, 2024

Confirmed this solves duplicate plugin problem, at least for main scope. Test scope shows "does not compile" without any actual compilation problems in cli.

@tgodzik
Copy link
Member Author

tgodzik commented Sep 4, 2024

Do you have reproduction we can use?

@lbialy
Copy link

lbialy commented Sep 4, 2024

no, not really, I just tested in besom core and besom examples, besom core has tests and uses another option that caused the same problem, the one that disables autotupling.

tgodzik added a commit to tgodzik/scala-cli that referenced this issue Sep 5, 2024
Fixes VirtusLab#2708

Previously, for some of the options we would not deduplicate at all instead of using the full value.
Now, for keys that can be added multiple times with different values we deduplicate the full option.
tgodzik added a commit to tgodzik/scala-cli that referenced this issue Sep 5, 2024
Fixes VirtusLab#2708

Previously, for some of the options we would not deduplicate at all instead of using the full value.
Now, for keys that can be added multiple times with different values we deduplicate the full option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants