These are chat archives for sbt/sbt

15th
Jul 2016
Rafal Wachol
@charafau
Jul 15 2016 03:23
Wasn't this problem solved in maven with hash plugin?
Perry
@pfn
Jul 15 2016 03:40
not the same problem
Matthew de Detrich
@mdedetrich
Jul 15 2016 08:16
Well you can detect if your dependencies have a reference to a path that is the same package object, and then provide a warning?
Either that, or the package (somehow) can be compiled to a unique classname which could be referenced through some meta data, however I don’t know if that is possible
Although I suspect such a check would be expensive
@pfn Another option is that you could fuse the package objects, which is possible since they are purely a compile time construct (as opposed to objects)
At least then you only need to worry about conflicting declerations inside the package object, rather than the package object themselves
Matthew de Detrich
@mdedetrich
Jul 15 2016 08:27
Anyways my point is that I understand perfectly well why it happens however from a usability POV I think a warning should be display, in the same way that SBT displays a warning if transitive dependencies get shadowed
Dale Wijnand
@dwijnand
Jul 15 2016 08:54
SBT only warns if transitive dependencies "get shadowed" when it thinks they're incompatible
And fusion only works if you're compiling the second package object and depend on the first, your use case was you depend on both
And package objects aren't just compile time, they're an object called package
I think introspecting the dependencies/classpath on compile is out of scope for SBT library management, but try asking it as a feature to Scala
Pierre Borckmans
@pierre-borckmans
Jul 15 2016 12:52
Hello guys. I'm having issues with sbt cache (especially with plugins)
Where does sbt download the plugins?
I cannot find them in my ~/.ivy2 cache
Dale Wijnand
@dwijnand
Jul 15 2016 13:10
@pierre-borckmans in ~/.ivy2/cache/scala_2.10/sbt_0.13/
Pierre Borckmans
@pierre-borckmans
Jul 15 2016 13:10
thanks!
Dale Wijnand
@dwijnand
Jul 15 2016 13:10
np
Pierre Borckmans
@pierre-borckmans
Jul 15 2016 13:11
this was driving me crazy. sbt kept reloading a version of a lib dep mentioned in an old version a plugin that was not even there anymore.
eugene yokota
@eed3si9n
Jul 15 2016 13:41
shadow checking is probably doable given incremental compiler's knowledge, but it probably should be a separate task from compile to avoid perf penalty
Dale Wijnand
@dwijnand
Jul 15 2016 13:54
It's not incremental compiler specific though, I don't think it should be a feature only when using the incremental compiler, no?
eugene yokota
@eed3si9n
Jul 15 2016 13:56
@dwijnand I'm sure there are many ways to skin this cat. all i'm saying is that we have a lot data we collect during incremental compilation that can be used for this purpose
Dale Wijnand
@dwijnand
Jul 15 2016 13:57
I see.
Perry
@pfn
Jul 15 2016 14:23
a problem is that name shadowing is very common in Java, would this be limited to scala only?
(people ship other people's code)
eugene yokota
@eed3si9n
Jul 15 2016 14:45
@pfn if it gets implemented in some way, i think it would make sense to support both Scala and Java
Perry
@pfn
Jul 15 2016 14:45
but it would be very noisy for java
maybe the task can be configured so it checks only the duplicates introduced by you
Matthew de Detrich
@mdedetrich
Jul 15 2016 14:57
Yeah I was pretty sure something like this existed, its not something that is incredibly rare (even in Java land)
@eed3si9n maybe we can integrate sbt-duplicates-finder into set?
Perry
@pfn
Jul 15 2016 14:58
it's extremely common
not rare
or do you mean the tool
shadowing happens all the time
Matthew de Detrich
@mdedetrich
Jul 15 2016 14:59
Which means that ideally SBT should warn about it, unless its not feasible for some reason
No I mean the shadowing problem
Perry
@pfn
Jul 15 2016 14:59
warning about shadowing would be very noisy
eugene yokota
@eed3si9n
Jul 15 2016 15:00
you shouldn't use var either
i don't think sbt should warn you with every potential issue esp if it can be handled by a plugin
shadowing of library dependencies is something sbt or Ivy does, so we should be responsible for it, but shadowing of Package.class to some degree is userland's problem
Matthew de Detrich
@mdedetrich
Jul 15 2016 15:05
How exactly can it be noisy if its on a class level (which is ultimately what a package object compiles down to). I mean if it happens, its almost 100% going to cause a problem at runtime
Im not talking about dependencies being shadowed, that happens all of the time (and is acceptable if what is being shadowed falls within binary compatible versions), I am talking about class shadowing
Matthew de Detrich
@mdedetrich
Jul 15 2016 15:13
Also in my case there never was any dependency shadowing, since they depended on the exact same version
Dale Wijnand
@dwijnand
Jul 15 2016 15:20
Your case isn't too different from accidentally creating two com.acme.Utils objects in different libraries and then blowing up when you depend on both.
Perry
@pfn
Jul 15 2016 16:47
package shadowing is class shadowing
you're shadowing the package object
which is package shadowing
calling it two different things doesn't make sense
Perry
@pfn
Jul 15 2016 19:21
how do I automatically run commands when starting sbt?
I don't want to specify them on the shell
or is there any easy way of interpreting a scripted script
OlegYch
@OlegYch
Jul 15 2016 19:44
there is onLoad..
Dale Wijnand
@dwijnand
Jul 15 2016 19:54
When you say scripted, do you mean as in sbt's scripted testing thing?
Perry
@pfn
Jul 15 2016 20:02
yes, but anyway, I just gave up and ran it as scripted group/test
repeatedly
Perry
@pfn
Jul 15 2016 20:10
just put together this test case
since I keep breaking intellij support in my plugin :(
OlegYch
@OlegYch
Jul 15 2016 20:24
reports in resolution-cache are frequently empty or incomplete
;clean;update doesn't help
how do i regenerate them?
Perry
@pfn
Jul 15 2016 20:41
I thought update is what creates them
(indirectly via ivy)
dunno what happens if ivy resolution fails, though
OlegYch
@OlegYch
Jul 15 2016 21:00
nope
probably because of withCachedResolution though...
yeah..
is there something to trigger generation of resolution reports?