This is an archive of the discontinued LLVM Phabricator instance.

WIP: [libc] Fix potential install errors related to missing headers
Needs ReviewPublic

Authored by stephenneuendorffer on Apr 3 2023, 2:25 PM.

Details

Reviewers
sivachandra
Summary

The current code seems to assume that any header required by a
particular target is also a dependency of libc.a. If this is not
the case, then the 'install' rule can break because it will try to
install a header file which has not, in fact, been generated.
This is really a fundamental problem with the way that
libc/include/CMakeList.txt manages the install header files and
targets, but there doesn't appear to be a good way to fix it in
current versions of cmake (which are limited in understanding the
interaction between file sets of custom targets and the install
rule).

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 3 2023, 2:25 PM
stephenneuendorffer requested review of this revision.Apr 3 2023, 2:25 PM

We never tested this with a make install or ninja install. Would adding EXCLUDE_FROM_ALL here fix your problem: https://github.com/llvm/llvm-project/blob/main/libc/include/CMakeLists.txt#L520. The install-libc-headers target should set up the dependencies correctly and should still work with make install or ninja install: https://github.com/llvm/llvm-project/blob/main/libc/CMakeLists.txt#L215