bloop icon indicating copy to clipboard operation
bloop copied to clipboard

Gradle bloopInstall produces absolute paths, could they be relative?

Open aishfenton opened this issue 4 years ago • 5 comments

Gradle bloopInstall produces absolute paths, could they be relative to the project root directory instead? This would unlock a few things :

  • Potentially checking the exported files into source control. So as folks switch between branches, they don't have to re-export each time
  • Supporting Gradle's remote cache functionality.

For context, why the above two items feel important for our project, is that it's pretty huge (38 sub-proejcts in one repo ... you could say, it's a mini mono repo). And currently the most painful part of our process is re-exporting to Bloop between every branch switch (which for a big project like ours, can take ~15mins 😞 )

aishfenton avatar Nov 05 '21 16:11 aishfenton

Thanks for reporting! This might actually be related to the version of Zinc that is being used by Bloop.

Related issues: https://github.com/scalacenter/bloop/issues/1351

I will work on migrating to newest zinc next week, which could unblock this possibly.

Anyway, this is a great suggestion and hopefully should be possible.

tgodzik avatar Nov 05 '21 16:11 tgodzik

hmm, I guess another problem is that the Gralde cache could at different locations, on different machines. Hmm, I wonder if there's a way to work around this.

[update] Although, at least if we can make the paths relative, it's possible for us to configure Gradle to always use a consistent location for it's cache, across machines.

aishfenton avatar Nov 05 '21 16:11 aishfenton

I don't know why the export should take anywhere near that long. I've had to create test projects with 100s of subprojects and BloopInstall has only taken 10s to run.

Have you got source generation going on that's triggering on every export? Some task that's being triggered due to us reading the classpath? Or is this 15mins down to downloading dependencies

Adding an option to change the absolute paths in the json output to relative is fairly simple. Although I have no idea if Bloop itself can handle relative paths.

One way to cope with the various Gradle cache locations is to output the locations using the GRADLE_USER_HOME env var. Again - I don't know whether Bloop would handle env vars in paths.

Arthurm1 avatar Nov 05 '21 17:11 Arthurm1

Yeah, I'm not sure either why it's such a long task. No, pretty sure we're not doing anything like code gen there. My guess is our dependency graph is just extremely big (unfortunately unavoidable in our situation). The generated Json files are ~200MB so I'm thinking we really do just have a lot of dependencies.

aishfenton avatar Nov 05 '21 18:11 aishfenton

Any chance you could post just the dependency sections of your project build files?

Arthurm1 avatar Nov 06 '21 11:11 Arthurm1