Skip to content
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

[Trivial] chip-tool did not have version number or git hash in cli command #34067

Closed
resghst opened this issue Jun 25, 2024 · 6 comments
Closed
Labels
bug Something isn't working chip-tool needs triage

Comments

@resghst
Copy link

resghst commented Jun 25, 2024

Type

Other

Explanation

holp the chip-tool can add chip-tool --version or chip-tool version command.

Platform

raspi

Platform Version(s)

No response

Testing

Manually tested with SDK

(Optional) If manually tested please explain why this is only manually tested

No response

Anything else?

No response

@resghst resghst added bug Something isn't working needs triage labels Jun 25, 2024
@andy31415
Copy link
Contributor

The trick is to decide what version to expose here ... current version command line handling prints out hard-coded text I believe, which is only useful among manjor versions (which we probably could change), however that also creates churn (keep updating the version file).

To avoid churn, we had various requests to use git versions/info/logs for this however we intentionally avoided this due to slowing down builds (we try hard to not execute extra programs) and making builds potentially less reproducible (different output on the same code, depending on git checkout status/state).

The closest equivalent is defining an argument and allowing build systems to override it (and builds system may choose to take the extra time to figure out a good tag). sl_matter_version_str is an example of this being done ( it is slow when used, adds extra churn to maintain the version in the builder script).

@bzbarsky-apple
Copy link
Contributor

@resghst Where is the chip-tool coming from whose version you want to know? Understanding that will make it easier to figure out how best to address this.

@resghst
Copy link
Author

resghst commented Jun 26, 2024

Sometimes, I built the chip-tool a few months ago. I only leave the chip-tool bin file, so I can not easily get the chip-tool version.

For instance, the chip-tool builds from:

  • the hash code: b63c271
  • the nearest tag: v1.3.0.0
  • branch: master

I holp chip-tool version command will show: master-v1.3.0.0-b63c271
at least show the hash code.

Thanks reply, @bzbarsky-apple @andy31415

@resghst
Copy link
Author

resghst commented Jun 26, 2024

I think only project-chip git-hash will fine

@bzbarsky-apple
Copy link
Contributor

@resghst Build it into a directory whose name is the SHA?

@resghst
Copy link
Author

resghst commented Jun 27, 2024

for example, the following command can control the node 1 endpoint 1.
$ ./chip-tool onoff on 1 1
I want get the chip-tool version with
$ ./chip-tool version
it will return "master-v1.3.0.0-b63c271" or "b63c271"
 
The chip-tool has many modules, so we may let the version become a command group.
$ ./chip-tool version <module_name>

@resghst resghst closed this as completed Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chip-tool needs triage
Projects
None yet
Development

No branches or pull requests

3 participants