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

Include metadata in binary #734

Merged
merged 3 commits into from
Feb 18, 2024
Merged

Conversation

imwints
Copy link
Contributor

@imwints imwints commented Jan 23, 2024

This will include some metadata in the binary. The main motivation was to make bug reports a little easier for the author.

-v will now print the version and the git commit when the binary was build in a git tree.

# From source tarball
./btop -v
btop version: 1.3.0

# From git tree
./btop -v
btop version: 1.3.0+31ee115

--version is now more verbose than -v, it will also include information about the compiler, the build command and the enabled features, e.g. GPU support. This is then easily included by the author without without any digging around when they copy the output of btop --version as requested in the issue template.

# Makefile
btop version: 1.3.0+31ee115
Compiled with: x86_64-pc-linux-gnu-g++-14 (14.0.0)
Configured with: make STATIC= FORTIFY_SOURCE=true GPU_SUPPORT=true RSMI_STATIC=

# CMake
./btop --version
btop version: 1.3.0+31ee115
Compiled with: clang++ (17.0.6)
Configured with: cmake -G Ninja -DBTOP_STATIC=OFF -DBTOP_USE_MOLD=OFF -DBTOP_FORTIFY=ON -DBTOP_GPU=ON

Empty means default, I didn't want to default initialize the options just for prettier output as this would clutter the Makefile.

@ottok
Copy link
Contributor

ottok commented Jan 29, 2024

Currently btop has a fully reproducible build (https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/btop.html). Be careful when embedding this type of things that it will not change on every build, and that it also supports build out-of-git-tree.

@imwints
Copy link
Contributor Author

imwints commented Jan 29, 2024

Be careful when embedding this type of things that it will not change on every build

Change what on every build? There is no randomness in this PR. It is all deterministic.

and that it also supports build out-of-git-tree.

# From source tarball
./btop -v
btop version: 1.3.0

# From git tree
./btop -v
btop version: 1.3.0+31ee115

Copy link
Owner

@aristocratos aristocratos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👌

@aristocratos aristocratos merged commit 6c66740 into aristocratos:main Feb 18, 2024
52 checks passed
@imwints imwints deleted the build-info branch February 20, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants