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

Move BSP out dir to a different folder #4473

Open
lihaoyi opened this issue Feb 4, 2025 · 5 comments
Open

Move BSP out dir to a different folder #4473

lihaoyi opened this issue Feb 4, 2025 · 5 comments

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Feb 4, 2025

Now that we're using Scala 3 and the IntelliJ compile server is on by default, I've been seeing intermittent errors that seem to suggest multiple compilers stomping over each's files on disks

@lefou
Copy link
Member

lefou commented Feb 4, 2025

So, you suggesting to no longer shared any build cache between CLI and IDE? A lot of development efforts went into sharing both, but sometimes with questionable success (For example: shared compile results while keeping IDE-dedicated resuls like semanticdb files separate). We should present the pros and cons. And probable make this an easy user-selectable option instead of a hard-coded choice.

Personally, I have not much use of shared build caches (in its current state). When using GenIdea, we also don't share compiler build output. When I need artifacts or other build targets, I always go to the CLI. IDE is just for editing, sometimes testing (when writing the test or the code under test).

@lefou
Copy link
Member

lefou commented Feb 4, 2025

Beside avoiding a whole class of possible issues, we also could avoid the global lock by making it out-dir specific.

@lefou
Copy link
Member

lefou commented Feb 4, 2025

Instead of using a different out-dir, we could just change all those bspXXX targets that return an UnresolvedPath, since they potentially violate the T.dest contract, to only read but not write files in foreign T.dest paths. Instead of peaking into the T.dest of their companion non-bsp tasks, they should just use their own T.dest.

As a consequence, potential out-of-sync tasks that return an UnresolvedPath aren't shared between BSP and CLI, but all other tasks like source generators or practically everything that is not handled by BSP specifically, can be shared as before, as Mill takes care of their integrity.

@lihaoyi
Copy link
Member Author

lihaoyi commented Feb 5, 2025

I think having separate out/ folders and separate Mill processes would be the simplest thing here. IIRC that's also what SBT does (or can be configured to do?) to avoid the same class of problem.

We could definitely tweak the BSP side to try and make the interference go away, but I'm not familiar enough with our BSP integration to knwo for sure if it's feasible

@lihaoyi
Copy link
Member Author

lihaoyi commented Feb 7, 2025

According to https://blog.pierre-ricadat.com/scala-3-migration-report-from-the-field, Intellij/SBT has a co fig use separate compiler output paths that does this

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