Mill 0.12 and Chisel source locators #3840
Closed
jackkoenig
started this conversation in
General
Replies: 1 comment 5 replies
-
|
@jackkoenig we'll probably go with $ENV interpolation in the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Chisel1 uses source locators to help our users map from generated Verilog back to their original Scala source code. These source locators are relative to the project root, which Chisel determines at compilation time via the
user.dirJava system property (basically "pwd" of the Scala compilation process)--with the option for user override via system propertychisel.project.root2.This has worked well for both Mill and SBT projects which (traditionally) run compilation from the root of the project directory. Mill 0.12 changes this to run the compilation process in the root directory (
/) which causes issues with our approach.It's not clear what the best solution is, some options:
chisel.project.rootwhen compiling their projects.chisel.project.rootin the Mill bootstrap script..mill-jvm-optsto support environment variable expansion.(1) and (2) require no changes on Mill's part but have some big disadvantages for users of Chisel.
(1) makes the typical use of Chisel pretty annoying:
mill -Dchisel.project.root=$PWD __.compile(2) effectively requires Chisel to maintain and distribute its own mill bootstrap script. This would be especially be problematic for users who decide to install
millthemselves since they would not get this very Chisel-specific behavior.(3) @lihaoyi described as "a last-resort kind of thing" and I am inclined to agree--I don't think we want to disable the sandbox, we just want to tweak the environment slightly in a way that can be committed to a file on disk.
(4) Sounds the simplest to me. I just want to put
-Dchisel.project.root=$PWDin a file on disk that we include in the Chisel project template--then users don't really have to mess with it most of the time. I think there are variations on this idea that could work--it'd be fine to do this in some snippet inmill.buildas well, but I suspect doing it in.mill-jvm-optsis simpler.Just trying to get the conversation started, and as requested by @lihaoyi, put somewhere that isn't ephemeral like Discord chat. Any thoughts or ideas?
This Discussion is spun out of a conversation on Discord3
Footnotes
https://github.com/chipsalliance/chisel ↩
https://github.com/chipsalliance/chisel/blob/a7a68e522ccc71d08a0a0aaea0a1460d266f2d7f/core/src/main/scala/chisel3/internal/SourceInfoFileResolver.scala#L17 ↩
https://discord.com/channels/632150470000902164/1295786923410984981/1299045339789262919 ↩
Beta Was this translation helpful? Give feedback.
All reactions