search term:

tree-sitter-scala 0.22.0

Hi everyone. On behalf of the tree-sitter-scala project, I am happy to announce tree-sitter-scala 0.22.0. The first two segments of the version number comes from the tree-sitter-cli that was used to generate the parser, and the last segment is our actual version number. tree-sitter-scala 0.22.0 uses tree-sitter 0.22.x.

About tree-sitter-scala

tree-sitter-scala is a Scala parser in C language, generated using Tree-sitter CLI, and conforming to the Tree-sitter API. Tree-sitter parsers are generally fast, incremental, and robust (ok with partial errors). We publish Rust binding to crates.io.

setup-sbt GitHub Action

In February 2024, GitHub released macOS 13 and 14 runner images, making it possible to run CI on ARM macs easily. However, people who started using it noticed that sbt runner script was missing from the new macOS images (actions/runner-images#9369). ubuntu-24.04 is also missing sbt runner.

I’ve created sbt/setup-sbt action to install the official sbt runner script and the launcher.

sbt 1.10.0

Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.10.0. This is the tenth 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. Please try it out, and report any issues you might come across.

The headline features of sbt 1.10.0 are:

  • SIP-51 Support for Scala 2.13 Evolution
  • A wide range of Zinc fixes contributed by Jerry Tan and others
  • CommandProgress API
  • ConsistentAnalysisFormat: New Zinc Analysis serialization

sbt 1.10.0-RC2

Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.10.0-RC2. This is the tenth 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. Please try it out, and report any issues you might come across.

The headline features of sbt 1.10.0 are:

  • SIP-51 Support for Scala 2.13 Evolution
  • A wide range of Zinc fixes contributed by Jerry Tan and others
  • CommandProgress API
  • ConsistentAnalysisFormat: New Zinc Analysis serialization

sbt 2.x remote cache with Bazel compatibility

This is part 3 of the sbt 2.x remote cache series. I’ve have been developing sbt 2.x for a few years in my own free time, and lately Scala Center is joining the effort. These posts are extended PR descriptions to share the features that will come to the future version of sbt, hopefully. About a year ago I proposed a design for automatic cached task for sbt 2.x in RFC-1: sbt cache ideas, and in the sbt 2.

tree-sitter-scala 0.21.0

Hi everyone. On behalf of the tree-sitter-scala project, I am happy to announce tree-sitter-scala 0.20.3 and 0.21.0. The first two segments of the version number comes from the tree-sitter-cli that was used to generate the parser, and the last segment is our actual version number.

tree-sitter-scala 0.21.0 uses tree-sitter 0.21.x; and tree-sitter-scala 0.20.3 uses tree-sitter 0.20.x.

About tree-sitter-scala

tree-sitter-scala is a Scala parser in C language, generated using Tree-sitter CLI, and conforming to the Tree-sitter API. Tree-sitter parsers are generally fast, incremental, and robust (ok with partial errors). We publish Rust binding to crates.io.

the holy graal of GitHub Actions

Last week on sbt/sbt#7427 @keynmol (Anton Sviridov) told me:

@eed3si9n I think this can be reopened, given that Github finally released free Apple Silicon workers - I think it’s best to modify the Github workflow to build all binaries automatically: sbt/sbtn-dist#11

I guess somehow I missed the memo for a whole month, but I’m happy that ARM macOS runners are here! In this post, let’s dig into how we automated GraalVM native image creation using GitHub Actions. If you’re in a hurry, see the working example native.yaml.

sbt 1.9.9

Hi everyone. On behalf of the sbt project, I’m happy to announce sbt 1.9.9, a Scala 2.13.13 commemorative patch release. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.9.9

See 1.9.0 release note for the details on 1.9.x features.

Highlights

  • To fix console task on Scala 2.13.13, sbt 1.9.9 backports updates to JLine 3.24.1 and JAnsi 2.4.0 by @hvesalai in #7503 / #7502
  • To fix sbt 1.9.8’s UnsatisfiedLinkError with stat, sbt 1.9.9 removes native code that was used to get the millisecond-precision timestamp that was broken (JDK-8177809) on JDK 8 prior to OpenJDK 8u302 by @eed3si9n in io#367

sbt website update 2024

This is a writeup on sbt’s website scala-sbt.org updates, some concrete, others more of half-baked ideas. Background I’ve been the primary maintainer of the site since 2014. Though I have written some of the pages, most of the content had been written by Mark and Havoc by the time I took over. You can see on 2014 archive that the site was Sphinx doc. The first things I did in 2014 on the site was to migrate from Sphix, which used reStructuredText, to Markdown on Pamflet, a static site generator created by Nathan, and later I inherited.

vegan osechi 2024

My wife and I prepare osechi (お節), japanese new year food some vegan, others non-veg. Some homemade, others store-bought. This year, we tried to stick to vegan, and documented the process. This is mostly for our own reference, but we hope it might help others out there. toshikoshi soba (年越し蕎麦) For good luck, we eat soba noodle at midnight, crossing into new year. I have no idea what the noodle is supposed to symbolize.

sbt 2.x remote cache

introduction

A remote cache, or a cloud build system, can speed up builds dramatically by sharing build results (Mokhov 2018). This is a feature that I’ve been interested ever since heard about Blaze (now open sourced as Bazel). In 2020, I implemented cached compilation in sbt 1.x. reibitto has reported that “what was once 7 minutes to compile everything now takes 15 seconds.” Others have also reported 2x ~ 5x speedup. While this is promising, it’s a bit clunky and it works only for the compile task. In March 2023, I jotted down RFC-1: sbt cache ideas to outline the current issues and a solution design. Here are some of the problems:

  • Problem 1: sbt 1.x implements remote caching for compile, and disk caching for some other tasks, but we would like a solution that custom tasks can participate
  • Problem 2: sbt 1.x has separate mechanism for disk cache and remote cache, but we would like one mechanism that build user can switch between local or remote cache
  • Problem 3: sbt 1.x used Ivy resolver as the cache abstration, but we’d like a more open design for remote cache backend

As my december adventure 2023 project I decided to tackle the sbt 2.x remote cache feature in my free time. The proposal is on GitHub #7464. This post explores the details of the change. Note: It shouldn’t require too much of sbt internal knowledge, but the target audience is advanced since this is more of an extended PR description.

JDK 21 and 22-ea on GitHub Actions

JDK 21 just came out, and given its LTS status projects are encouraged to test their code on JDK 21. A few projects are already starting to test on JDK 22-ea as well. Here’s a quick tutorial of how to test your project on GitHub Actions with JDK 21 or JDK 22-ea using actions/setup-java. JDK 21 For cross building on JDK 21, follow Setting up GitHub Actions with sbt on the official docs.

sbt 1.9.7

Hi everyone. On behalf of the sbt project, I’m happy to announce sbt 1.9.7 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.9.7

See 1.9.0 release note for the details on 1.9.x features.

Highlights

  • CVE-2023-46122. sbt 1.9.7 updates its IO module to 1.9.7, which fixes parent path traversal vulnerability in IO.unzip. This was discovered and reported by Kenji Yoshida (@xuwei-k), and fixed by @eed3si9n in io#360.

ifdef in Scala via pre-typer processing

This is part 2 of implementing Rust’s cfg attribute in Scala. In part 1, I tried the annotation macro with a mixed result. I’ve implemented a version of @ifdef that works better.

what does cfg attribute do?

Rust Programming Language says:

Rust has a special attribute, #[cfg], which allows you to compile code based on a flag passed to the compiler.

This lets us write unit test in the same source as the library code like this:

...

#[cfg(test)]
mod tests {
    #[test]
    fn some_test() {
        ...
    }
}

When I first heard about this, it sounded a bit absurd since I’ve never used languages that embeds tests into the main source code. But now that I’ve been working with Rust occasionally, I like the idea of being able to write the tests in the same source, especially for kind of code that can be exercised as functions. When it gets too messy, you can always split them out in src/test/scala/ or tests/ in Rust.

ifdef macro in Scala

Update 2023-10-15: There’s now a better 0.2.0 that I implemented via pre-typer processing.

Rust has an interesting feature called cfg attribute, which is aware of the build configuration at the language level. This lets us write unit test in the same source as the library code like this:

...

#[cfg(test)]
mod tests {
    #[test]
    fn some_test() {
        ...
    }
}

I implemented an experimental @ifdef macro that does something similar.

sbt 1.9.5

Update: ⚠️ sbt 1.9.5 is broken, because it causes Scala compiler to generate wrong class names for anonymous class on lambda. Please refrain from publishing libraries with it while we investigate. See cala/bug#12868 for details.

Hi everyone. On behalf of the sbt project, I’m happy to announce sbt 1.9.5 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.9.5

See 1.9.0 release note for the details on 1.9.x features.

Highlights

tree-sitter-scala 0.20.2

Hi everyone. On behalf of the tree-sitter-scala project, I am happy to announce tree-sitter-scala 0.20.2. The first two segments of the version number comes from the tree-sitter-cli that was used to generate the parser, and the last segment is our actual version number.

About tree-sitter-scala

tree-sitter-scala is a Scala parser in C language, generated using Tree-sitter CLI, and conforming to the Tree-sitter API. Tree-sitter parsers are generally fast, incremental, and robust (ok with partial errors).

automate refactoring with Bazel + Scalafix

about Scalafix As a code base becomes larger, it’s useful to have language tooling that can perform automatic refactoring. Thankfully, in 2016 Scala Center created Scalafix. In the announcement blog post Ólafur Geirsson wrote: Scalafix takes care of easy, repetitive and tedious code transformations so you can focus on the changes that truly deserve your attention. In a nutshell, scalafix reads a source file, transforms usage of unsupported features into newer alternatives, and writes the final result back to the original source file.

sbt 1.9.1

Hi everyone. On behalf of the sbt project, I’m happy to announce sbt 1.9.1 patch release is available. Full release note is here - https://github.com/sbt/sbt/releases/tag/v1.9.1

See 1.9.0 release note for the details on 1.9.x features.

Highlights

  • Change of contributor license agreement to Scala CLA, which transfers contribution copyrights to the Scala Center, instead of Lightbend by @julienrf (Julien Richard-Foy is Technical Director at Scala Center) in #7306
  • Publishing related bug fixes following up on sbt 1.9.0, contributed by Adrien Piquerez at Scala Center

tree-sitter-scala 0.20.1

Hi everyone. On behalf of the tree-sitter-scala project, I am happy to announce tree-sitter-scala 0.20.1. The first two segment of the version number comes from the tree-sitter-cli that was used to generate the parser, and the last segment is our actual version number.

About tree-sitter-scala

tree-sitter-scala is a Scala parser in C language, generated using Tree-sitter CLI, and conforming to the Tree-sitter API. Tree-sitter parsers are generally fast, incremental, and robust (ok with partial errors).

sbt 1.9.0

Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.9.0. This is the nineth 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. Please try it out, and report any issues you might come across.

The headline features of sbt 1.9.0 are:

  • POM consistency of sbt plugin publishing
  • sbt new, a text-based adventure
  • releaseNotesURL setting
  • Deprecation of IntegrationTest configuration

tree-sitter-scala 0.20.0

Hi everyone. On behalf of the tree-sitter-scala project, I am happy to announce tree-sitter-scala 0.20.0. The first two segment of the version number comes from the tree-sitter-cli that was used to generate the parser, and the last segment is our actual version number.

About tree-sitter-scala

tree-sitter-scala is a Scala parser in C language, generated using Tree-sitter CLI, and conforming to the Tree-sitter API. Tree-sitter parsers are generally fast, incremental, and robust (ok with partial errors).

sbt 1.9.0-RC3

Hi everyone. On behalf of the sbt project, I am happy to announce sbt 1.9.0-RC2. This is the nineth 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. Please try it out, and report any issues you might come across.

The headline features of sbt 1.9.0 are:

  • POM consistency of sbt plugin publishing
  • sbt new, a text-based adventure
  • releaseNotesURL setting
  • Deprecation of IntegrationTest configuration

making of a hybrid ScalaMatsuri

A two-day virtual/Tokyo hybrid ScalaMatsuri took place this weekend. Thanks to all the presenters, sponsors, and participants.

Lots of bumps and mishaps for sure, but hopefully it was a successful conference. I join as one of 16 ScalaMatsuri organizers, and also gave a talk and an open-mic session as well.

RFC-3: drop custom config

Author: Eugene Yokota Date: 2023-03-26 Status: Partially Accepted In sbt 2.0 ideas I wrote: idea 3-A: limit dependency configuration to Compile and Test Here are some more ideas to simplify sbt. sbt generally allows creating of custom dependency configuration, but it doesn’t work well. For the most part, anything that requires custom configuration should likely be handled using separate subproject instead. problem space Dependency configuration, such as Compile, Test etc, is a notion directly imported from Apache Ivy’s configuration, which allows custom configurations and extends-relationship among them.

RFC-2: sbt 2.0 RFC process

Author: Eugene Yokota Date: 2023-03-25 Status: Implemented problem space There are various technical decisions around sbt and Zinc that impact the Scala ecosystem, but currently the process of adding new features or changes to existing feature is not well defined. For the most part, the contributors like Scala Center and I come up with ideas and execute them. RFC process At the Tooling Summit in Lausanne this week, Iulian Dragos suggested we adopt “a lightweight process based on RFC (request for comments) docs that can serve as a design document.

RFC-1: sbt cache ideas

In sbt 2.0 ideas I wrote: idea 6: more disk cache and remote cache Extending the idea of cached compilation in sbt 1.4.0, we should generalize the mechanism so any task can participate in the remote caching. Here are some more concrete ideas for caching. problem space To summarize the general problem space, currently setting up disk caching for tasks is a manual work, so it’s under-utilized. Remote caching is limited to cached compilation.

sbt 2.0 ideas

It’s spring time, and spring makes us hopeful. I’ll be attending Tooling Summit next week, so I think this would be a good time to gather my toughts around sbt 2.

cross build anything with Bazel

Bazel generally prefers monoversioning, in which all targets in the monorepo uses the same version given any library (JUnit or Pandas). Monoversioning greatly reduces the version conflict concerns within the monorepo, and in return enables better code reuse. In practice, monoversioning has a drawback of tying everyone at the hip. If service A, B, C, D, etc are all using Big Framework 1.1, it becomes costly to migrate all to Big Framework 1.