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

Create explicit compiler env #4079

Merged
merged 10 commits into from
Apr 25, 2023
Merged

Create explicit compiler env #4079

merged 10 commits into from
Apr 25, 2023

Conversation

hfhbd
Copy link
Collaborator

@hfhbd hfhbd commented Apr 21, 2023

Fixes #3896
Fixes #3644
Fixes #4088

There is also a new migration-env containing the sqlite-jdbc driver for the verify migration task.

archiveClassifier.set("")
configurations = [project.configurations.shadow]

minimize {
Copy link
Collaborator Author

@hfhbd hfhbd Apr 21, 2023

Choose a reason for hiding this comment

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

Todo: tune this list to reduce the size of the shaded artifact, currently 43 MB. (Just to compare, Kotlin is 52 MB: https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.8.20)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With shadow, further size reduction is not possible, because shadow uses artifacts to minimize jars. The biggest jars are lang-impl (19 MB) and ide-impl (18 MB). The resulting jar is still 43 MB, but without minimizing it is 67 MB.

Copy link
Collaborator

@AlecKazakova AlecKazakova left a comment

Choose a reason for hiding this comment

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

Holy shit this is so much nicer, THANK YOU

@hfhbd hfhbd merged commit 91b92a4 into master Apr 25, 2023
6 checks passed
@hfhbd hfhbd deleted the hfhbd/intellij-env branch April 25, 2023 12:19
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one I don't quite understand, we weren't shading it before, were there issues with that setup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just want to remove all dependencies from the Gradle plugin to have a clean classpath. There is no reason to have JDBC driver on the Gradle classpath.

Copy link
Collaborator

Choose a reason for hiding this comment

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

with the JDBC driver specifically it may cause issues if someone currently has a setup where the override the xerial sqlite version locally to test their migrations on a different sqlite version

Copy link
Collaborator Author

@hfhbd hfhbd Apr 25, 2023

Choose a reason for hiding this comment

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

Yeah, but now the user just needs to overwrite the version explicitly using the configuration and dependencies:

// build.gradle.kts
val fooDB by sqldelight.databases.registering {
  dialect("sqlite")...
}

dependencies {
  fooDB.configurationName("my-special-sqlite-driver")
}

Or use similar groovy syntax.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And with classloader isolation, which is enabled since 2.0.0: 077837a#diff-202cb8a4767ef0496a1551b59461db6625ca9aad2ddf92fefc467a07887cfe01, this is the only option to overwrite the driver, or do I miss something?

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