Skip to content

EOL Ammonite-Ops and Ammonite-Shell #1227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 28, 2021
Merged

EOL Ammonite-Ops and Ammonite-Shell #1227

merged 7 commits into from
Nov 28, 2021

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Nov 26, 2021

These two modules were an interesting experiment almost a decade ago, but overall usage has not panned out. Ammonite-Ops is largely replaced by https://github.com/com-lihaoyi/os-lib, even if it's not an exact match. Ammonite-Shell never really saw widespread usage: the vast majority of Ammonite users use Ammonite as a Scala REPL and script runner in addition to (rather than instead of) their default Bash/Zsh/etc. shells.

This PR deletes everything related to these modules: their implementation, build config, and docs. This should help shrink the codebase, simplify the codebase, and let us focus more clearly on what's important going forward

@lihaoyi lihaoyi force-pushed the kill-ops-shell branch 5 times, most recently from 5cf2a50 to 92a2f0c Compare November 26, 2021 08:51
@alexarchambault
Copy link
Collaborator

It would be great to remove those 👍.

I didn't review in detail yet, but, "the CI errors seem legit" (although the ones in repl tests don't make a lot of sense at first…).

@lihaoyi
Copy link
Member Author

lihaoyi commented Nov 26, 2021

@alexarchambault I got all tests passing on Scala 2.x, but somehow there are Scala 3 failures I don't understand. Do you think you could take a look see if you can make sense of it?

@alexarchambault
Copy link
Collaborator

I'll try to have a look. IIRC I already ran into such errors, and fixed them by ensuring pprint_2.13 isn't in the class path with Scala 3 (and no pprint_3 in Scala 2.13 either).

@lihaoyi
Copy link
Member Author

lihaoyi commented Nov 27, 2021

@alexarchambault looks like I managed to shake the build a bit and get it to compile and pass tests. I don't actually understand what the stuff in the build.sc is doing, but I guess if it passes tests we're probably good?

build.sc Outdated
Comment on lines 308 to 325
def moduleDeps = Seq()
def ivyDeps = T{
if (scala3Versions.contains(crossScalaVersion))
Agg(
ivy"com.lihaoyi:pprint_3:${Deps.pprint.dep.version}",
ivy"com.lihaoyi:fansi_3:${Deps.fansi.dep.version}",
ivy"org.scala-lang:scala3-library_3:$crossScalaVersion"
)
else
Agg(
Deps.pprint,
Deps.fansi
Agg(

Deps.osLib,
Deps.scalaCollectionCompat,
Deps.fansi
) ++ (
if (scala3Versions.contains(crossScalaVersion))
Agg(
ivy"com.lihaoyi:pprint_3:${Deps.pprint.dep.version}",
ivy"org.scala-lang.modules::scala-collection-compat:${Deps.scalaCollectionCompat.dep.version}",
ivy"org.scala-lang:scala3-library_3:$crossScalaVersion"
)
else Agg(
Deps.pprint
)
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexarchambault In particular i have no idea what this part is doing haha

Copy link
Collaborator

@alexarchambault alexarchambault Nov 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, crossScalaVersion can be like 3.x, but as supports3 is false (the default), we compile this module with Scala 2.13 anyway. But crossScalaVersion like 3.x implies it's meant to be consumed by Scala 3 modules nonetheless, so we force some dependencies to have a _3 suffix (and also pull scala3-library, that Mill-built libraries don't pull automatically). It's required for dependencies having macros, like pprint (as Scala 2 and 3 macros are different, and pprint doesn't rely on the Scala 2 & 3 macro mixing stuff).

Copy link
Collaborator

@alexarchambault alexarchambault Nov 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the ivy"org.scala-lang.modules::scala-collection-compat:…" seems superfluous here, as it doesn't force any suffix, and there's already Deps.scalaCollectionCompat a few lines before.

Copy link
Collaborator

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I guess!

@lihaoyi lihaoyi merged commit 7aaa308 into master Nov 28, 2021
@lolgab lolgab deleted the kill-ops-shell branch November 28, 2021 09:30
@alexarchambault
Copy link
Collaborator

Seems the (somewhat annoying, but somewhat useful too 😅) noLongLines test went away with this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants