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

sbt unnecessarily copies local dependencies to staging #2202

Open
jakajancar opened this issue Sep 12, 2015 · 8 comments
Open

sbt unnecessarily copies local dependencies to staging #2202

jakajancar opened this issue Sep 12, 2015 · 8 comments
Labels
Bug help wanted uncategorized Used for Waffle integration

Comments

@jakajancar
Copy link

SBT copies local dependencies to a staging directory if their source directory is not writable. I do not think this should be required if the targetDirectory of those dependencies is outside the source directory.

Shouldn't the targetDirectory be checked for writability instead?

jakajancar referenced this issue Sep 18, 2015
This allows using a project reference that points to a readonly
directory.

The use case for this is having sbt plugin projects on a network
share (readonly) that you can just point to. The plugin projects
get copied and built automatically, just like a git project
reference gets cloned and built.

This will ease plugin imcompatibilies between minor sbt versions,
avoiding to have to cross build plugins against all compatible sbt
versions.
@duboisf
Copy link
Contributor

duboisf commented Sep 19, 2015

I don't understand, can you elaborate? What's the problem you're having?

@jakajancar
Copy link
Author

Several projects in a read-only source tree with target set to writable directories:

src/projecta      -> build/projecta
src/projectb      -> build/projectb
src/projectc      -> build/projectc
src/commonproject -> build/commonproject

project{a,b,c} depend on commonproject.

When projecta is built, the referenced code determines that src/commonproject is not writable and copies it to staging. This is completely unnecessary, though.

@duboisf
Copy link
Contributor

duboisf commented Sep 20, 2015

So build/commonproject is writable?

@jakajancar
Copy link
Author

Exactly, all the build directories are, src aren't.

(the use-case is developing with Docker: source r/o mounted from the host, build/run in the container).

@duboisf
Copy link
Contributor

duboisf commented Sep 21, 2015

OK, I agree that it should not copy the project if targetDirectory is writable.

@duboisf
Copy link
Contributor

duboisf commented Sep 22, 2015

Actually, having thought a bit more, this won't work in every situation. For example, I have projects that generate source files somewhere under the baseDirectory, which in your case is read-only. So even if target is writable, this won't work.

@jakajancar
Copy link
Author

That's pretty weird I think. By that logic you could also copy baseDirectory/.., because what if you generate files in a sibling of the baseDirectory, or some other completely unrelated directory.

But anyway, I see it would be a regression. I will find a way to change this only for myself.

@jakajancar
Copy link
Author

@duboisf So now that we are also moving development (not just test/prod) to a read-only source tree, this is even a bigger problem:

Changes to source files are not detected unless you manually delete staging before every compile.

@jakajancar jakajancar reopened this Mar 15, 2017
@eed3si9n eed3si9n added the uncategorized Used for Waffle integration label Sep 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug help wanted uncategorized Used for Waffle integration
Projects
None yet
Development

No branches or pull requests

3 participants