Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:37
    sjrd synchronize #738
  • 13:17
    chikei synchronize #736
  • 11:28
    sjrd synchronize #738
  • 10:03

    lihaoyi on gh-pages

    first commit (compare)

  • 09:22

    lefou on master

    Changed download path to confor… (compare)

  • Dec 05 23:19
    sjrd synchronize #738
  • Dec 05 21:12

    lihaoyi on gh-pages

    first commit (compare)

  • Dec 05 20:32

    lefou on master

    Fix for ScalaJS tests issue #60… (compare)

  • Dec 05 20:32
    lefou closed #706
  • Dec 05 20:10
    lefou review_requested #737
  • Dec 05 16:41
    sjrd synchronize #738
  • Dec 05 16:03
    sjrd synchronize #738
  • Dec 05 15:12
    sjrd edited #738
  • Dec 05 14:14
    sjrd synchronize #738
  • Dec 05 13:59
    sjrd opened #738
  • Dec 03 09:13
    lefou opened #737
  • Dec 02 04:45
    sequencer edited #721
  • Dec 01 22:03
    lefou labeled #721
  • Dec 01 04:21

    lihaoyi on gh-pages

    first commit (compare)

  • Dec 01 02:50

    lihaoyi on master

    properly place mill bootstrap s… (compare)

Tobias Roeser
@lefou
Or open a stackoverflow
Jakub Dubovsky
@james64
@lefou regarding maven repo upload. I ended up writing some basic support myself. It lacks some generality (it's tailor-made for what I need) so I do not feel like it's worth a MR...
The very fact that I am able to do something like this though is what I like about mill. I cannot imagine doing something like this for gradle/sbt...
Tobias Roeser
@lefou
@james64 sounds great. Do you mind sharing the code, maybe in a gist?
Andrew Richards
@ajrnz
@lefou @james64 I also had a go at this a while ago for publishing to our artifactory. I haven't had a chance to turn it into a PR. It's really just the Sonatype publisher with the staging stuff ripped out. Anyway if anyone is interested, I've put it in a gist here: https://gist.github.com/ajrnz/42725b883211edbeba2a64d3451c5e59 I don't think I'll have a chance to do a PR in the near future.
Tobias Roeser
@lefou
@ajrnz Great, thanks for sharing!
Sequencer
@sequencer
@lefou thank you! I think I have found the way to do so!
Tobias Roeser
@lefou
Is there someone who uses scoverage with mill? Would be great if you could verify that #735 still works. Tests are green, but I want to make sure.
Jeremy Townson
@jtownson
Please could somebody tell me how to send process output to stdout/stderr in a custom task. None of the following do the trick:
import mill._
import mill.scalalib._
import ammonite.ops._
import ammonite.ops.ImplicitWd._
import os.{Inherit, Pipe}

object app extends ScalaModule with TestModule {
  def scalaVersion = "2.12.10"

}

trait TestModule extends Module { self: JavaModule =>
  def ls = T {
    os.proc("ls", "-l").call(stdout = Inherit, stderr = Inherit)
    os.proc("ls", "-l").call(stdout = Pipe, stderr = Pipe)
    %%("ls", "-l")
    %("ls", "-l")
    ()
  }
}
$> mill app.ls
# task output is not written to stdout :-(
Tobias Roeser
@lefou
@jtownson Can you see something, when using the additional -i option? Also, please note, that result of ls is cached and subsequent runs will not execute again. To change that, you need to define it as a command (def ls() = T.command {)
It's probably a bug worth reporting
Tobias Roeser
@lefou
The output should appear in out/mill-worker<...>/logs
Jeremy Townson
@jtownson
@lefou Ah, the -i flag does the trick. Thanks for the tip about T.command too.
onedigit
@onedigit
I'm trying to get the dependency tree for a small project. The direct dependencies are 5. However, doing an ivyDepsTree is taking a rather long time, i.e. several minutes. Any idea what that could be due to? I can see the mill process consuming 100% CPU during that time
onedigit
@onedigit

I'm trying to get the dependency tree for a small project. The direct dependencies are 5. However, doing an ivyDepsTree is taking a rather long time, i.e. several minutes. Any idea what that could be due to? I can see the mill process consuming 100% CPU during that time

Taking over 10 minutes:

Tobias Roeser
@lefou
That doesn't look right.
Can you post the dependencies in question, maybe it's something within their transitive deps.
Best, you post the full build.sc if you can, so that others (me) can try to reproduce the issue.
onedigit
@onedigit

Here's an example.

import mill._, scalalib._, scalafmt._

object millTest extends SbtModule {
  // mill and bloopInstall do not work properly with 2.12.10
  def scalaVersion = "2.12.9"

  val hiveJdbcVersion = "3.1.2"

  def ivyDeps = Agg(
    ivy"org.apache.hive:hive-jdbc:$hiveJdbcVersion"
      .exclude(
        "ch.qos.logback" -> "logback-classic",
        "org.slf4j" -> "slf4j-log4j12"
      ),
    ivy"org.apache.logging.log4j:log4j-api:2.12.1",
    ivy"org.apache.logging.log4j:log4j-core:2.12.1",
    ivy"org.apache.logging.log4j:log4j-slf4j-impl:2.12.1"
  )

}

This takes over 10 minutes. Seems that the dependencies of this particular artifact causes some difficulties.

real    10m43.307s
user    0m3.865s
sys     0m25.700s

I tested the same single dependency in a Maven pom and it took just 4 seconds

time mvn dependency:tree

real    0m4.413s
user    0m8.180s
sys     0m3.324s
Tobias Roeser
@lefou
I can reproduce it. One core is at 100%. Looks like it's coursier related. Could you ask in the coursier room? https://gitter.im/coursier/coursier
Tobias Roeser
@lefou
I asked in the coursier channel.
btw, the dependency tree is very large, many thousand lines
You could try to exclude some more deps
TzeKei Lee
@chikei
I have a dependency which is loaded through java SPI, test and testLocal seem unable to pick up, what parameters I should tweak around ?
Here is an example repo https://github.com/chikei/mill-test-spi
Tobias Roeser
@lefou
@chikei No idea. But in the example module it works, right?
TzeKei Lee
@chikei
run works but not test
TzeKei Lee
@chikei
looks like it's due to the SPI load was called with system classloader, guess I'll just change to load with enclosing class's class loader
onedigit
@onedigit
@lefou thanks for taking at a look at that dependency issue. It appears that the "hive-jdbc" driver has got an absolutely silly amount of unnecessary dependencies.
Seen a JIRA ticket that's being open on that issue since 2014: https://issues.apache.org/jira/browse/HIVE-6536.
I tried the dependency tree with SBT as well, but SBT does process that huge tree in about 50 seconds.
onedigit
@onedigit
Found the troublesome dependencies. After excluding them, we get the expected sub-second resolution times:
import mill._, scalalib._, scalafmt._

object millTest extends SbtModule {
  // mill and bloopInstall do not work properly with 2.12.10
  def scalaVersion = "2.12.9"

  val hiveJdbcVersion = "3.1.2"

  def ivyDeps = Agg(
    ivy"org.apache.hive:hive-jdbc:$hiveJdbcVersion"
      .exclude(
        "ch.qos.logback" -> "logback-classic",
        "org.slf4j" -> "slf4j-log4j12",
        "org.apache.hive" -> "hive-common",
        "org.apache.hive" -> "hive-metastore",
        "org.apache.hive" -> "hive-service",
        "org.apache.hive" -> "hive-shims",
        "org.apache.hive" -> "hive-serde",
        "org.apache.hive" -> "hive-service-rpc"
      ),
    ivy"org.apache.logging.log4j:log4j-api:2.12.1",
    ivy"org.apache.logging.log4j:log4j-core:2.12.1",
    ivy"org.apache.logging.log4j:log4j-slf4j-impl:2.12.1"
  )

}
time ./mill millTest.ivyDepsTree

real    0m0.793s
user    0m0.315s
sys     0m0.619s
Tobias Roeser
@lefou
@onedigit Which sbt version have you tried? I'm not 100% sure, but I think sbt 1.3.x has switched to also use coursier instead of (sbt's version of) ivy.
onedigit
@onedigit

@lefou, SBT version 1.3.4. Using the following plugin for the dependency tree and coursier:

addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.10.0-RC1")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "2.0.0-RC4-1")

The above exclusion list was a bit too aggressive (as some of them are required at runtime), so I've had to put back some more and take away others. But I guess the end result is that this library (a particularly degenerate one at that) is exposing some arguable inefficiency in coursier. Don't think I've ever seen such an odd case.

Tobias Roeser
@lefou
@onedigit Thanks for the insights
fiatjaf
@fiatjaf
how can I include a jar file as a library in a project?
(I'm completely new to these Java/Scala things, baffled by gradle, melancholic about sbt, frightened by maven)
I'm trying to reuse the same jar that is included in this project. here's how it includes it using gradle: https://github.com/btcontract/lnwallet/blob/6ac6dc0d9d78fa37462a830538c76f9420678975/app/build.gradle#L35
Jakob Odersky
@jodersky
You can put the jar in a "lib" folder next to the "src" folder and tell mill to include it in the "unmanagedClasspath". See https://www.lihaoyi.com/mill/page/configuring-mill.html#unmanaged-jars for an example

I'm completely new to these Java/Scala things, baffled by gradle, melancholic about sbt, frightened by maven

I think you've made the best choice by choosing mill :)

fiatjaf
@fiatjaf
I had that suspicion too, and now I truly believe so, because you've answered me here
Tobias Roeser
@lefou
@lihaoyi The mapDependencies logic in JavaModule, is it to override an explicit version of a dependency, or is it a more general way to replace a dependency with another one, e.g. some with changed GAV coordinates?
If the latter is the case, wouldn't it make sense to map to a seq? Dependency => Seq[Dependency]
instead of Dependency => Dependency
Li Haoyi
@lihaoyi
honestly i dont recall
youll have to see where it is used in the repop
Tobias Roeser
@lefou
After digging into to call hierarchy, it looks like it is needed as-is by coursier.
hmf
@hmf
I am trying to execute a set of uTests asynchronously via Mill. The example in https://github.com/lihaoyi/utest#asynchronous-tests lets me execute the tests asynchronously manualy. If I place these in a test suite, Mill's _.test will still execute the tests synchronously and then execute the runAsync . Can one "configure" Mill to run some tests suites synchronously and others not?
hmf
@hmf
After some experimentation I think we need only need to: a) use the Future and b) use utest's assert.
Guillaume Martres
@smarter
So sbt has a ~/.sbt/repositories file which allows me to specify default repos for sbt to try before hitting maven, is there something equivalent for mill ? (https://www.scala-sbt.org/1.x/docs/Proxy-Repositories.html)
this is useful on a CI, to hit a local artifactory instance that caches stuff instead of redownloading stuff from maven all the time
Brian Maso
@bmaso
What is a good way to extract an actual path string from a Path object in a build script. I've been doing this, but it seems like there must be an easier way: path.toNIO.toString