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

Explore the possibility to emit compiler warnings for missing javalib classes #3886

Open
keynmol opened this issue Apr 18, 2024 · 1 comment
Labels

Comments

@keynmol
Copy link
Contributor

keynmol commented Apr 18, 2024

I'm not sure how exactly this can be achieved, but it would be beneficial to emit a specialised warning for packages/definitions SN doesn't have on its own (NIR) classpath.

This should make the experience better for cross-compiling codebases.

Simple package check will likely not suffice, as we have shims like this shipped in separate libraries and likely will have more of those

@WojciechMazur
Copy link
Contributor

Good idea!
The only way how we could be sure that symbols exists would be to check if javalib for given Scala Native version contains them. Compiler plugin itself cannot have classpath dependenices (that's why the nir/util projects are embedded into the compiler plugin using extra source dependencies).
I think we can do it other way around - we can create an sbt/mill plugin that would inspect the generated NIR files for any symbols that are not defined after the compilation. It could use existing mechanism for checking NIR that we use after classloading in the SN toolchain.

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

No branches or pull requests

2 participants