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

Add support for packagePrefix #1183

Merged
merged 2 commits into from Mar 15, 2020
Merged

Conversation

lukaszwawrzyk
Copy link
Contributor

@lukaszwawrzyk lukaszwawrzyk commented Feb 27, 2020

See build-server-protocol/build-server-protocol#109 for details

I added packagePrefix at project/build target level. Not sure if it should be more granular, and if so, where exactly it should be located as we have sources that is a list of files or dirs but also sourceGlobs. Sources seems to usually contain specific files, attaching packagePrefix to each of these would be quite strange.

@lukaszwawrzyk
Copy link
Contributor Author

@jvican Could you take a look at this PR and let me know if it makes sense from bloops perspective, and if not what would be the reasonable place to put the package prefix field?

@jvican
Copy link
Contributor

jvican commented Mar 12, 2020

Will have a look at this shortly @lukaszwawrzyk

@@ -234,6 +234,7 @@ object Config {
workspaceDir: Option[Path],
sources: List[Path],
sourcesGlobs: Option[List[SourcesGlobs]],
sourceRoots: Option[List[String]],
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be Option[List[Path]]?

Copy link
Contributor

Choose a reason for hiding this comment

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

Even if bloop doesn't need this typed as a Path, I believe it's more readable for clients using bloop-config that this should be a path and not a random string. Additionally, Path uses structural sharing resulting in lower memory usage.

Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Thank you for updating the PR! One comment, otherwise looks good to me

@@ -234,6 +234,7 @@ object Config {
workspaceDir: Option[Path],
sources: List[Path],
sourcesGlobs: Option[List[SourcesGlobs]],
sourceRoots: Option[List[String]],
Copy link
Contributor

Choose a reason for hiding this comment

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

Even if bloop doesn't need this typed as a Path, I believe it's more readable for clients using bloop-config that this should be a path and not a random string. Additionally, Path uses structural sharing resulting in lower memory usage.

@@ -13,7 +13,7 @@ object Dependencies {
val nailgunCommit = "a2520c1e"

val zincVersion = "1.3.0-M4+32-b1accb96"
val bspVersion = "2.0.0-M5"
val bspVersion = "2.0.0-M5+1-e75ba0aa" // TODO bump bsp to make it compile
Copy link
Contributor

Choose a reason for hiding this comment

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

The release is out now

Suggested change
val bspVersion = "2.0.0-M5+1-e75ba0aa" // TODO bump bsp to make it compile
val bspVersion = "2.0.0-M7" // TODO bump bsp to make it compile

Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Ideally it would be great to have tests with a change like this but this new field is not relevant for sbt, mill, maven or gradle. We should consider using something like QuickBuild from Metals that generates a multi-project build from a single high-level JSON file

https://github.com/scalameta/metals/blob/f4979f7d7675d3ec483ec1af2168be528dca3216/tests/unit/src/main/scala/tests/QuickBuild.scala

I'm not sure if we should block this PR on tests however. What do you think @jvican?

@olafurpg
Copy link
Contributor

The Windows CI failure looks unrelated

 (error,Server disconnected unexpectedly: [WinError 10053] An established connection was aborted by the software in your host machine)
  bloop.nailgun.NailgunTestUtils$Client.expectSuccess(NailgunTestUtils.scala:226)

Copy link
Contributor

@jvican jvican left a comment

Choose a reason for hiding this comment

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

LGTM @lukaszwawrzyk 👍 Thanks for doing this.

@jvican
Copy link
Contributor

jvican commented Mar 15, 2020

I'm not sure if we should block this PR on tests however. What do you think @jvican?

We can go ahead and merge, no problem. I encourage @lukaszwawrzyk to add some tests for this when he's implemented it; the more tested every feature is the better.

@jvican jvican merged commit 70cfd9e into scalacenter:master Mar 15, 2020
@jvican jvican added build server Any issue or pull request that has to do with hot compilers or BSP. feature labels Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build server Any issue or pull request that has to do with hot compilers or BSP. feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants