This is an archive of the discontinued LLVM Phabricator instance.

[WIP][clang][modules] module build daemon initial commit
Needs ReviewPublic

Authored by cpsughrue on Aug 22 2023, 1:49 AM.

Details

Summary

Initial commit for module build daemon. Once I am done writing tests, the title will be updated soon to remove the [WIP] tag.

The goal of the commit: A source file that doesn't depend on any modules can connect to the daemon, get scanned, find that there are no modules, and then resume building. If any modules are in the dependency graph, have the daemon emit a warning that dependencies were detected but that the daemon cannot yet build modules or update the cc1 command line.

RFC: https://discourse.llvm.org/t/rfc-modules-build-daemon-build-system-agnostic-support-for-explicitly-built-modules/71524

Diff Detail

Event Timeline

cpsughrue created this revision.Aug 22 2023, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 1:49 AM
cpsughrue requested review of this revision.Aug 22 2023, 1:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2023, 1:49 AM
cpsughrue edited the summary of this revision. (Show Details)

Addressed feedback:

  • Renamed ub_outs() to unbuff_outs()
  • Fixed spelling errors
  • Added daemon response to handshake request from clang invocation
  • Replaced 10 sec sleep with backoff strategy when checking if the daemon has finished initializing
  • In daemon response to REGISTER, added updated cc1 command line, which replaces the clang invocation argv

Remove unnecessary header files

(probably worth linking to the RFC/etc (https://discourse.llvm.org/t/rfc-modules-build-daemon-build-system-agnostic-support-for-explicitly-built-modules/71524/47) from the patch description/commit message)

I agree

clang/tools/driver/cc1_main.cpp
49

Can be removed