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

Compile-time shapeless in runtime-compiler #9805

Merged
merged 1 commit into from
Apr 29, 2024
Merged

Conversation

hubertp
Copy link
Contributor

@hubertp hubertp commented Apr 27, 2024

Pull Request Description

Marking the shapeless dependency as compile-time only.

Important Notes

If we want to ditch the dependency completely then, if we want to keep the check in place, we would have to replace with its runtime equivalent:

--- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/IRPass.scala
+++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/IRPass.scala
@@ -148,6 +148,9 @@ object IRPass {
     def unsafeAs[T <: Metadata: ClassTag]: T = {
+      if (implicitly[ClassTag[T]].runtimeClass == Metadata.getClass) {
+        throw new InternalError("Type argument must be specified")
+      }

Not sure if we want to do it still after this change.

Note that project-manager uses that and some other definitions as well.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.

Marking the `shapeless` dependency as compile-time only.
@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Apr 27, 2024
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a licensing change? If the library is really excluded from engine, then it should affect the final license of the engine, shouldn't it?

@Akirathan
Copy link
Member

Shouldn't there be a licensing change? If the library is really excluded from engine, then it should affect the final license of the engine, shouldn't it?

@JaroslavTulach The dependency scope was change to provided. According to the docs, it just marks the shapeless lib to be put on class-path during compilation, and not explicitly at runtime. So I believe the shapeless is still somewhere in our distribution component directory.

@hubertp
Copy link
Contributor Author

hubertp commented Apr 29, 2024

Yes, circe adds those.
deps.txt

and for runtime-jar:
runtime-jar.txt

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Apr 29, 2024
@mergify mergify bot merged commit 25224a8 into develop Apr 29, 2024
35 of 37 checks passed
@mergify mergify bot deleted the wip/hubert/shapeless-dep branch April 29, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants