RFC: Embed build infos into binary #215

Open
opened 2022-01-22 13:15:09 +00:00 by jfowl · 5 comments
jfowl commented 2022-01-22 13:15:09 +00:00 (Migrated from gitlab.com)

When you download and run a Conduit binary, you don't really know, which version you are currently using.
There is an endpoint which returns the cargo package version, but it is not immediately visible to users upon starting.

Here are some ideas on how to address this:

How to get those infos

  • https://docs.rs/vergen/latest/vergen/
  • Pull some info out of cargo envs
  • Create a build.rs and call git to get some infos about the commit
  • Or directly read from the .git folder
  • Or have the user set an env with the matching version before compiling

How to surface those infos

  • At first start, the version should be included in the admin room welcome message
  • Upon upgrading, a new message might be sent into the admin room ("congrats, you are now running Conduig vX.Y.Z")
  • On every start: Print those infos to the log, regardless of missing configs and everything?
### Is your feature request related to a problem? Please describe. When you download and run a Conduit binary, you don't really know, which version you are currently using. There is an endpoint which returns the cargo package version, but it is not immediately visible to users upon starting. Here are some ideas on how to address this: ### How to get those infos - https://docs.rs/vergen/latest/vergen/ - Pull some info out of [cargo envs](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) - Create a `build.rs` and call git to get some infos about the commit - Or directly read from the `.git` folder - Or have the user set an env with the matching version before compiling ### How to surface those infos - At first start, the version should be included in the admin room welcome message - Upon upgrading, a new message might be sent into the admin room ("congrats, you are now running Conduig vX.Y.Z") - On every start: Print those infos to the log, regardless of missing configs and everything?
jfowl commented 2022-01-22 13:15:27 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
jfowl commented 2022-01-22 13:21:32 +00:00 (Migrated from gitlab.com)

marked this issue as related to #103

marked this issue as related to #103
jplatte commented 2022-01-22 13:21:53 +00:00 (Migrated from gitlab.com)

I would recommend not calling git at build time since it that will make it even harder to do reproducible builds. I think it makes far more sense to use environment variables for this that can be set if you want to include that kind of thing in a build (and include that in CI builds).

I would recommend not calling `git` at build time since it that will make it even harder to do reproducible builds. I think it makes far more sense to use environment variables for this that *can* be set if you want to include that kind of thing in a build (and include that in CI builds).
mixis commented 2022-03-03 20:36:27 +00:00 (Migrated from gitlab.com)

I think using commit info should be acceptable but including timestamps or sysinfo will break reproducible builds and would have to be set to some value other than the actual build time or build host.

I think using commit info should be acceptable but including timestamps or sysinfo will break reproducible builds and would have to be set to some value other than the actual build time or build host.
eutampieri commented 2022-12-16 22:52:51 +00:00 (Migrated from gitlab.com)

There's also the git_version crate

There's also the ![git_version](https://docs.rs/git-version/0.3.5/git_version/) crate
Sign in to join this conversation.
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#215
No description provided.