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

Passing the Java property into Scala CLI should also pass it into BSP #2019

Closed
lwronski opened this issue Apr 7, 2023 · 1 comment · Fixed by #3169
Closed

Passing the Java property into Scala CLI should also pass it into BSP #2019

lwronski opened this issue Apr 7, 2023 · 1 comment · Fixed by #3169
Assignees
Labels
bsp Issues tied to the implementation of BSP (Build Server Protocol) bug Something isn't working

Comments

@lwronski
Copy link
Contributor

lwronski commented Apr 7, 2023

Version(s)
0.2.1

Describe the bug
Passing the Java property into Scala CLI should also pass it into BSP.

To Reproduce
First run of Scala CLI should create a BSP setup in which -Dfoo=bar properties are also set as Java properties for the Scala CLI BSP command.

scala-cli -Dfoo=bar run .

so it should create scala-cli.json with the following content:

{
  "name": "scala-cli",
  "argv": [
    "/usr/local/bin/scala-cli",
    "-Dfoo=bar",
    "bsp",
    "--json-options",
    "/private/tmp/scala-demo/.scala-build/ide-options-v2.json",
    "/private/tmp/scala-demo"
  ],
  "version": "0.2.1",
  "bspVersion": "2.1.0-M3",
  "languages": [
    "scala",
    "java"
  ]

Expected behaviour
It should also work with the setup-ide command.

@lwronski lwronski added the bug Something isn't working label Apr 7, 2023
@przemek-pokrywka
Copy link

First run of Scala CLI should

what about the second and subsequent runs?

If we only support the first run, then we will run into bad DX in the following scenario:

  1. user starts to play with the first version of their script: scala-cli run ., the scala-cli.json gets generated
  2. user recognizes, that they want to add a critical JVM property (for example: -Djavax.net.ssl.trustStore=mycompanycerts in order for scala-cli to be able to fetch some dependencies from their company-internal Nexus repository)
  3. does scala-cli.json stay as it was? Because if it does, then the instance of scala-cli is unable to fetch the required dependencies because of a javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target exception (caused by the lack of the required certificate from the default cacerts/truststore file). Should the user be forced to search the web for a solution and then to update the scala-cli.json file by hand?

@Gedochao Gedochao added the bsp Issues tied to the implementation of BSP (Build Server Protocol) label Jun 17, 2024
@Gedochao Gedochao self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bsp Issues tied to the implementation of BSP (Build Server Protocol) bug Something isn't working
Projects
Status: Done
3 participants