-
-
Notifications
You must be signed in to change notification settings - Fork 771
Fix errors when running QEMU tests for OpenTitan #3530
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
Conversation
@@ -32,7 +32,9 @@ endif | |||
CARGO_FLAGS += -Zpanic-abort-tests | |||
|
|||
.PHONY: ot-check | |||
OPENTITAN_ACTUAL_SHA := $(shell cd $(OPENTITAN_TREE); git show --pretty=format:"%H" --no-patch) | |||
ifeq ($(OPENTITAN_TREE),) |
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.
Does this check that if OPENTITAN_TREE
is not set, then set OPENTITAN_ACTUAL_SHA
?
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.
This is suppsoed to be ifneq, somehow I messed things up rebasing.
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 think this is caught by the below test for OPENTITAN_ACTUAL_SHA == OPENTITAN_SUPPORTED_SHA
(which will be false when empty, and can be overridden by SKIP_OT_VERSION_CHECK
). The OPENTITAN_ACTUAL_SHA
seem to be really only used for that.
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.
Actually I messed up with spacing and tabs as well. 😅
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 think this is caught by the below test for
OPENTITAN_ACTUAL_SHA == OPENTITAN_SUPPORTED_SHA
(which will be false when empty, and can be overridden bySKIP_OT_VERSION_CHECK
). TheOPENTITAN_ACTUAL_SHA
seem to be really only used for that.
I guess it's probably worth cleaning up that logic as well.
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.
Turns out there's not much to cleanup. We need to set the OPENTITAN_ACTUAL_SHA
variable before the ot-check target because you can't mix variable assignment with recipes.
# Test layout should be removed so that following apps (non-test) load the correct layout. | ||
$(Q)rm $(TOCK_ROOT_DIRECTORY)target/$(TARGET)/release/deps/layout.ld |
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.
This isn't needed?
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.
run.sh already contains the code to delete the file. It's currently only needed because without TOCK_ROOT_DIRECTORY and TARGET being passed, the rm in run.sh failed.
Pull Request Overview
Fix two (non-fatal) errors when running QEMU tests with OpenTitan boards.
The assignment in Makefile is unconditional (and will run regardless if ot-check target is needed), so git will complain that $HOME is not a git repo if
OPENTITAN_TREE
is not set.cargo test
runsrun.sh
which needsTOCK_ROOT_DIRECTORY
. This is set fortest-hardware
andtest-verilator
but is not currently set fortest
target.Testing Strategy
make -C boards/opentitan/earlgrey-cw310/ test
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.