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

Fix scalaInstanceFromBloop in boostrapped server #774

Merged
merged 1 commit into from
Dec 29, 2018
Merged

Conversation

jvican
Copy link
Contributor

@jvican jvican commented Dec 29, 2018

When coursier bootstraps bloop, the code source location for the classes
has an unknown scheme that trips the creation of the scala instance.

This error only happens when coursier boostraps, as it inlines all jars
in a zip that is then inlined in a shell script; there's no notion of
independent jars we can use to instantiate a scala instance. To fix
this problem, we detect this error and add a fallback mechanism where:

  1. We get the scheme specific part and read the content stream.
  2. Copy the content stream to an independent file that we then use to
    instantiate an scala instance.

We don't add tests for this improvement because it's a rare error enough
that would need a lot of test instrumentation to test reliably. Local
testing confirms that compiling java only projects with no scala
instance defined works now in systems where bloop is boostrapped.

When coursier bootstraps bloop, the code source location for the classes
has an unknown scheme that trips the creation of the scala instance.

This error only happens when coursier boostraps, as it inlines all jars
in a jar file that is inlined in a shell script, and there's no notion
of independent jars we can use to instantiate a scala instance. To fix
this problem, we detect this error and add a fallback mechanism where:

1. We get the scheme specific part and read the content stream.
2. Copy the content stream to an independent file that we then use to
   instantiate an scala instance.

We don't add tests for this improvement because it's a rare error enough
that would need a lot of test instrumentation to test reliably. Local
testing confirms that compiling java only projects with no scala
instance defined works now in systems where bloop is boostrapped.
@jvican jvican added bug A defect or misbehaviour. task / compile labels Dec 29, 2018
@jvican
Copy link
Contributor Author

jvican commented Dec 29, 2018

Reported by @Arthurm1 in Gitter https://gitter.im/scalacenter/bloop?at=5c20eb9e6649aa1f82c3cf1d, thank you!

@jvican jvican merged commit f222ff1 into master Dec 29, 2018
@tgodzik tgodzik deleted the topic/java-only branch September 7, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. task / compile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant