Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 30 2019 14:37
    bhaskarmelkani starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 29 2019 04:27
    JYInMyHeart starred lihaoyi/Ammonite
  • Jan 28 2019 15:07
    ishubelko starred lihaoyi/Ammonite
  • Jan 25 2019 22:38
    borissmidt starred lihaoyi/Ammonite
  • Jan 25 2019 17:12

    alexarchambault on 1.6.3

    (compare)

  • Jan 25 2019 17:11

    alexarchambault on master

    1.6.3 (compare)

  • Jan 25 2019 15:48
    alexarchambault commented #923
  • Jan 25 2019 01:15

    lihaoyi on gh-pages

    5ad9ae5538f23cab92ccd8c6b1617d8… (compare)

  • Jan 25 2019 00:50

    alexarchambault on master

    Partly revert 84d48542 (#923) … (compare)

  • Jan 25 2019 00:50
    alexarchambault closed #923
  • Jan 25 2019 00:50
    alexarchambault closed #920
  • Jan 25 2019 00:50
    alexarchambault closed #922
  • Jan 24 2019 23:13
    lihaoyi commented #923
  • Jan 24 2019 22:39
    alexarchambault closed #921
  • Jan 24 2019 22:39
    alexarchambault commented #921
  • Jan 24 2019 22:39
    alexarchambault edited #923
  • Jan 24 2019 22:38
    alexarchambault opened #923
  • Jan 24 2019 22:37
    david-bouyssie commented #919
  • Jan 24 2019 21:33
    nksureshkumar commented #922
Stephen Duncan Jr
@jrduncans
What should I be checking if running ammonite repl shows Scala 2.13.6 when started, but then attempts to use things seems to be referencing Scala3 library files and failing?
> amm
Loading...
Welcome to the Ammonite Repl 2.3.8-124-2da846d2 (Scala 2.13.6 Java 11.0.10)
@ import scala.util.Random
error while loading NotGiven, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in <path>/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/NotGiven.class)', required by <path>/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/NotGiven.class)…
Lasse Benn Nørregaard
@lassebn

I'm having issues getting ammonite-compiler-interface for scala 2.13.6. It should be available according to https://mvnrepository.com/artifact/com.lihaoyi/ammonite-compiler-interface but I keep getting Error downloading com.lihaoyi:ammonite-compiler-interface_2.13:2.3.8-124-2da846d2 from SBT.
Also going to https://repo1.maven.org/maven2/com/lihaoyi/ammonite-compiler-interface_2.13/2.3.8-124-2da846d2/ammonite-compiler-interface_2.13-2.3.8-124-2da846d2.pom returns 404 Not Found.

Am I doing anything obviously wrong? Thank you :raised_hands:

Anton Sviridov
@velvetbaldmime:matrix.org
[m]

ammonite-compiler-interface_2.13

The compiler interface has to be versioned for the full Scala version - you need to depend on it like this:

"com.lihaoyi"  % "ammonite-compiler-interface" % "2.3.8-124-2da846d2" cross CrossVersion.full
Lasse Benn Nørregaard
@lassebn
Thank you @velvetbaldmime:matrix.org
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

As a rule of thumb - everything that fathomably interfaces with the compiler has to be compiled against exact version of it.

Scala compiler API has no guarantees even between patch versions, so things like ammonite (and parts of Almond) need to be cross-published against full scala version :) Just like many compiler plugins.

Adam Jorgensen
@OOPMan
Hello, has anyone run into an issue like this?
[IJ]test:runMain amm
[warn] sbt 0.13 shell syntax is deprecated; use slash syntax instead: Test / runMain
[info] running amm
[error] (run-main-0) java.lang.ExceptionInInitializerError
[error] java.lang.ExceptionInInitializerError
[error]         at amm.main(amm.scala)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
[error]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[error] Caused by: java.lang.NullPointerException: Cannot invoke "scala.collection.mutable.ArraySeq$ofRef.toList()" because the return value of "scala.Predef$.wrapRefArray(Object[])" is null
[error]         at ammonite.Main$.main(Main.scala:279)
[error]         at amm$.<clinit>(amm.scala:1)
[error]         at amm.main(amm.scala)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
[error]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[error] stack trace is suppressed; run 'last Test / bgRunMain' for the full output
[error] Nonzero exit code: 1
[error] (Test / runMain) Nonzero exit code: 1
[error] Total time: 2 s, completed May 22, 2021, 7:02:27 PM
From the source code of the failing method it looks like it's failing on the primary entry point for Ammonite...
If it helps, my build.sbt is here: https://pastebin.com/Hbz1ya0Q
Adam Jorgensen
@OOPMan
Nvm, I worked it out
It's due to the main method changes in Scala 3
Siddhant Sanyam
@siddhant3s
In Mill I can do -i _.replto get an Ammonite REPL. Can Ammonite do the same with SBT easily?
Adam Jorgensen
@OOPMan
@siddhant3s it's pretty easy to use Ammonite within SBT but you do need to tweak the sample SBT stuff from the site if you're using Scala 3
Siddhant Sanyam
@siddhant3s
Are we talking about these steps: http://ammonite.io/#RunningAmmoniteREPL ?
Miguel Pérez Pasalodos
@mpasa
Hello! Somebody knows if I can use Coursier to get a list of jars of some dependencies? The goal is to get the jars, import them locally and then send them to remote Spark executors using -Dspark.files
nafg
@nafg
Yes you can
Chris Kipp
@ckipp:matrix.org
[m]
In the latest version of Ammonite I get the following simply when trying to do an import
❯ amm
Loading...
Welcome to the Ammonite Repl 2.3.8-124-2da846d2 (Scala 2.13.6 Java 11.0.11)
@ import scala.util.Try
error while loading NotGiven, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/NotGiven.class)', required by /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/NotGiven.class)
error while loading FromDigits, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/FromDigits.class)', required by /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/FromDigits.class)
error while loading CommandLineParser, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/CommandLineParser.class)', required by /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/CommandLineParser.class)
error while loading LowPriorityNotGiven, Missing dependency 'Add -Ytasty-reader to scalac options to parse the TASTy in /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/LowPriorityNotGiven.class)', required by /Users/ckipp/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.0.0/scala3-library_3-3.0.0.jar(scala/util/LowPriorityNotGiven.class)
Compilation Failed
why it it looking in Scala3 jars?
nevermind, I see it's reported already com-lihaoyi/Ammonite#1182
@keynmol: just a step ahead of me
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
I had to pin the ammonite version to one released for 2.13.4 to unbreak my things :-)
Yadu Krishnan
@yadavan88
Hi, I just want to know if it is possible to mention the minimum ammonite version required for the script to run? For example, since the @doc annotation change, the scripts are breaking due to version mismatch.
Florian Schmaus
@Flowdalic
I've I embed ammonite as describe in the manual and then run the project with "mill main.run", the REPL prompt appears, but does not take any input
any ideas?
Tobias Roeser
@lefou
@Flowdalic You need to run with -i option, for interactive
Florian Schmaus
@Flowdalic
@lefou that did the trick. thanks
btw, one cannot build mill if it's not under git, e.g. if it is extracted from the tar.gz, due to https://github.com/lefou/mill-vcs-version/blob/main/core/src/de/tobiasroeser/mill/vcs/version/VcsVersion.scala#L26
would be nice if that got fixed
Tobias Roeser
@lefou
@Flowdalic, could you open an issue, please?
I think building is still possible, but for (local) publishing, you need to override one target.
Tobias Roeser
@lefou
def millVersion, IIRC
Florian Schmaus
@Flowdalic
@lefou will do
I've a java.nio.file.Path instance that I'd like to pass to os.write(), somehow I expected the conversation to be implicit, but the compiler complains about a type mismatch
I somehow assume that I just miss some import or other magic
Li Haoyi
@lihaoyi
os.Path(...) for an absolute path, os.Path(..., os.pwd) if it's a relative path and you want it to be relative to your current working directory
Florian Schmaus
@Flowdalic
@lihaoyi so the idea is that the user has to explicitly perform the conversion, right?
no scala implicit magic invovled
Li Haoyi
@lihaoyi
basically yeah, because we are downcasting from "who knows what this YOLO" to "definitely a normalized canonicalized absolute path", so you need either pass in an explicit base directory to absolute-ize relative paths, or accept that relative paths will blow up with an exception. Neither of those would be great to do implicitly
Florian Schmaus
@Flowdalic
ahh, that sounds sensible
Florian Schmaus
@Flowdalic
@lihaoyi any idea why https://index.scala-lang.org/com-lihaoyi/os-lib does return "Not found"?
Li Haoyi
@lihaoyi
@alexarchambault I tagged version 2.4.0 to get a new stable version compatible with latest version of uPickle 1.4.0. I added Internal preparation for basic Scala 3 support to the changelog, but feel free to add more if you have anything you'd like to say
1 reply
bjenkinsgit
@bjenkinsgit
Trying to get Visual Studio code to work with Ammonite. I've got VS Code v 1.56.2 on Windows 10 and am trying to get a simple Scala worksheet working. I created a new Scala3 sbt project using "sbt new scala3/scala-cross.g8" to get started. build.sbt shows that it has set the default scalaVersion := 3.0.0. VS Code is giving me a "Error fetching Ammonite 2.3.8-58-aa8b2ab1 for Scala 2.13.6" (Source: Scala Metals). Any hints how to fix?
Chris Kipp
@ckipp:matrix.org
[m]
so in Metals you're a bit limited by the default versions that we have and a mismatch between those and the latest versions available in Ammonite. Typically we add support for a new Scala version pretty quickly before Ammonite has a chance to
in an ammonite script in Metals you can actually specify the exact version of Ammonite and Scala version with comments at the top of the file
since metals uses ammonite-runner under the hood https://github.com/alexarchambault/ammonite-runner
Florian Schmaus
@Flowdalic

switching my project to scala 3 results in

[error] -- [E007] Type Mismatch Error:
[error] 22 |      os.symlink(symlink, dir)
[error]    |                                           ^^^^^^^^^^^^^^^^^^^^^^
[error]    |Found:    (Context.this.dir : os.Path#ThisType#ThisType)
[error]    |Required: os.FilePath
[error]    |

I guess that's an issue with different handling of implicits in Scala 3. Anything I could do?

mvillafuertem
@mvillafuertem
Hi there, how add resolvers to a script?
import coursierapi.MavenRepository

interp.repositories() ++= Seq(
  MavenRepository.of("https://packages.atlassian.com/maven-public/")
)

import $ivy.`com.atlassian.browsers:atlassian-browsers-auto:3.1.0`

@main
def main(): Unit = println("Hello")
Failed to resolve ivy dependencies:Error downloading com.atlassian.browsers:atlassian-browsers-auto:3.1.0
  not found: /root/.ivy2/local/com.atlassian.browsers/atlassian-browsers-auto/3.1.0/ivys/ivy.xml
  not found: https://repo1.maven.org/maven2/com/atlassian/browsers/atlassian-browsers-auto/3.1.0/atlassian-browsers-auto-3.1.0.pom
Tobias Roeser
@lefou
@mvillafuertem You need to add a standalone @ line before the import.
mvillafuertem
@mvillafuertem
@lefou Thanks a lot!