-
Notifications
You must be signed in to change notification settings - Fork 578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to firtool-resolver #3458
Conversation
1e91e56
to
db4001d
Compare
db4001d
to
6004f67
Compare
I wonder how about merging firtool-resolver into the chisel repo? |
fe85427
to
c3cfe55
Compare
We could. I sort of like keeping it separate because llvm-firtool (the module for re-publishing firtool binaries as Java artifacts) lives in the same repo as firtool-resolver and thus can use firtool-resolver to test itself. |
274288c
to
62d27d3
Compare
Whereas in the past, the user was expected to provide the firtool binary on the PATH, Chisel will now manage the firtool binary automatically. Chisel users the following 3-step process for determining which binary to use: 1. If environment variable FIRTOOL_PATH is set, it will check for firtool in that directory 2. It will check the classpath for firtool provided by chipsalliance/llvm-firtool 3. It will download a default version of chipsalliance/llvm-firtool Both (2) and (3) will store the firtool binary in a sensible location depending on the user's operating system. See dirs-dev/directories-jvm for more information. The user can override this location by setting the FIRTOOL_CACHE environment variable.
62d27d3
to
f38075f
Compare
my point is, if living in chisel repo, it might be convenient to bump with the ci-nightly branch? It is good for those following the master branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
It's great to see this finally happening.
firtool -version >> $GITHUB_STEP_SUMMARY | ||
$FIRTOOL_PATH/firtool -version >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The full path should be unnecessary due to the circt/install-circt
action adding it to the path: https://github.com/circt/install-circt/blob/main/action.yml#L73
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, consider inlining this step with the previous step as they have the same predicate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking here was that the above step setting FIRTOOL_PATH will eventually be folded into circt/install-circt
, so I factored this in the way such that once that happens, we can just bump the circt/install-circt
version and delete the step above and everything will continue to work. Basically writing this code such that the expected next change will be extremely simple, does that make sense?
with: | ||
version: ${{ inputs.circt }} | ||
github-token: ${{ github.token }} | ||
# TODO have install-circt do this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this seems reasonable to do.
That would avoid this type of chained conditional steps. Such chained conditional steps usually seems like an anti-pattern. No real problem with this as-is, though.
.github/workflows/test.yml
Outdated
description: 'The CIRCT version to use (must be a valid release tag or "nightly")' | ||
description: 'The CIRCT version to use (must be a valid release tag, "default", "nightly", or "version-file")' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default may be a bit ambiguous. This is probably fine as-is. Consider either making this empty/not a required option or something more descriptive like "use-firtool-resolver".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah good point. I think I'll go with not-required (thus empty) because that makes more sense that you're not installing a specific input, you're just leaving it up to chisel.
I've marked this for backporting to 3.6. It's technical an API change since firtool on the PATH will now be ignored, but I think it's a worthwhile one for usability. Actually deploying this for 3.6.x and 5.x will require ensuring we have the right versions of firtool published with llvm-firtool |
1b6153c
to
adbcf9d
Compare
I see your point but I don't think that's going to be an issue. firtool-resolver (and llvm-firtool) are intended to be as independent of the actual APIs they wrap as possible. We may need to update them as firtool evolves packaging-wise (adding more artifacts, etc.) but never with the actual day-to-day APIs. I don't see a problem with keeping it backwards (and forwards) compatible enough to avoid needing to change it with nightly. |
Whereas in the past, the user was expected to provide the firtool binary on the PATH, Chisel will now manage the firtool binary automatically. Chisel users the following 3-step process for determining which binary to use: 1. If environment variable FIRTOOL_PATH is set, it will check for firtool in that directory 2. It will check the classpath for firtool provided by chipsalliance/llvm-firtool 3. It will download a default version of chipsalliance/llvm-firtool Both (2) and (3) will store the firtool binary in a sensible location depending on the user's operating system. See dirs-dev/directories-jvm for more information. The user can override this location by setting the FIRTOOL_CACHE environment variable. (cherry picked from commit 3938a46) # Conflicts: # .github/workflows/build-scala-cli-template.yml # .github/workflows/ci.yml # .github/workflows/test.yml # build.sbt # build.sc # common.sc # project/plugins.sbt # src/main/scala/circt/stage/phases/CIRCT.scala # src/test/scala/chiselTests/LoadMemoryFromFileSpec.scala # src/test/scala/circtTests/stage/ChiselStageSpec.scala
Whereas in the past, the user was expected to provide the firtool binary on the PATH, Chisel will now manage the firtool binary automatically. Chisel users the following 3-step process for determining which binary to use: 1. If environment variable FIRTOOL_PATH is set, it will check for firtool in that directory 2. It will check the classpath for firtool provided by chipsalliance/llvm-firtool 3. It will download a default version of chipsalliance/llvm-firtool Both (2) and (3) will store the firtool binary in a sensible location depending on the user's operating system. See dirs-dev/directories-jvm for more information. The user can override this location by setting the FIRTOOL_CACHE environment variable. (cherry picked from commit 3938a46) # Conflicts: # .github/workflows/build-scala-cli-template.yml # .github/workflows/ci.yml # .github/workflows/test.yml # build.sbt # build.sc # common.sc # project/plugins.sbt # src/main/scala/circt/stage/phases/CIRCT.scala # src/test/scala/chiselTests/LoadMemoryFromFileSpec.scala # src/test/scala/circtTests/stage/ChiselStageSpec.scala
This uses https://github.com/jackkoenig/firtool-resolver which I will transfer to be an actual chipsalliance repo once this is merged.
Contributor Checklist
docs/src
?Type of Improvement
Desired Merge Strategy
Release Notes
Whereas in the past, the user was expected to provide the firtool binary
on the PATH, Chisel will now manage the firtool binary automatically.
Chisel users the following 3-step process for determining which binary
to use:
firtool in that directory
chipsalliance/llvm-firtool
Both (2) and (3) will store the firtool binary in a sensible location
depending on the user's operating system. See dirs-dev/directories-jvm
for more information. The user can override this location by setting the
FIRTOOL_CACHE environment variable.
Reviewer Checklist (only modified by reviewer)
3.5.x
,3.6.x
, or5.x
depending on impact, API modification or big change:6.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.