git bisecting scala/scala
git bisecting is a useful technique to locate the source of a bug. For scala/scala in particular,bisect.sh
can save a lot of time by using the pre-build compiler artifacts on the Scala CI Artifactory.
sbt 1.4.7
I’m happy to announce sbt 1.4.7 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.7 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.7 This mechanism allows that sbt 1.4.7 is used only for the builds that you want. Highlights Updates to Coursier 2.0.9, fixing authentication with Sonatype Nexus #6278 / [coursier#1948] by @cchepelov Fixes Ctrl-C printing out stack trace #6213 by @eatkins GNU Emacs support for sbtn and sbt --client #6276 by @fommil Participation sbt 1.sbt 1.4.6
I’m happy to announce sbt 1.4.6 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.6 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.6 This mechanism allows that sbt 1.4.6 is used only for the builds that you want. Highlights Updates to Coursier 2.0.8, which fixes the cache directory setting on Windows (Fix contributed by Frank Thomas) Fixes performance regression in shell tab completion #6214 by @eed3si9n Fixes match error when using withDottyCompat lm#352 by @eed3si9n Fixes thread-safety in AnalysisCallback handler zinc#957 by @dotta Participation sbt 1.enforcing Semantic Versioning with sbt-strict-update
Rob wrote: I want to tell sbt “this specific version breaks binary compatibility, so don’t resolve it via eviction, fail the build instead.” How do I do this? Complete answers only, I’m done trying to figure it out by following clues. I wrote a small sbt plugin sbt-strict-update to do this. Add this to project/plugins.sbt: addSbtPlugin("com.eed3si9n" % "sbt-strict-update" % "0.1.0") and then add this to build.sbt: ThisBuild / libraryDependencySchemes += "org.sbt 1.4.5
I’m happy to announce sbt 1.4.5 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.5 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.5 This mechanism allows that sbt 1.4.5 is used only for the builds that you want. Highlights sbt 1.4.5 adds support for Apple silicon (AArch64 also called ARM64) #6162/#6169 by @eatkins Updates to Coursier 2.unit of intensive care (2020.12 mixtape)
- Spotify: https://open.spotify.com/playlist/1mQ6JuDwWlYvuqqji53E4N?si=AopTuNoTTyCVBcOraXiZ-w
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotW71OG0WR0XTJl3IlcJGNIZ
4h
auto publish sbt plugin from GitHub Actions
This is a GitHub Actions version of auto publish sbt plugin from Travis CI. In this post, we’ll try to automate the release of an sbt plugin using Ólaf’s olafurpg/sbt-ci-release. The README of sbt-ci-release covers the use case for a library published to Sonatype OSS. Read it thoroughly since this post will skip over the details that do not change for publishing sbt plugins. Automated release in general is a best practice, but there’s one benefit specifically for sbt plugin releases.scopt 4
This post was first published in December 2018 together with 4.0.0-RC2. It’s updated to reflect the changes made in November 2020 for 4.0.0. You can skip to the readme, if you’re in a hurry. To try new scopt 4.0.0: libraryDependencies += "com.github.scopt" %% "scopt" % "4.0.0" scopt 4.0.0 is cross published for the following build matrix: Scala JVM JS (1.x) JS (0.6.x) Native (0.4.0-M2) Native (0.3.x) 3.0.0-M2 ✅ ✅ n/a n/a n/a 3.Weehawken-Lang1
about Weehawken-Lang It’s a strange time we live in. We can’t just meet up and catch up and talk about coding. This also opens an opportunity to think more virtually about the idea of meetups. I want to start Weehawken-Lang, a virtual meetup group about programming languages and tooling design (compilers, interpreters, build tools etc). It aims to be a casual place where people with different language backgrounds can exchange ideas about programming languages.sbt 1.4.4
I’m happy to announce sbt 1.4.4 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.4 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.4 This mechanism allows that sbt 1.4.4 is used only for the builds that you want. Highlights Updates SemanticDB to 4.4.0 to support Scala 2.sbt 1.4.3
I’m happy to announce sbt 1.4.3 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.3 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. This installer includes the sbtn binary. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.3 This mechanism allows that sbt 1.4.3 is used only for the builds that you want.sbt 1.4.2
I’m happy to announce sbt 1.4.2 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.2 How to upgrade Download the official sbt launcher from SDKMAN or download from https://github.com/sbt/sbt/releases/. This installer includes the sbtn binary. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.2 This mechanism allows that sbt 1.4.2 is used only for the builds that you want.remote caching sbt builds with Bintray
The feature in sbt and Zinc 1.4.x that I spent most amount of time and energy probably is the virtualization of file, and lifting out timestamps. Combined together, we can liberate the Zinc state from machine-specificity and time, and become the foundation we lay towards building incremental remote caching for Scala. I blogged about this in cached compilation for sbt. This is part 2. Now that sbt 1.4.x is out, there is a growing interest in this feature among people who want to try this out.sbt 1.4.1
I’m happy to announce sbt 1.4.1 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.4.1 How to upgrade Download the official sbt launcher from SDKMAN or download from https://www.scala-sbt.org/download.html. This installer includes the sbtn binary. In addition, the sbt version used for your build is upgraded by putting the following in project/build.properties: sbt.version=1.4.1 This mechanism allows that sbt 1.4.1 is used only for the builds that you want.virtualizing a hackathon at ScalaMatsuri 2020
Here’s a report of running a virtual hackathon at ScalaMatsuri Day 2 Unconference. Someone proposed it for the Unconference, and I volunteered to be a facilitator on the day, so I went in without preparation. I booked the time originally for 4h (noon - 4pm JST, 11pm - 3am EDT) but it was successful so it got extended after some coffee break. One thing I emphasize is The Law of Two Feet:Equality in Scala
I gave a talk at ScalaMatsuri on ‘Equality in Scala’
sbt 1.4.0
Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.4.0. This is the fourth feature release of sbt 1.x, a binary compatible release focusing on new features. sbt 1.x is released under Semantic Versioning, and the plugins are expected to work throughout the 1.x series.
The headline features of sbt 1.4.0 are:
- build server protocol (BSP) support
- sbtn: a native thin client for sbt
- build caching
ThisBuild / versionScheme
to take the guessing out of eviction warning
sbt 1.4.0-RC2
Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.4.0-RC2. This is the fourth feature release of sbt 1.x, a binary compatible release focusing on new features. sbt 1.x is released under Semantic Versioning, and the plugins are expected to work throughout the 1.x series.
- If no serious issues are found by Saturday, October 3rd 2020, 1.4.0-RC2 will become 1.4.0 final.
If no serious issues are found by Saturday, September 19th 2020, 1.4.0-RC1 will become 1.4.0 final.
The headline features of sbt 1.4.0 are:
- build server protocol (BSP) support
- sbtn: a native thin client for sbt
- build caching
ThisBuild / versionScheme
to take the guessing out of eviction warning
metropolitan house supply (2020.09 mixtape)
- Spotify: https://open.spotify.com/playlist/62RqkwMDQ6k8o88fjE7Oc2?si=8tT0-NnoRUK3E0-Kug1akg
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotVrO_XPe6q_yrfcpYFegLwG
4h 29m
parallel cross building sandwich
This is part 4 of the post about sbt-projectmatrix, an experimental plugin that I’ve been working to improve the cross building in sbt. Here’s part 1, part 2, and part 3. I’ve just released 0.6.0. recap: building against multiple Scala versions After adding sbt-projectmatrix to your build, here’s how you can set up a matrix with two Scala versions. ThisBuild / organization := "com.example" ThisBuild / scalaVersion := "2.12.12" ThisBuild / version := "0.joining Twitter
I’m excited to announce that I’m joining Twitter’s Build Team to work on the next generation of efficient build systems supporting thousands of Twitter developers worldwide. Today’s my first day. This is the team that developed monorepo build tool Pants, and is transitioning to migrate the flock to Bazel. This presented a unique opportunity for me to work with a team of people passionate about developer experience and productivity, and I’m looking forward to getting to know the team, and learning the new challenges.sbt-buildinfo 0.10.0
I’m happy to announce sbt-buildinfo 0.10.0. sbt-buildinfo is a small sbt plugin to generate BuildInfo
object from your build definitions.
Since the last feature release was in 2018, there have been some pending contributions. I think the important thing is that it compiles with -Xlint
and -Xfatal-warnings
on both Scala 2.13.3 and 2.12.12.
auto publish sbt plugin from Travis CI
In this post, we’ll try to automate the release of an sbt plugin using Ólafur’s olafurpg/sbt-ci-release. The README of sbt-ci-release covers the use case for a library published to Sonatype OSS. Read it thoroughly since this post will skip over the details that do not change for publishing sbt plugins. Automated release in general is a best practice, but there’s one benefit specifically for sbt plugin releases. Using this setup allows multiple people to share the authorization to release an sbt plugin without adding them to Bintray sbt organization.pb by j
Spotify: https://open.spotify.com/playlist/5BkvksBTbrngqXxhF6wUAc?si=Kj8TrnhRQICDTgadvYYt2w YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotXfMWZPzm6K_L0CRPgFhxGh 2h 4m
Defx: file explorer plugin for Neovim
sbt 1.3.13
I’m happy to announce sbt 1.3.13 patch release. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.3.13.
Special thanks to Scala Center. It takes time to review bug reports, pull requests, make sure contributions land to the right places, and Scala Center sponsored me to do maintainer tasks for sbt during June.
reentrance protocol (2020.06 mixtape)
- Spotify: https://open.spotify.com/playlist/4fAHIQhqD4GdaqoCZVrULG?si=crwaw9y-Q-yfqwErXiTqJg
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotXZXAHittTWaNgO3uGdvls7
3h 59m
sbt 1.3.12
I’m happy to announce sbt 1.3.12 patch release. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.3.12. Special thanks to Scala Center. It takes time to review bug reports, pull requests, make sure contributions land to the right places, and Scala Center sponsored me to do maintainer tasks for sbt during May. Darja + whole Scala Center crew have been chill to work with. Change since sbt 1.3.11 There was a regression in sbt 1.sbt 1.3.11
I’m happy to announce sbt 1.3.11 patch release. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.3.11. Special thanks to Scala Center. It takes time to review bug reports, pull requests, make sure contributions land to the right places, and Scala Center sponsored me to do maintainer tasks for sbt during May. Darja + whole Scala Center crew have been chill to work with. How to upgrade Normally changing the project/build.properties toJar Jar Abrams
Jar Jar Abrams is an experimental Scala extension of Jar Jar Links, a utility to shade Java libraries. For library authors, the idea of other library is a double-edged sword. On one hand, using other libraries avoids unnecessary duplication of work, not using other libraries is almost hypocritical. On the other hand, each library you add would add a transitive dependency to your users, increasing the possibility of conflict. This is partly due to the fact that within a single running program you can one have one version of a library.Selective functor in sbt
In sbt core concepts talks I’ve been calling sbt a casually functional build tool. Two hallmarks of functional programming are that it uses immutable data structure instead of mutation, and that it gives attention to when and how effects are handled. settings and tasks From this perspective, we can think of setting expressions and tasks to be those two things: Settings form an immutable graph in a build. Tasks represent effects.keeping promise in sbt
build.sbt is a DSL for defining a task graph to be used for automatic parallel processing. The message passing among the tasks are expressed using something.value macro, which encodes Applicative composition (task1, task2) mapN { case (t1, t2) => .... }. One mechanism I’ve been thinking about is allowing some long-running task1 to communicate with task2 midway. Normally, we would break down task1 into two subtasks. But it might not be as straight-forward to implement such thing.cached compilation for sbt
The notion of cached compilation or remote cache has been around for a while now, but often it required the setup has not been easy. If we can bake build-as-function feature into basic tool chain such as Zinc and sbt, Scala community in general can benefit from it to speed up the build. Even for open source projects, if Travis CI publishes into Bintray or something, the contributors might be able to resume compilation off of the last build. The PR for sbt change is sbt/sbt#5534, and the virtualization change in Zinc is sbt/zinc#712.sbt 1.3.10
I’m happy to announce sbt 1.3.10 patch release. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.3.10 How to upgrade Normally changing the project/build.properties to sbt.version=1.3.10 would be ok. However, given that the release may contain fixes to scripts and also because your initial resolution would be faster with *.(zip|tgz|msi) that contains all the JAR files, we recommend you use the installer distribution. They will be available from SDKMAN etc. Notes about Homebrew Homebrew maintainers have added a dependency to JDK 13 because they want to use more brew dependencies brew#50649.Zinc 1.4.0-M1
I’ve just released Zinc 1.4.0-M1. Note this is a beta release and it won’t be compatible with future 1.4.x, but I chose a commit fairly close to 1.3.x so it should be usable. Cross builds Zinc to Scala 2.12 and 2.13 zinc#754 by @eed3si9n Upgrades ScalaPB to 0.9.3 zinc#713 by @slandelle Replaces ZipUtils usage of deprecated java.util.Date with java.time zinc#714 by @slandelle Zinc is an incremental compiler for Scala. Though Zinc is capable of compiling Scala 2.parallel cross building, part 3
This is part 3 of the post about sbt-projectmatrix, an experimental plugin that I’ve been working to improve the cross building in sbt. Here’s part 1 and part 2. I’ve just released 0.5.0. recap: building against multiple Scala versions After adding sbt-projectmatrix to your build, here’s how you can set up a matrix with two Scala versions. ThisBuild / organization := "com.example" ThisBuild / scalaVersion := "2.12.10" ThisBuild / version := "0.6 years at Lightbend
I joined Lightbend (then Typesafe) in March, 2014. After six incredible years April 7, 2020 was my last day. I am grateful that I got the opportunity to work with an amazing group of people at Lightbend, partners, customers, and various people I got to meet at conferences. Looking back, before COVID-19 times, it’s almost surreal that I was flying to Europe, Asia, and North America every few months to attend conferences and tech meetings.user-land compiler warnings in Scala, part 2
Last week I wrote about #8820, my proposal to add user-land compiler warnings in Scala. The example I had was implementing ApiMayChange annotation. package foo import scala.annotation.apiStatus, apiStatus._ @apiStatus( "should DSL is incubating, and future compatibility is not guaranteed", category = Category.ApiMayChange, since = "foo-lib 1.0", defaultAction = Action.Warning, ) implicit class ShouldDSL(s: String) { def should(o: String): Unit = () } This was ok as a start, but a bit verbose.bianlu plant-based hotpot
serves 4? ingredients 1 head of napa cabbage 100 ml of semame oil 5 dried shiitake some dried kombu kelp 160g vermicelli bean thread frozen meatless meatballs kosher salt chili oil, chili oil with fried garlic, or chili powder (optional) cooked white rice steps put cold water in a large dutch oven with 5 dried shiitake and similar amount of dried kombu kelp. let it sit for a few hours covered.user-land compiler warnings in Scala
As a library author, I’ve been wanting to tag methods in Scala that can trigger custom warnings or compiler errors. Why would I want to intentionally cause a compiler error? One potential use case is displaying a migration message for a removed API. Restligeist macro: n. A macro that fails immediately to display migration message after implementation has been removed from the API. — ∃ugene yokot∀ (@eed3si9n) August 30, 2016 For example, if you try to use <<= in sbt 1.2020.03 mixtape
- Spotify: https://open.spotify.com/playlist/0PHmoJCo6yesLCHC1cFaBJ?si=mg6tqCRYTzWxRPLN6wdZlw
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotVTZp7NrT2vq7Y9npLmn1ty
4h 35m
equal protection under Eq law
The relationship given to Int
and Long
should be exactly the same as the relationship third-party library like Spire can write UInt
or Rational
with the first-class numeric types.
- We should make
1 == 1L
an error understrictEquality
- We should allow custom types to participate in constant expression conversion using
FromDigits
liberty, equality, and boxed primitive types
I want to understand how equality works in Scala. It’s a complicated topic that’s been going on for ten years. Major concerns are: null Unboxed number types Boxed number types Reference types Collections (especially of F[+A]) Understanding equality means knowing how these combinations are compared. Scala Language Specification The language spec provides some hints, although it does not have the full information. Chapter 12 contains the definition of Any as follows:Giter8 0.12.0
giter8.version
I added a small app called giter8-launcher for Giter8 0.12.0. The purpose of the app is to make the behavior of the Giter8 template more predictable. Today, template authors may create a template for some version of Giter8 X, but the users might use some other version of Giter8 Y that ships with “sbt new.”
One of the neat ideas about sbt is that no matter what version of sbt
script users might have it installed, the core sbt version is specified by the build author using project/build.properties
file. This significantly reduces the it-only-works-on-my-machine problem. giter8-launcher is analogous to sbt’s sbt-launcher. giter8-launcher clones the template and reads project/build.properties
file to determine the Giter8 version to render the template.
Template authors can now specify the Giter8 version in project/build.properties
file as:
giter8.version=0.12.0
music for new ark (2019.12 mixtape)
- Spotify: https://open.spotify.com/playlist/2EHJoRDsHC7SADeMGP2UDk?si=pgypMooVTQ-sGxQdR6_N2g
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotXojw-eMeoubAGXM3mF23SJ
3h 38m
parallel cross building with VirtualAxis
This is part 2 of the post about sbt-projectmatrix, an experimental plugin that I’ve been working to improve the cross building in sbt. Here’s part 1. I’ve just released 0.4.0. recap: building against multiple Scala versions After adding sbt-projectmatrix to your build, here’s how you can set up a matrix with two Scala versions. ThisBuild / organization := "com.example" ThisBuild / scalaVersion := "2.12.10" ThisBuild / version := "0.1.0-SNAPSHOT" lazy val core = (projectMatrix in file("core")) .Pamflet 0.8.2
Pamflet is a publishing application for short texts, particularly user documentation of open-source software.
Pamflet 0.8.2 updates its monospace typeface to SFMono, and undoes the incidental pink color that got introduced when I migrated from Blueprint to Bootstrap.
future left identity (2019.09 mixtape)
- Spotify: https://open.spotify.com/playlist/6h9uQj829uWehQUuexMMMI?si=WpiDaWnnRpKApATriCutww
- YouTube: https://www.youtube.com/playlist?list=PLSUh6oJ5ZotV7ai9WuaxhikdDTXpHuL5-
3h 8m
sbt 1.3.0
Released sbt 1.3.0.