-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
version: Expose PX4 git tag string #11676
Conversation
Currently the `version` module and `ver` command don't expose the git tag against which the firmware is built. Additionally, the comments in `version.h` are somewhat misleading (some functions return git hash instead of git tag). This commit aims to fix that. Signed-off-by: sfalexrog <[email protected]>
Looks good. Could you share the |
Sure!
Looks like |
This should be fine to merge, but really what we'll probably need to do is make sure all the desired information is included in the log. https://github.com/PX4/Firmware/blob/master/src/modules/logger/logger.cpp#L2013 |
Co-Authored-By: sfalexrog <[email protected]>
Signed-off-by: sfalexrog <[email protected]>
I've attempted to put git description into the |
Co-Authored-By: sfalexrog <[email protected]>
Minor style check failure. |
@@ -2146,6 +2148,10 @@ void Logger::write_version(LogType type) | |||
write_info(type, "sys_os_ver", os_version); | |||
} | |||
|
|||
if (git_tag && git_tag[0]) { | |||
write_info(type, "ver_sw_tag", git_tag); |
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 don't see why we need the tag, as we already have it through px4_firmware_version()
, https://github.com/PX4/Firmware/pull/11676/files#diff-64b21add574f1f3f059c2abc18eae7d6R2121.
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.
As far as I understand, the px4_firmware_version()
does not, in fact, return a tag, but rather a version number. That's fine for mainline firmwares, but we have modified firmware builds with additional information in the tag (our tags look like v1.8.2-clever.5
). We'd like to see the whole tag to not guess which exact firmware we're using.
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.
We have custom version tags for this: https://dev.px4.io/en/setup/building_px4.html#firmware_version. Does that work for you?
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.
That's an interesting feature, but unfortunately I don't think it does. We use different firmwares for different models of drones, and it'd be more convenient to just use the full tag name (which contains the target drone name) instead of trying to differentiate by numbers.
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.
Having different firmwares for different models does not sound great either. Why not distinguish by using different SYS_AUTOSTART id's?
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 branch name is already in the log, did you see 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.
We usually look through the log after the flight. Git tag string (and the branch name inside) is important before the flight, e.g. during the manual vehicle inspection.
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.
That does not give me a reason why the branch is not enough.
What I want to avoid here is to have redundant information in different formats in the log. That is very confusing for anyone looking at the data.
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 possibility of getting tag and branch name BEFORE flight as a pre-flight check would be very useful because we often have to test different features (e. g. precision landing and different camera modules) on one prototype at a close periods of time.
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 possibility of getting tag and branch name BEFORE flight as a pre-flight check would be very useful because we often have to test different features (e. g. precision landing and different camera modules) on one prototype at a close periods of time.
Which you do with ver all
.
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Closing this as stale. |
Currently the
version
module andver
command don't expose the git tag against which the firmware is built. Additionally, the comments inversion/version.h
are somewhat misleading (some functions return git hash instead of git tag).This pull request:
px4_firmware_git_tag_string
)version/version.h
ver all