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

Version Mismatch Issue During Build from Source #1985

Open
vimkim opened this issue Dec 18, 2024 · 2 comments
Open

Version Mismatch Issue During Build from Source #1985

vimkim opened this issue Dec 18, 2024 · 2 comments

Comments

@vimkim
Copy link
Contributor

vimkim commented Dec 18, 2024

Issue Description:

I encountered a version mismatch issue while building uftrace from source. After compiling and installing, the uftrace --version command displayed the following:

zsh ❯ uftrace --version
uftrace v0.16-44-gb0d9 ( x86_64 dwarf python3 luajit tui perf sched dynamic kernel )

This was unexpected since the most recent version is v0.17. Upon investigation, I found that misc/version.sh appears to derive the version number from the most recent git tag.

Root Cause:

It seems that misc/version.sh uses the most recent tag to extract the version number. If the local git repository is not updated with the latest tags, the script cannot determine the correct version.

Resolution:

Running the following command resolved the issue:

git pull origin master --tags
make clean
make
sudo make install

After this, the correct version number was displayed.

Suggestion:

To avoid confusion for other users, it might be helpful to:

  1. Add a note in the build instructions recommending users to fetch tags with git pull origin master --tags before building.
  2. Consider handling this scenario in misc/version.sh by displaying a message if tags are outdated or missing.

Closing Remarks:

I understand this is a minor issue, but addressing it could help others avoid similar confusion. Thank you for maintaining such an excellent tool!

@namhyung
Copy link
Owner

I think git pull fetches tags by default. Maybe you pulled the code before I pushed the v0.17 tag and it didn't rebuild the code because nothing is changed. I thought I make misc/version.sh to generate a new version.h file when it sees a new tag. But it doesn't seem to work properly.

@vimkim
Copy link
Contributor Author

vimkim commented Dec 19, 2024

I recently noticed that git pull fetches tags by default, whereas git pull origin master does not automatically fetch tags unless you use the --tags option. This was a small oversight on my part, but I hope this clarification can be helpful to others.

For the --version command to work as expected, it's important to use git pull instead of git pull origin master. I hope this helps others!

image

If you’d like, you could consider modifying misc/version.sh to include git fetch --tags as an enhancement, or something similar.
This issue is unlikely to occur in most cases, so it might be fine to close it.

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

No branches or pull requests

2 participants