question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suppress version control revision info (Git revision id) is appended

See original GitHub issue

Each time I build a new toolchain via tc-build the current Git revision id is appended and changes when llvm-project Git updates.

--- /boot/config-5.7.0-rc1-5-amd64-clang
+++ .config

-# Compiler: ClangBuiltLinux clang version 10.0.1 (https://github.com/llvm/llvm-project 61b6007157600d8080b87361397bb61ffbcfb196)
+# Compiler: ClangBuiltLinux clang version 10.0.1 (https://github.com/llvm/llvm-project edbe962459da6e3b7b4168118f93a77847b54e02)

The CCACHE benefit is gone as Linux build-system detects the change of compiler.

There exists LLVM_APPEND_VC_REV (default: ON) cmake-option to suppress this:

LLVM_APPEND_VC_REV:BOOL
    Embed version control revision info (Git revision id). The version info is provided by the LLVM_REVISION macro in llvm/include/llvm/Support/VCSRevision.h. Developers using git who don’t need revision info can disable this option to avoid re-linking most binaries after a branch switch. Defaults to ON.

What do you think of integrating an option for this in tc-build?

[1] https://llvm.org/docs/CMake.html#llvm-specific-variables

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
dilekscommented, Apr 14, 2020

@msfjarvis Thanks for the patch. I will try it and report.

The comment is not precise enough.

-        # Don't append versioning info to the compiler version
+        # Don't append version control revision info (Git revision id) to the compiler version
+        'LLVM_APPEND_VC_REV': 'OFF',

This can be changed later.

1reaction
nathanchancecommented, Apr 14, 2020

I do not think that the revision info in the compiler string matters for the sake of ccache, unless you have changed something.

According to the ccache docs (https://ccache.dev/manual/latest.html#_configuration_settings):

By default, ccache includes the modification time (“mtime”) and size of the compiler in the hash to ensure that results retrieved from the cache are accurate.

If you build a new compiler, the mtime will change (and probably the size in some small way) and ccache will be invalidated, regardless of the version string in the compiler.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the Git equivalent for revision number? - Stack Overflow
@Radek Yes it is an ever increasing number. It just counts the revisions you checked in on the HEAD. So every commit is...
Read more >
7.1 Git Tools - Revision Selection
This command shows you any commits in your current branch that aren't in the master branch on your origin remote. If you run...
Read more >
git-rev-list Documentation - Git
rev-list is a very essential Git command, since it provides the ability to build and traverse commit ancestry graphs. For this reason, it...
Read more >
git-describe Documentation - Git
The command finds the most recent tag that is reachable from a commit. If the tag points to the commit, then only the...
Read more >
git-blame Documentation - Git
Annotates each line in the given file with information from the revision which ... This makes it possible to track when a code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found