This is an archive of the discontinued LLVM Phabricator instance.

Teach zorg to support cmake and modules for Clang builders
ClosedPublic

Authored by rsmith on Aug 15 2014, 12:52 PM.

Details

Reviewers
dblaikie
chapuni
Summary

Adds modules= and cmake= keyword arguments to getClangBuildFactory. Right now, the modules build requires a two-stage cmake-based bootstrap. To use this you'll need a modularized libc and libc++ in a place where the build will find them.

My modules buildbot is configured using this builder:

{'name' : "clang-x86_64-linux-selfhost-rel",
 'slavenames' : ["localhost"],
 'builddir' : "clang-x86_64-linux-selfhost-rel",
 'factory' : ClangBuilder.getClangBuildFactory(triple='x86_64-pc-linux-gnu',
                                      useTwoStage=True,
                                      modules=True,
                                      clean=False,
                                      stage1_config='Release+Asserts',
                                      stage2_config='Release+Asserts',
                                      extra_configure_args=[
                                          '-DCMAKE_C_COMPILER=/var/lib/buildbot/bin/clang',
                                          '-DCMAKE_CXX_COMPILER=/var/lib/buildbot/bin/clang++',
                                          '-DCMAKE_CXX_FLAGS=-stdlib=libc++',
                                      ],
                                      cmake='/var/lib/buildbot/bin/cmake')},

... and seems to work.

Diff Detail

Event Timeline

rsmith updated this revision to Diff 12570.Aug 15 2014, 12:52 PM
rsmith retitled this revision from to Teach zorg to support cmake and modules for Clang builders.
rsmith updated this object.
rsmith edited the test plan for this revision. (Show Details)
rsmith added a reviewer: chapuni.
rsmith set the repository for this revision to rL LLVM.
rsmith added a subscriber: Unknown Object (MLST).
dblaikie added inline comments.
zorg/buildbot/builders/ClangBuilder.py
46

This flag seems unused apart from the assertion below. Should it instead conditionalize the use of modules down around line 355 as well as being used in this assertion?

251

Trivial & can be committed separately if you like, of course.

331

Making this unconditional is an independent bug fix, I assume? (stage2 wouldn't benefit from any caching, so it should always be a clean build)

rsmith updated this revision to Diff 14081.Sep 25 2014, 11:36 AM

Conditionalize adding of -fmodules etc on the modules flag, and don't change existing two-stage buildbots' behavior with respect to cleaning stage 2 before rebuilding it.

rsmith added inline comments.Sep 25 2014, 11:38 AM
zorg/buildbot/builders/ClangBuilder.py
46

Yes, it should =) Done, but I've not tested the cmake build /without/ modules.

251

Committed separately.

331

I've changed this so we only unconditionally clean stage2 for a cmake build. I don't want to change the behavior of existing buildbots, even though it doesn't seem very sensible to do an incremental build of stage2.

dblaikie accepted this revision.Sep 25 2014, 11:50 AM
dblaikie added a reviewer: dblaikie.

Looks good. One optional comment

(wow, phab markup does fun things with leading #... )

zorg/buildbot/builders/ClangBuilder.py
332

Maybe rephrase this (it leaves fairly ambiguous as to why we want to clean for the configure build here - the answer being "there's no known reason") maybe:

FIXME: verify that there's no need to skip cleaning for the configure stage 2 build (it doesn't make much sense) and remove this condition

?

This revision is now accepted and ready to land.Sep 25 2014, 11:50 AM
rsmith closed this revision.Sep 26 2014, 5:03 PM

Thanks! I switched this over to enabling modules via the new -DLLVM_ENABLE_MODULES=1 flag and committed as r218557.

zorg/buildbot/builders/ClangBuilder.py
332

Done.