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

Support multiple output target paths from BSP #331

Open
aishfenton opened this issue Feb 14, 2023 · 2 comments
Open

Support multiple output target paths from BSP #331

aishfenton opened this issue Feb 14, 2023 · 2 comments

Comments

@aishfenton
Copy link

aishfenton commented Feb 14, 2023

Is your feature request related to a problem? Please describe.

For build tools that support large monorepos (such as Bazel, Blaze, Pants, Buck, etc) it's typical to have multiple output paths, per build target. Classes, and semanticdb files, are partitioned into different chunks (for different subdirectories), and stored in different places across the filesystem.

Currently Metals is assuming that a single output path is used per BuildTarget (in ScalacOptionsItem.classDirectory). This means that these tools have to resort to ad-hoc solutions, such as copying (or linking) these targets into a single directory.

Describe the solution you'd like

Instead of using a single target output path, support a List[Uri] output locations instead. Either ScalacOptionsItem could be be modified to support this. Or the meaning of OutputPathsRequest could be revisited.

Describe alternatives you've considered

The alternative is to copy (or soft link) the various output paths into a single directory for Metals.

This has a few downsides:

  • Since this is a problem for several build tools, it's undesirable to push the solution to each of them (where it'll have to be re-solved each time).
  • In some cases, the solution can be expensive. Sometimes the only option is to copy the separate output locations, into the single directory. This is very expensive for large monorepos.

Additional context

No response

Search terms

Bazel, classDirectory

@aishfenton aishfenton changed the title Support for multiple target output paths from BSP Support multiple output target paths from BSP Feb 14, 2023
@aishfenton
Copy link
Author

aishfenton commented Feb 14, 2023

Opened an issue on the BSP spec, as it'd need to be addressed there too.

@lefou
Copy link

lefou commented Feb 14, 2023

This limitation affects also the Mill BSP implementation. Mill is generating semanticDB into a different location than the compiled class-files and needs to work around this issue by copying all files into a third directory.

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

No branches or pull requests

2 participants