gramine icon indicating copy to clipboard operation
gramine copied to clipboard

Get build version of Gramine binaries

Open ravikumarbhattiprolu opened this issue 3 years ago • 2 comments

Description of the problem

Need a command line option for gramine executables (gramine-sgx, gramine-direct etc) to get the version details like git commit version from which binaries are built. Right now this is available only when gramine is built with debug option, it prints commit details as one one the debug prints at the start up.

When we build GSC docker and docker is deployed, there is no way to know what version/commit of gramine it contains. We may not have access to config yaml file in which gramine version is specified. This command line option will help while debugging failures.

Steps to reproduce

None

Expected results

Print the source commit version

Actual results

Nothing is printed now

Gramine commit hash

mainline

ravikumarbhattiprolu avatar Apr 08 '22 04:04 ravikumarbhattiprolu

A workaround:

manifest=LibOS/shim/test/regression/bootstrap.manifest
libos=$(grep -Po -e 'entrypoint.*file:\K[^"]*' $manifest)
off=$(nm $libos | fgrep g_gramine_commit_hash | cut -d' ' -f1 | sed 's/^0*//')
strings -tx $libos | fgrep $off | sed "s/.*$off //"

You can substitute manifest with a path to some manifest or, even better, replace libos with the path to libsysdb.so directly (lib/x86_64-linux-gnu/gramine/libsysdb.so in your Gramine installation dir).

boryspoplawski avatar Apr 08 '22 07:04 boryspoplawski

I wouldn't mind if there was gramine-{direct,sgx} --version and maybe even --help.

woju avatar Apr 08 '22 14:04 woju