chipsalliance / chipsalliance/chisel
Running Chisel in GitHub Action causes Firrtl permission error
- Dominant language
- Scala
- Stars
- 4.8k
- Forks
- 658
- Avg merge
- 18h 59m
- Merged PRs (30d)
- 14
Description
**Type of issue**: Bug Report
**Please provide the steps to reproduce the problem:**
I have been using the GitHub workflow below for a long time. When I bump the Chisel version to the latest 6.7.0, it fails.
```
name: Continuous Integration
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
jobs:
code-check:
...
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Verilator
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: verilator
version: 1.0
- name: Setup Coursier Cache
uses: coursier/cache-action@v6
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Mill
uses: zhutmost/setup-mill@main
- name: Run tests
run:
mill __.test
```
The error log is:
```
...
[242-0] - should return the same result as MuxPriority, or the default value if no sel signal is asserted *** FAILED ***
[242-0] circt.stage.phases.Exceptions$FirtoolNotFound: Error resolving firtool
[242-0] ------------------------------------------------------------------------------
[242-0] Chisel requires firtool, the MLIR-based FIRRTL Compiler (MFC), to generate Verilog.
[242-0] Something is wrong with your firtool installation, please see the following logging
[242-0] information.
[242-0] Failed to fetch firtool:
[242-0] CHISEL_FIRTOOL_PATH not set
[242-0] firtool version not found in resources (jdk.internal.loader.ClassLoaders$AppClassLoader@639fee[48](https://github.com/zhutmost/chipmunk/actions/runs/15939285662/job/44964885713#step:8:49)/org.chipsalliance/llvm-firtool/project.version)
[242-0] Copying firtool failed with java.nio.file.FileAlreadyExistsException: /home/runner/.cache/llvm-firtool/1.62.1/bin/firtool
[242-0] ------------------------------------------------------------------------------
```
So I tried to manually install Firrtool in the GitHub workflow (with environment variable `CHISEL_FIRTOOL_PATH `). But it still fails. Chisel ignored the env variable and still uses the built-in firtool.
All the code is open-sourced, you can find the Action log here. [Link](https://github.com/zhutmost/chipmunk/actions/runs/15939285662/job/44964885713).
**What is the current behavior?**
**What is the expected behavior?**
It should run the Chisel tests in GitHub Actions successfully.
**Please tell us about your environment:**
GitHub Action environment with Ubuntu 24.04.
Chisel version is the latest stable one (6.7.0).
Mill version is 1.0.0-RC2
**Other Information**
**What is the use case for changing the behavior?**
N/A
Contributor guide
Research direction
Start with the GitHub Actions workflow shown and reproduce `mill __.test` on Ubuntu 24.04 with Chisel 6.7.0. Trace firtool resolution, including the `CHISEL_FIRTOOL_PATH` environment variable and the existing `/home/runner/.cache/llvm-firtool/1.62.1/bin/firtool`; done means the Chisel tests run successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, scala
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100