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

Use linker version set in Bloop configuration #1062

Closed
tindzk opened this issue Oct 11, 2019 · 7 comments · Fixed by #1097
Closed

Use linker version set in Bloop configuration #1062

tindzk opened this issue Oct 11, 2019 · 7 comments · Fixed by #1097

Comments

@tindzk
Copy link
Contributor

tindzk commented Oct 11, 2019

When a library was compiled with a newer Scala.js version than the one used by Bloop, the module cannot be linked.

For example, sparsetech/toml-scala#16 fails as it updates ScalaCheck from 1.14.0 to 1.14.2 which was compiled for Scala.js 0.6.29, however the linker version used by Bloop is 0.6.28. From the CI log:

[E] JavaScript linking failed with 'Failed to deserialize info of file compiled with Scala.js 0.6.29 (supported: 0.6.0, 0.6.13, 0.6.3, 0.6.17, 0.6.4, 0.6.6, 0.6.14, 0.6.8, 0.6.5, 0.6.15): /drone/src/build/bloop/toml-js-test/toml/CodecSpec$$anonfun$75$Root$101.sjsir'

In any case, the linker version set in the Bloop configuration should be honoured as this would allow users to downgrade in case of regressions.

tindzk added a commit to sparsetech/toml-scala that referenced this issue Oct 11, 2019
This only updates the dependencies of the sbt build since Bloop is
incompatible with Scala.js 0.6.29.

See also scalacenter/bloop#1062
@jvican
Copy link
Contributor

jvican commented Nov 1, 2019

Hi @tindzk, how do you expect this to work? An actionable thing out of this ticket is to upgrade to the latest Scala.js version, however I'm not sure how you envision Bloop would behave here.

@tindzk
Copy link
Contributor Author

tindzk commented Nov 1, 2019

It should be possible to resolve the linker during runtime. This is how Mill does it.

@jvican
Copy link
Contributor

jvican commented Nov 1, 2019

Could you look into how we can use a similar trick in bloop?

@tindzk
Copy link
Contributor Author

tindzk commented Nov 2, 2019

Yes, I will try to come up with something in the next few days.

@jvican
Copy link
Contributor

jvican commented Nov 8, 2019

Great! Let me know how you want to implement this, I'm curious to know how you're thinking about this and would like to provide some early feedback.

@tindzk
Copy link
Contributor Author

tindzk commented Nov 16, 2019

Unfortunately, I did not manage to run the test cases yet. I checked out the latest master and ran these commands as per the documentation:

sbt bloopInstall
bloop test frontend -o bloop.JsTestSpec

The output indicates that the bridge is missing.

Here are the changes I would like to make:

  • Use the provided scope for linker artefacts in Dependencies.scala
  • In fromConfig (Project.scala), the resolveToolchain() calls should include the platform version
  • Change resolveJars() in ToolchainCompanion.scala to resolve additional artefacts

@jvican
Copy link
Contributor

jvican commented Nov 16, 2019

You need to publish the js bridges manually every time you make a change in them or the version of the build changes (which happens roughly every time you reload the sbt shell or quit it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants