This is an archive of the discontinued LLVM Phabricator instance.

[llvm] Make obj2yaml and yaml2obj LLVM utilities instead of tools
ClosedPublic

Authored by JDevlieghere on Oct 13 2020, 6:38 PM.

Details

Summary

For testing purposes I need a way to build and install FileCheck and yaml2obj. I could either make FileCheck an LLVM tool or make obj2yaml and yaml2obj utilities. I think the distinction is rather arbitrary but my understanding is that tools are things meant for the toolchain while utilities are more used for things like testing, which is the case here. The functional difference is that they'll end up in the ${LLVM_UTILS_INSTALL_DIR} which defaults to the ${LLVM_TOOLS_INSTALL_DIR}. Unless you specify a different value or you added obj2yaml and yaml2obj to LLVM_TOOLCHAIN_TOOLS this change should make no difference.

Another option would be to get rid of this distinction altogether and just have tools. This would simplify the CMake logic but would mean you could no longer specify a separate ${LLVM_UTILS_INSTALL_DIR}.

Diff Detail

Event Timeline

JDevlieghere created this revision.Oct 13 2020, 6:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2020, 6:38 PM
JDevlieghere requested review of this revision.Oct 13 2020, 6:38 PM
labath edited reviewers, added: mgorny, tstellar; removed: labath.Oct 14 2020, 1:50 AM

I don't have a problem with this, but I don't really know what this implies. Adding some folks who package llvm downstream.

compnerd accepted this revision.Oct 19 2020, 9:48 AM
compnerd added a subscriber: compnerd.

I know that many people find these tools useful, but they are meant as testing tools. Marking them as utilities seems reasonable.

This revision is now accepted and ready to land.Oct 19 2020, 9:48 AM
This revision was landed with ongoing or failed builds.Oct 19 2020, 10:21 AM
This revision was automatically updated to reflect the committed changes.

FWIW, this had an impact on the Visual Studio IDE, as "Tools" and "Utils" are separate solution folders, so yaml2obj and obj2yaml appear in a different location now to where they did before. From a functional point of view, it doesn't really matter (and I agree with your logic), it just caught me off guard when I was looking to build yaml2obj via the UI. Another "Tool" that in my opinion should be a utility is "split-file", but @MaskRay disagreed with me on that one, I think.