kuasar-io / kuasar

A multi-sandbox container runtime that provides cloud-native, all-scenario multiple sandbox container solutions.
https://kuasar.io
Apache License 2.0
1.27k stars 91 forks source link

vmm: add version info #110

Closed morningtzh closed 10 months ago

morningtzh commented 10 months ago
  1. Modify the args parsing method of Kuasar VMM: use clap to parse args in the args.rs file, and replace the usage of args in load_config.
  2. Add build.rs, inject build information using the built library during the build process.
  3. Add a function to print version information and build information in args.rs.
➜  sandbox git:(tzh-version) ✗ ./target/debug/cloud_hypervisor  --help    
Usage: cloud_hypervisor [OPTIONS]

Options:
  -v, --version        Version info
  -c, --config <FILE>  Config file path, only for cloud hypervisor and stratovirt
  -d, --dir <DIR>      Sandboxer working directory
  -l, --listen <FILE>  Address for sandboxer\'s server
  -h, --help           Print help

➜  sandbox git:(tzh-version) ✗ # before commit
➜  sandbox git:(tzh-version) ✗ ./target/debug/cloud_hypervisor  --version 
Version: v0.4.0-3-gecb617e-dirty
Build Time: Mon, 15 Jan 2024 07:03:25 +0000

➜  sandbox git:(tzh-version) ✗ # after commit
➜  sandbox git:(tzh-version) ✗ ./target/debug/cloud_hypervisor  --version
Version: v0.4.0-3-g6c24d1a
Build Time: Mon, 15 Jan 2024 07:30:28 +0000
flyflypeng commented 10 months ago

LGTM