-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
feat: commit hash #228
feat: commit hash #228
Conversation
Added this branch to my site (https://slimevr-firmware.bscotch.ca/) as unlogisch04/feat_commitid to be used for testing. I can confirm this breaks on the web firmware tool. Check the attached log for more info: |
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 shouldn't crash if not in a git repo (ex. downloading a release zip, etc), even though it's not much of an expected case, it's good to keep it working anyways. Maybe a big warning instead?
For firmware tool compatability, support should be added for reading the commit ID from an environment variable, as we have the metadata but no way to pass it in.
Oh i did forgot, that it can be out of a git repo. |
f64d11d
to
33cbd5e
Compare
7c9e700
to
d09a4f8
Compare
@ButterscotchV could you check again? I've added error handling to the script |
Tested again, doesn't compile File "scripts/get_git_commit.py", line 22
print(f"'-DGIT_REV=\"{revision}\"'")
^
SyntaxError: invalid syntax |
That could be from an old version of python, f-strings are supported from python 3.6. Working fine with ubuntu and PlatformIO installed last month |
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.
Tested with these two patches with and without git repo
Oh also I've tested and it does appear to compile. I've added support for the |
Co-authored-by: nekomona <nekomona@163.com>
Co-authored-by: nekomona <nekomona@163.com>
Co-authored-by: nekomona <nekomona@163.com>
594d3c0
to
59a26e6
Compare
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.
Works on web firmware tool perfectly 👍
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
@Eirenliel please merge
Change
This pull request adds the Git commit hash in the built firmware.
Notes:
The web flasher needs a new implementation, this should not be merged without the change.