-
Notifications
You must be signed in to change notification settings - Fork 651
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
Cleanup how to override SBT + make help
documentation update
#1041
Conversation
This makes it easier to override just SBT_BIN and still use the ENABLE_SBT_THIN_CLIENT flag when using a downloaded SBT script
variables.mk
Outdated
@@ -175,7 +175,8 @@ override SCALA_BUILDTOOL_DEPS += $(SBT_THIN_CLIENT_TIMESTAMP) | |||
SBT_CLIENT_FLAG = --client | |||
endif | |||
|
|||
SBT ?= java $(JAVA_TOOL_OPTIONS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS) $(SBT_CLIENT_FLAG) | |||
SBT_BIN ?= java $(JAVA_TOOL_OPTIONS) -jar $(ROCKETCHIP_DIR)/sbt-launch.jar $(SBT_OPTS) | |||
SBT ?= $(SBT_BIN) $(SBT_CLIENT_FLAG) |
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.
Should SBT_OPTS
be part of SBT_BIN
or SBT
? I would expect SBT_OPTS
to be the same for various settings of SBT_BIN
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.
Hmm this also drops JAVA_TOOL_OPTIONS
when SBT_BIN
is custom set. Is that intended?
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.
When using the SBT script the variables in the SBT_OPTS
makefile variable are passed to the script in two ways:
- the
.sbtopts
file in the top-level - the env. variable
SBT_OPTS
(which is assumed to be set by users)
As for JAVA_TOOL_OPTIONS
, I need to double-check... I think a user would need to have it as an environment variable for it to work with the custom SBT thing to begin with.
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 wonder if Chipyard should just automatically download SBT (its just a .jar and a bash script) and use it by default... then we wouldn't have to have all this makefile stuff around it. The downside is that we would have 2 sbt-launch.jar
and we would not use the default SBT installation. Another option is to just enforce that SBT is installed in the pre-reqs script.
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.
Ok. Cleaned this up a bit but I can confirm that doing export var
exports the variable to the recipe. Therefore, JAVA_TOOL_OPTIONS
is passed to java
no matter what.
@@ -18,7 +18,7 @@ HELP_COMPILATION_VARIABLES += \ | |||
" EXTRA_SIM_LDFLAGS = additional LDFLAGS for building simulators" \ | |||
" EXTRA_SIM_SOURCES = additional simulation sources needed for simulator" \ | |||
" EXTRA_SIM_REQS = additional make requirements to build the simulator" \ | |||
" ENABLE_SBT_THIN_CLIENT = if set, use sbt's experimental thin client (works best with sbtn or sbt script)" \ | |||
" ENABLE_SBT_THIN_CLIENT = if set, use sbt's experimental thin client (works best when overridding SBT_BIN with sbt script)" \ | |||
" EXTRA_CHISEL_OPTIONS = additional options to pass to the Chisel compiler" \ |
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.
Can we add some help text here for SBT_BIN
?
make help
documentation update
So, the recommended usage of thin-client mode would be:
Should we automatically set Also, is there any downside to always using |
I think outside of me, you (@tymcauley) and Jerry are the two main users (at least the two main ones who I know about) so I would love to hear your feedback as always.
With that being said, I have both
I have this debate every so often. While the installed |
If we make |
Regarding the
This was the most useful link I could find on that subject: sbt/sbt#4503 (comment) I don't know what the relationship looks like between these two programs and their supported versions. Not sure where to find that. Regarding I also like the idea of addressing setup/usage for this use-case in a future PR. I'm very happy to see that using |
Yup. Looks like we are referencing the same thing and having two versions to track (the script vs the
The
Yup, I plan on using this (virtually) all the time. Although there still seems to be issues with nested SBT calls that @davidbiancolin noticed (frequently used in FireSim-land) |
Related issue:
Type of change: other enhancement
Impact: other
Release Notes
ENABLE_SBT_THIN_CLIENT
flag is best used with a pre-installed SBT (aka best with the SBT script). This allows you to just override the SBT binary/script withSBT_BIN
and have the--client
flag be handled by Chipyard's Makefile. This also adds moremake help
documentation, fixes an issue with the SBT server not being depended on, and removes unnecessary?=
s andoverride
s invariables.mk
(this was done to properly enforce that the only way to modify the CY build system SBT is to changeSBT_BIN
).Side note: When using the SBT script to launch things, the thin client acts nicely; properly exits on errors, displays colors, etc.