Releases: Programming-Rivers/rules_scala_native
v0.1.1-rc1
Release Notes: rules_scala_native v0.1.1-rc1
This release candidate focuses on improving cross-compilation reliability, enhancing Windows support, and introducing internal testing for the Starlark rules.
What's New
Improved Windows Support
Significant progress has been made in stabilizing the Windows toolchain.
- Archiver Fix: Resolved the "ar not found" error during the Scala Native linking phase on Windows.
- Path Construction: Improved logic for constructing the linker
PATH, ensuring standard system paths (likeSystem32) are included when necessary.
🛠️ Refined Cross-Compilation Logic
- Target Triple Logic: Extrated and decoupled target triple derivation for better maintainability and testability.
- Platform Flags: Improved derivation of platform-specific linker flags for POSIX and Windows systems.
🧪 Internal Quality Assurance
- Starlark Unit Tests: Added a comprehensive suite of unit tests for rule internals, including
target_triplehelpers andScalaNativeInfoprovider verification.
📚 Documentation & Examples
- External C Dependencies: Added a new example project demonstrating how to link against external C libraries (like
WiringPi) while cross-compiling for Raspberry Pi.
Installation
Update your MODULE.bazel file to use the new version:
# MODULE.bazel (partial)
bazel_dep(name = "rules_scala_native", version = "0.1.1-rc1")
# Required dependencies remain the same
bazel_dep(name = "rules_scala", version = "7.2.2")
bazel_dep(name = "llvm", version = "0.6.1")
# Register toolchains
register_toolchains(
"@llvm//toolchain:all",
"@rules_scala_toolchains//...:all",
"@rules_scala_native//scala_native:scala_native_toolchain",
)Contributors
Full Changelog:
v0.1.0
Release Notes: rules_scala_native v0.1.0
We are excited to announce the first release candidate for rules_scala_native, bringing scalable, hermetic Scala Native builds to the Bazel ecosystem.
Key Features
📦 Bzlmod First
Full support for Bazel's modern dependency management system (Bzlmod). No WORKSPACE configuration required.
🌐 Advanced Cross-Compilation
Seamlessly target multiple architectures and operating systems using a hermetic LLVM/Clang toolchain.
- Verified Host: Linux x86_64
- Verified Targets: 72 combinations including Linux (glibc 2.28+, musl), macOS, and Windows.
- Supported Architectures: x86_64, aarch64.
🔌 Polyglot Interoperability
Easy integration with other native languages via Bazel dependencies. Link scala_native_binary against:
cc_library(C/C++)rust_static_library(viarules_rust)zig_static_library(viarules_zig)
🧪 First-Class Testing
Native support for JUnit tests via scala_native_test, ensuring your native code is as reliable as your JVM code.
Installation
Add the following to your MODULE.bazel file:
# MODULE.bazel (partial)
bazel_dep(name = "rules_scala_native", version = "0.1.0")
# Required dependencies
bazel_dep(name = "rules_scala", version = "7.2.2")
bazel_dep(name = "llvm", version = "0.6.1")
# Register toolchains
register_toolchains(
"@llvm//toolchain:all",
"@rules_scala_toolchains//...:all",
"@rules_scala_native//scala_native:scala_native_toolchain",
)Requirements
- Bazel: 9.0.0 or higher
- Scala: 3.8.1
- Scala Native: 0.5.10
Current Limitations
- Windows support is currently in early stage (work-in-progress).
scala_native_testrequires explicit listing of test suites.- Only Scala 3.8.1 and Scala Native 0.5.10 are officially supported in this release.
Contributors
A huge thanks to everyone on the Scala who contributed to this release!
Full Changelog: https://github.com/Programming-Rivers/rules_scala_native/commits/v0.1.0