Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 22 2015 11:10
    japgolly commented #2066
  • Jun 22 2015 08:25
    keepscoding commented #2044
  • Jun 21 2015 03:24
    xerial commented #157
  • Jun 21 2015 00:10
    eed3si9n unlabeled #2057
  • Jun 21 2015 00:10

    eed3si9n on 0.13

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 3 more (compare)

  • Jun 21 2015 00:10
    eed3si9n closed #2057
  • Jun 21 2015 00:10

    eed3si9n on fixbuild

    (compare)

  • Jun 20 2015 18:42
    eed3si9n synchronize #2057
  • Jun 20 2015 18:42

    eed3si9n on fixbuild

    Fix typo (compare)

  • Jun 20 2015 18:23

    eed3si9n on fixbuild

    Adds bundledLauncherProj to all… Remove launcher tests Add unit tests to Travis and 1 more (compare)

  • Jun 20 2015 18:23
    eed3si9n synchronize #2057
  • Jun 20 2015 14:59

    eed3si9n on scalaversionbump

    (compare)

  • Jun 20 2015 14:59

    eed3si9n on 0.13

    Bumping up Scala version to 2.1… Try to keep bincompat Fixes #1666 and 1 more (compare)

  • Jun 20 2015 14:59
    eed3si9n unlabeled #2068
  • Jun 20 2015 14:59
    eed3si9n closed #2068
  • Jun 20 2015 14:59
    eed3si9n closed #1666
  • Jun 20 2015 14:57
    eed3si9n commented #2068
  • Jun 20 2015 12:55
    dwijnand commented #2068
  • Jun 20 2015 04:51
    eed3si9n synchronize #2068
  • Jun 20 2015 04:51

    eed3si9n on scalaversionbump

    Fixes #1666 (compare)

Eric K Richardson
@ekrich
The Scala/Dotty team really did their homework - didn't want to repeat the Python 2 -> 3 scenario. Scala 3 is very cool.
I think the Tasty feature should really be helpful.
eikek
@eikek:matrix.org
[m]
Yes. I'm really looking forward to get more into scala 3. I tried the other day a little but had to fight with my emacs a bit too much :-)
Eric K Richardson
@ekrich
Are you using metals?
eikek
@eikek:matrix.org
[m]
Yes, and I wanted to use the new syntax. But I think scala-mode is not there yet. It was working fine from sbt's perspective (except the goodies like scalafmt and scalafix weren't working); only editing was a bit painful
Andreas Flierl
@asflierl
hmm... is consoleProject working for anyone when using sbt -client ? console looks fine but consoleProject throws an IOException "Stream Closed" immediately
Bjorn Regnell
@bjornregnell
@eed3si9n Could we introduce sbt init defaulting to sbt new scala/scala3.g8; easier to remember for me and less to type for a beginner... ?
Michael Lewis
@lewismj
Just upgrading a few things, and I'm getting errors Some keys were defined with the same name but different types: 'pgpSigningKey' (sbt.Task[scala.Option[java.lang.String]], scala.Option[Long]) I can see that I've only updated the plugin version, anyone come across this previously?
Sean Glover
@seglo
i have a root project with two child projects that are aggregated by the root. i have a setting i want to define at build scope for each child project that's used when i run each sbt child1/run. i've found that in this configuration the setting for the last child defined (or aggregated?) always overrides previous values. is there a way i can define a build scope setting for a sub project (i.e. Project.settings(ThisBuild / mySetting := "foo")) that isn't overridden by other sub projects defining the same setting?
2 replies
Eric Torreborre
@etorreborre
Hi, has anyone tried sbt-unidoc with Scala 3? I sbt/sbt-unidoc#86 and I was wondering if any of you had a workaround already (cc @eed3si9n)
Olivier Mélois
@Baccata
Hey folks, regarding the remote cache feature, unfortunately it doesn't quite play well with scalafix (or more precisely semanticdb). Is there a setting I could use to indicate that semanticdb files should be cached as well ?
Chris Kipp
@ckipp:matrix.org
[m]
whoa.... I was coming here to literally chat about this @Baccata
you need to make sure you have
ThisBuild / semanticdbIncludeInJar := true
or it won't actually include the semanticdb files in the cache
that's what I was coming here to ask about since that's off by default, I think for good reason since at the end of the day I don't want them in my published artifacts, but would it make sense to not have that affect caching?
I feel like that's a tricky one that will end up making people have hacking builds that will set this based on whether they are going to cache and then turn it off when they are doing an actual sbt publish or soemthing. it'd be really nice to have that still be defaulted to true so that when you do use remote caching, it includes the semantidb in the jar, but not when you are actually trying to publish a usable artifact
Chris Kipp
@ckipp:matrix.org
[m]
ahh actually, digging a bit deeper, its that with that setting turned on, it includes it in classes/META-INF so then they are packaged up, if not they live in meta/META-INF and that doesn't get included when packaging
Olivier Mélois
@Baccata
oh wow, awesome, thanks a lot @ckipp:matrix.org !
Chris Kipp
@ckipp:matrix.org
[m]
I wonder if it'd be preferable for remote caching to just auto-include that dir when zipping up the cache 🤔
Olivier Mélois
@Baccata
@ckipp:matrix.org I'm still getting scalafix.sbt.ScalafixFailed: MissingSemanticdbError with that setting, unfortunately :(
oh wait, I'm dumb
Yeah I guess I need to override the artifacts somehow
1 reply
Olivier Mélois
@Baccata

I wonder if it'd be preferable for remote caching to just auto-include that dir when zipping up the cache 🤔

that'd be nice actually

Chris Kipp
@ckipp:matrix.org
[m]
but I also hit on a few random things with that not really working either. I need to figure out what's going on with that one
Olivier Mélois
@Baccata
@ckipp:matrix.org I'm afraid adding ThisBuild / semanticdbIncludeInJar := true doesn't seem to suffice
Olivier Mélois
@Baccata
Made some progress, but now I get StaleSemanticdbError
Mmm it might be a user error actually
Nicolas Rinaudo
@nrinaudo
Am I correct in my understanding that, if I want to write a tut plugin that needs to run some Scala 3 code, I need to:
  • write a Scala 2.12 plugin that spawns a new JVM to run the Scala 3 code
  • have some sort of cross-compiled 2.12 / 3 module that knows how to read / write some common format
  • have the Scala 3 code write to that common format and the Scala 2.12 read from it?
Nicolas Rinaudo
@nrinaudo
(that should have read SBT plugin, not tut plugin)
Brice Jaglin
@bjaglin
@nrinaudo you don't need a brand new JVM, a filtering classloader which loads your Scala 3 app in near-isolation is enough. As for the common format/protocol, you can use java interfaces/classes. That's for example how scalafmt runs in sbt (or other JVM-based build tool), check out https://github.com/scalameta/scalafmt/blob/master/scalafmt-interfaces/src/main/java/org/scalafmt/interfaces/ScalafmtClassLoader.java
Nicolas Rinaudo
@nrinaudo
oh that looks like exactly what I was looking for, thank you!
Brice Jaglin
@bjaglin
@Baccata we are running remote caching with semantidcb without any issue, at least not the one you mentionned. We did need https://github.com/sbt/sbt/issues/6027#issuecomment-717064450 though. We went even further and included the sbt-scalafix cache inside the remote artifact, but that requires quite a few hacks and fragile packing/unpacking.
Nicolas Rinaudo
@nrinaudo
you wouldn't happen to have an example of a plugin that does the Scala 3 app thing, would you?
Brice Jaglin
@bjaglin
sbt-scalafix uses the same technique to classload scalafix 2.13 into sbt. The logic is currently in scalafix but older versions of sbt-scalafix had it directly there, so it might be easier to replicate... let's see if I can find that
Brice Jaglin
@bjaglin
There you go: https://github.com/scalacenter/sbt-scalafix/blob/c33635e4d37c3d4c239c047e62f289a90539a091/src/main/scala/scalafix/internal/sbt/ScalafixInterface.scala#L173-L178:
  • fetch via coursier your Scala 3 app which has a Java API
  • classload it through a classloader sharing only the Java API between the 2 sides
Nicolas Rinaudo
@nrinaudo
Can't pretend I understand everything that's going on in there, but... I will!
thank you very much for taking the time to point me in the right direction
Brice Jaglin
@bjaglin
if you want to skip the coursier dependency you can use the built-in LM APIs of sbt for fetching artifacts, like sbt-protoc does: https://github.com/thesamet/sbt-protoc/blob/f9cc2252fd6a028a0b883d6fd1312a2552ef66a0/src/main/scala/sbtprotoc/ProtocPlugin.scala#L383-L389
Nicolas Rinaudo
@nrinaudo
neat, thanks
Brice Jaglin
@bjaglin
good luck, it's definitely not trivial :smile: but it works very well and the runtime overhead is minimal (just a tiny bit of warm up needed to JIT the scala library in the sideloaded app, but nothing compared to starting a new JVM...)
Nicolas Rinaudo
@nrinaudo
oh I know I'm going to be pulling my hair out for a bit, anything that's got to do with class loading is a nightmare
and to make things even worse... I'll be running a Scala 3 compiler in that plugin
I'm going to run in every possible CLASSPATH issue there exists.
Brice Jaglin
@bjaglin
oh, have a look at https://github.com/scalacenter/scala3-migrate also, it does run the scala 3 compiler in sbt using a similar technique AFAIK
wankun
@wankunde
image.png
sbt:spark-parent> project tags
[info] set current project to spark-tags (in build file:/Users/wakun/ws/apache/spark/)
sbt:spark-tags> compile
[success] Total time: 1 s, completed Jun 23, 2021 11:17:42 AM
hello, The java files can not be compiled in my project?
Could some one help me ?
The Scala Code could be compiled ...
sbt:spark-tags> javaHome
[info] Some(/Library/Java/JavaVirtualMachines/jdk1.8.0_281.jdk/Contents/Home)
sbt:spark-tags> javaSource
[info] /Users/wakun/ws/apache/spark/common/tags/src/main/java