This is an archive of the discontinued LLVM Phabricator instance.

[config] Remove vestigial LLVM_VERSION_INFO
ClosedPublic

Authored by rnk on Jun 3 2022, 10:32 AM.

Details

Summary

This has been superseded by the llvm/Support/VCSRevision.h header. So
far as I can tell, nothing in the CMake build sets LLVM_VERSION_INFO. It
was always undefined, and the ifdefs using it were dead. However, CMake
is very flexible, so it's possible that I missed some ways to set this
variable. One could, for example, probably pass -DLLVM_VERSION_INFO=x on
the command line and get that through to configure_file, or set the
variable in an obscure way (set(${proj}_VERSION_INFO "x")). I'm
reasonably confident that isn't happening, but I'd like a second
opinion.

Update the Bazel and gn builds accordingly.

Diff Detail

Event Timeline

rnk created this revision.Jun 3 2022, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 10:32 AM
rnk requested review of this revision.Jun 3 2022, 10:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 10:32 AM
tstellar accepted this revision.Jun 6 2022, 2:45 PM

LGTM.

This revision is now accepted and ready to land.Jun 6 2022, 2:45 PM
This revision was landed with ongoing or failed builds.Jun 7 2022, 11:48 AM
This revision was automatically updated to reflect the committed changes.

@rnk this is option is needed to vendor the Apple clang toolchain in Xcode. Unfortunately we don't have any references to it in the upstream llvm-project repo, but this is breaking our downstream integration. Can this be reverted?

rnk added a comment.Jun 17 2022, 10:05 AM

@rnk this is option is needed to vendor the Apple clang toolchain in Xcode. Unfortunately we don't have any references to it in the upstream llvm-project repo, but this is breaking our downstream integration. Can this be reverted?

I'd prefer not to, if possible, since changing config.h.cmake churns all three in-tree build systems and any out-of-tree build systems. You should be able to get the old behavior by appending your definition of LLVM_VERSION_INFO to PACKAGE_VERSION. Does that work for you? We actually had the same problem at Google, coincidentally, and that's what we did.

Were you using LLVM_VERSION_INFO to embed the VCS revision? If yes, and we want the open source tools to do this, we should have the CommandLine.cpp --version code use the VCSRevision.h header. I think this may interact badly with tablegen, since every update to git HEAD will then modify Support, which llvm-blgen uses, which will invalidate all tablegen runs. Maybe we can fix that somehow. It's a bunch of work, but that's probably the best, most proper solution.

Anyway, I think it's best if everyone tries to align their internal integrations as much as possible with what the open source build supports, and that we don't have config options like this that are only exercised by out of tree builds.