These are chat archives for sbt/sbt

22nd
Aug 2017
nafg
@nafg
Aug 22 00:21
When did sbt stop putting class files not in a per-scala-version directory?
eugene yokota
@eed3si9n
Aug 22 00:36
@laughedelic you can connect to it via telnet
eugene yokota
@eed3si9n
Aug 22 00:54
@nafg too many negatives, so I am a bit confused but are you asking for this commit? - sbt/sbt-zero-thirteen@4d635e4
nafg
@nafg
Aug 22 00:56
@eed3si9n sorry apparently I was confused :D. Delete either negative (replace "stop" with "start" or delete "not")
@eed3si9n that's from a LONG time ago, am I that bad?
nigredo-tori
@nigredo-tori
Aug 22 03:04
I've got a project that depends on org.http4s libraries. These libraries depend directly on Typelevel scala-library, leading to multiple conflicting scala-library artifacts in managedClasspath. What is the best way to handle this situation (other than switching to TBS)?
Here's someone else with exactly the same problem: tpolecat/doobie#568
And here's a similar one: frees-io/iota#44
nigredo-tori
@nigredo-tori
Aug 22 03:20
*TLS, of course
Rob Norris
@tpolecat
Aug 22 03:22
@nigredo-tori can you create a minimal project that reproduce the error? That's what we have been searching for.
I have gotten reports that it is nondeterministic, which is of course maddening.
nigredo-tori
@nigredo-tori
Aug 22 03:42

@tpolecat, this:

scalaVersion in ThisBuild := "2.12.3"
libraryDependencies += "org.http4s" %% "http4s-dsl" % "0.17.0-M3"

And then:

sbt 'show managedClasspath' | grep 'scala-library'

This does not contain the fireworks (the crash itself), but shows the reason.

Rob Norris
@tpolecat
Aug 22 03:54
Which version of sbt?
nigredo-tori
@nigredo-tori
Aug 22 04:02
both 0.13.15 and 1.0.0
Rob Norris
@tpolecat
Aug 22 04:08
Ok, thanks. There was supposed to be machinery in sbt to deal with this.
if I am reading this right, module.addDependencyDescriptorMediator(...) gets only added to capital O-Organization (org.scala-sbt) or lowercase Scala organization specified by the build user
it won't know to mediate on org.typelevel out of the box
eugene yokota
@eed3si9n
Aug 22 04:16
try excludeDependencies += "org.typelevel" %% "scala-library"
Chka Davaadorj
@bayarmunkh
Aug 22 04:21
excluding TLS worked for a project using iota. but i think the question should be why http4s depends on TLS...
nigredo-tori
@nigredo-tori
Aug 22 04:24
@eed3si9n , the typelevel library is still there
eugene yokota
@eed3si9n
Aug 22 04:25
actually it's probably excludeDependencies += "org.typelevel" % "scala-library" with a single %?
didn't test so you might have to experiment
if you use Lightbend Scala, the standard scala-library gets included into your pom.xml, so in theory it makes sense
even for Typelevel, I don't think they would want to make the compiler zombie viral, so it might be good to fake the "scala-library" dependencies on publish tho
Rob Norris
@tpolecat
Aug 22 04:29
I was really worried about this when we did the fork and was assured that it wasn't a problem. So I'm interested in where it went wrong.
Miles gave it a lot of thought.
eugene yokota
@eed3si9n
Aug 22 04:30
is there an issue to discuss this?
I am happy to offer any soft landing
including if (miles's machine) print("hi")
Rob Norris
@tpolecat
Aug 22 04:30
I'm on my phone but I'll look when I resurface. If not we should make one. The issue thus far has been in reproducing it, but evidently it's easy.
nigredo-tori
@nigredo-tori
Aug 22 04:32
excludeDependencies += "org.typelevel" % "scala-library" does it, thank you. Still, this is also dangerous since we can end up in the reverse situation (one of the packages depending on newer typelevel library that gets ignored).
Rob Norris
@tpolecat
Aug 22 05:06
ok i opened typelevel/scala#166
eugene yokota
@eed3si9n
Aug 22 05:06
cool. thanks
N.S. Cutler
@godenji
Aug 22 14:46
how does one disable forcegc? The setting doesn't appear to be available within an sbt session.
Rich
@Richtype
Aug 22 15:16

My code compiles fine in eclipse but sbt:

trait Tile extends TileGridElement {
   //def isTile: Boolean = true
}

java.lang.AssertionError: assertion failed: Modified names for rich.geom.Tile is empty

Uncomment the isTile method and sbt compiles OK. I can't quite work out if this bug is meant to have been fixed or not.

Nicolas Rinaudo
@nrinaudo
Aug 22 15:18
isn't that unlikely to be sbt related? sbt doesn't do the compilation, scalac does. The fact that Eclipse doesn't see errors in your code is probably a flaw in Eclipse, not in the scala compiler
Nicolas Rinaudo
@nrinaudo
Aug 22 15:24
(although the fact that it's an assertion error is weird - I thought assertions only occured at runtime, are you sure your code does not compile?)
Rich
@Richtype
Aug 22 15:25
No its to with the incremental compiler getting confused by name hashing when there's nothing in the trait to enact changes upon. At least as far as i can make out. It is the compiler that's crashing not my programme. Rather than isTile, I should have called it meaningless method. It serves no function in the programme. Its merely to stop the name hashing problem.
Dale Wijnand
@dwijnand
Aug 22 15:32
@Richtype Interesting. Looks like that was partially fixed in 0.13.11. The remaining work is being tracked as sbt/zinc#292.
Rich
@Richtype
Aug 22 15:39
@dwijnand So I'm a bit confused, doesn't Scala IDE also use the incremental compiler?
Jean-Baptiste Giraudeau
@jbgi
Aug 22 15:40
does it happen only for snapshot?
Dale Wijnand
@dwijnand
Aug 22 15:41
@Richtype I don't know much about Scala IDE but, yes, I believe it does.
@jbgi yes I believe so. See "useLatest" in that file
Jean-Baptiste Giraudeau
@jbgi
Aug 22 15:42
ok, thanks
eugene yokota
@eed3si9n
Aug 22 16:06
@godenji forcegc in Global
N.S. Cutler
@godenji
Aug 22 16:07
@eed3si9n thanks, looks like that's only available in build def; from sbt session forcegc setting does not exist
Dale Wijnand
@dwijnand
Aug 22 16:08
forcegc in Global is */forcegc in the session
eugene yokota
@eed3si9n
Aug 22 16:09
(I can't wait to switch to slash - sbt/sbt#3434, which would be Global/forcegc)
N.S. Cutler
@godenji
Aug 22 18:08
cool, that helps, thanks
Anthony Garo
@agaro1121
Aug 22 21:29
hey guys which sbt version is most compatible with scala 2.10.5?
i’m seeing errors:
java.lang.NoClassDefFoundError: scala/reflect/internal/Trees
can i use 0.13.15?
Anthony Garo
@agaro1121
Aug 22 21:35
or do I have to downgrade to 0.13.9?
Rob Norris
@tpolecat
Aug 22 21:36
Are you writing an sbt plugin? Or just normal code?
Anthony Garo
@agaro1121
Aug 22 21:36
normal code. I am working with an old version of spark
Rob Norris
@tpolecat
Aug 22 21:36
Any modern version of sbt will let you compile with 2.10.5, or any other scala version.
What scala version is define in the build?
You should see scalaVersion in ThisBuild := "2.10.5" or something. If not, maybe add it.
Anthony Garo
@agaro1121
Aug 22 21:37
2.10.5. It matches the spark environment
Rob Norris
@tpolecat
Aug 22 21:37
And your code doesn't compile?
Anthony Garo
@agaro1121
Aug 22 21:37
inThisBuild(List(
      organization := “…",
      scalaVersion := "2.10.5",
the code compiles and runs but it’s failing in Jenkins with this error
Rob Norris
@tpolecat
Aug 22 21:38
Is Jenkins maybe trying to run it with a different Scala runtime?
Anthony Garo
@agaro1121
Aug 22 21:39
I’m not sure. I’ll check with my devops team for the specifics
Alexey Alekhin
@laughedelic
Aug 22 23:05

you can connect to it via telnet

@eed3si9n yeah, I read your post and tried it out. But what about other questions: how to start a server in background? and more importantly, how to use --locate? do I need to make some special launcher configuration?