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

Generate only one build target for main and test scope #550

Merged
merged 3 commits into from
Jan 28, 2022

Conversation

lwronski
Copy link
Contributor

@lwronski lwronski commented Jan 17, 2022

No description provided.

@lwronski lwronski force-pushed the project-name-bloop branch 5 times, most recently from 18b4204 to f6b7bd0 Compare January 24, 2022 11:53
@lwronski lwronski force-pushed the project-name-bloop branch 3 times, most recently from 4f06f22 to 13b8d23 Compare January 25, 2022 12:45
@lwronski lwronski marked this pull request as ready for review January 25, 2022 13:11
@lwronski lwronski force-pushed the project-name-bloop branch 3 times, most recently from 2752428 to 72935e3 Compare January 26, 2022 08:55
@@ -255,13 +259,29 @@ object Build {
(mainBuild, extraBuilds)
}

def doPostProcess(build: Seq[Build], scope: Scope) = build.collect {
Copy link
Member

Choose a reason for hiding this comment

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

Should we ignore errors from post process?

Also a small nit, you can combine collect and map into one call

@lwronski lwronski force-pushed the project-name-bloop branch 3 times, most recently from 0029cd8 to 2c9aada Compare January 26, 2022 14:37
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

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

I'm still unsure what these changes do precisely, but if the CI is green, I guess it's fine.

modules/build/src/main/scala/scala/build/Build.scala Outdated Show resolved Hide resolved
@lwronski
Copy link
Contributor Author

I'm still unsure what these changes do precisely, but if the CI is green, I guess it's fine.

  1. I want to generate a build hash based only on the main scope. Previously, in test scope hash was different, because scala-cli added mainClassPath to testBuildOptions. Therefore, I move building scopes to one method and count hash only once.

  2. Moving postProcess method to build method - after building main scope, postProcess method move semanticdb files from:
    $project-name/META-INF/semanticdb/.scala-build/project_4955484392-7cfa0b230b/src_generated/main/simple.scala.semanticdb,
    to $project-name/META-INF/semanticdb/simple.sc.semanticdb. And then, we run building test scope which is dependent from main scope, and in this cases, Bloop see that main target was changed, so it compile again. Therefore, I moved running post process method into build method.

@alexarchambault
Copy link
Contributor

  1. I want to generate a build hash based only on the main scope. Previously, in test scope hash was different, because scala-cli added mainClassPath to testBuildOptions. Therefore, I move building scopes to one method and count hash only once.

This works only if no test-specific options are enabled, right? (like //> using options "-Xasync" added in a *.test.scala file) If not, that means if users change test-specific options manually, an already on-going build and a new one picking the new options might clash (because they'd use the same project directory, only based on the options from the main scope).

@alexarchambault
Copy link
Contributor

Ok, I saw the test options taken into account when computing the project hash… :)

@romanowski romanowski merged commit 1d96a91 into VirtusLab:master Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants