Firtool Resolver is a Scala library and command-line application for resolving and downloading LLVM Firtool. It downloads binaries directly from CIRCT's GitHub releases and verifies their SHA-256 checksums.
LLVM Firtool Native (org.chipsalliance:llvm-firtool) and FNDDS are legacy distribution mechanisms. The last version published to Maven Central is 1.162.0; existing artifacts and classpath overrides continue to work.
import firtoolresolver.Resolve
Resolve(projectName = "chisel", defaultVersion = "1.163.0") match {
case Right(binary) => println(binary.path)
case Left(error) => sys.error(error)
}The project name determines the names of the configuration settings. It must start with an ASCII letter and contain only ASCII letters, digits, and underscores.
Use Resolve("chisel", "1.163.0", verbose = true) for debug logging or Resolve(logger, "chisel", "1.163.0") for a custom logger. The deprecated overloads without a project name behave as if you passed "chisel".
The command-line interface is firtool-resolver [--project <name>] [-v] <version>. The project defaults to chisel. For example:
cs launch --scala 2.13 org.chipsalliance::firtool-resolver:2.2.0 \
--main firtoolresolver.Main -- -v 1.163.0- Run
firtoolfrom the configured executable directory, if set. An invalid path or a binary that cannot run is an unrecoverable error. - Choose the effective version: use the configured version override or the caller's default version. An explicit override skips the classpath lookup and warns if
llvm-firtoolis also on the classpath. - If no explicit version is set, honor
llvm-firtoolon the classpath. This legacy mechanism logs a deprecation message at info level. - Reuse the cached binary at
<cache>/<effective-version>/bin/firtool. - Download the effective version from GitHub, verify its checksum, and atomically install just the executable in the cache. Downloads are locked per version across processes.
Settings are read from <project>.firtool.* system properties and <PROJECT>_FIRTOOL_* environment variables, where the project name is lowercased for system properties and uppercased for environment variables. For project chisel, the keys are:
| Setting | System property | Environment variable | Default |
|---|---|---|---|
| Executable directory | chisel.firtool.path |
CHISEL_FIRTOOL_PATH |
Unset |
| Version override | chisel.firtool.version |
CHISEL_FIRTOOL_VERSION |
Caller's default version |
| Release base URL / mirror | chisel.firtool.url |
CHISEL_FIRTOOL_URL |
https://github.com/llvm/circt/releases/download |
| Cache directory | chisel.firtool.cache |
CHISEL_FIRTOOL_CACHE |
OS-specific firtool cache directory |
Properties take precedence over the corresponding environment variables.
Direct downloads require access to github.com and release-assets.githubusercontent.com. Standard JVM proxy properties (https.proxyHost, https.proxyPort, and the corresponding HTTP properties for HTTP mirrors) are honored.
To use an internal web server (HTTP or HTTPS), an Artifactory generic remote, or a local file: mirror, set the release base URL. The mirror must provide both the archive and its .sha256 file at:
<base>/firtool-<version>/firrtl-bin-<platform>.<ext>
<base>/firtool-<version>/firrtl-bin-<platform>.<ext>.sha256
| Resolver platform | Release asset |
|---|---|
linux-x64 |
firrtl-bin-linux-x64.tar.gz |
macos-x64 |
firrtl-bin-macos-x64.tar.gz |
macos-aarch64 |
firrtl-bin-macos-arm64.tar.gz |
windows-x64 |
firrtl-bin-windows-x64.zip |
GitHub fetching supports versions starting at 1.45.0. Native macOS arm64 assets start at 1.144.0; earlier versions fall back to macOS x64 through Rosetta. For versions older than 1.45.0, provide a local binary or a legacy jar on the classpath.
Run ./mill -i 'firtool-resolver[_].test' for the tests on both Scala versions, or ./mill -i 'firtool-resolver[2.13].test' for just Scala 2.13.
The tests are MUnit tests that run the resolver in real JVMs against local fixtures (a fake release mirror, classpath resources, and local HTTP servers), once from the unshaded classes and once from the shaded jar as published. They also check the contents of the published jar.
LiveTests downloads and runs a real firtool release from GitHub. It needs network access, is tagged live, and runs by default. Use MUnit's tag filters to select which tests to run:
# Hermetic tests only
./mill -i 'firtool-resolver[2.13].test' --exclude-tags=live
# Live tests only
./mill -i 'firtool-resolver[2.13].test' --include-tags=liveThis specification follows Semantic Versioning 2.0.0.
Specification version: 1.0.0
Platformsare defined to be a tuple of aoperating systemand anarchitecturewritten as<os>-<arch>which can also be written as<platform>.- The defined operating systems are
linux,windows, andmacos. - The defined architectures are
x64andaarch64. - A Project SHALL have a
groupId,artifactId, andversion. - A Project MAY support any number of
Platforms. - Artifacts SHALL be published as a Maven Artifact
- The Maven Artifact
groupIdSHALL be the same as the projectgroupId. - The Maven Artifact
artifactIdSHALL be the projectartifactId. - The Maven Artifact
versionSHALL be the projectversionand MAY include a suffix starting with-. - The Maven Artifact MAY include additional jars distinguished by classifiers corresponding to supported
Platforms.
- The Maven Artifact
- The Maven Artifact SHALL contain a
baseDirectorydefined to be<groupId>/<artifactId>. - The Maven Artifact SHALL contain one or more
artifactDirectoriesdefined to be<baseDirectory>/<platform>(for each supportedPlatform). - The
baseDirectorySHALL contain a file calledFNDDS.versioncontaining only the version of this specification adhered to by the artifact, encoded using UTF-8. - The
baseDirectorySHALL contain a file calledproject.versioncontaining only theversionof the artifact, encoded using UTF-8. - Maven Artifacts published for various
Platformsfor a single Artifact must conform to the sameFNDDS.versionandproject.version. - The
artifactDirectoryfor each supportedPlatformMAY contain any other project-specific files including executables compiled for the specific<platform>.
Initial Version
The purpose of this specification is to enable distributing native executables (especially Firtool) as standard Maven artifacts.
It is indended to help bridge the gap between the cross-platform flexibility of JVM applications with the platform-specific requirements of native executables.
As such, it is important that executables for different platforms can co-exist on the same Java classpath so that JVM applications may be distributed with a multitude of native libraries so they can appear to be platform-agnostic despite the native dependency.
It may seem strange that the FNDDS.version file exists in the baseDirectory such that it will be clobbered by related artifacts for different architectures.
This design decision is a compromise--it is expected that the Platform specification will evolve to support more platforms while all Maven Artifacts for a specific Artifact must have the same FNDDS.version.