This is an archive of the discontinued LLVM Phabricator instance.

Get the branch specifiers from a .json file rather than out of raw Python
ClosedPublic

Authored by spyffe on Feb 22 2017, 2:39 PM.

Details

Summary

LLDB has many branches in a variety of repositories, and the build-script.py file is subtly different for each set.
This is unnecessary and causes merge headaches.
This patch makes build-script.py consult a directory full of .json files, each one of which matches a particular branch using a regular expression.

Diff Detail

Event Timeline

spyffe created this revision.Feb 22 2017, 2:39 PM
spyffe updated this revision to Diff 89427.Feb 22 2017, 2:45 PM

• Removed some debug print statements.
• Added the option of an OVERRIDE.json file to disable regex-based matching if the user knows what they are doing.

beanz accepted this revision.Feb 22 2017, 2:51 PM

LGTM!

This revision is now accepted and ready to land.Feb 22 2017, 2:51 PM
This revision was automatically updated to reflect the committed changes.
spyffe updated this revision to Diff 89454.Feb 22 2017, 5:55 PM
spyffe added a reviewer: jingham.

• Added a FALLBACK configuration file that reflects what the branch was cut from, allowing e.g. pull requests or branches without losing auto-checkout.
• Re-generate FALLBACK whenever we successfully detect a branch configuration so that it is as close as possible to what we last used

jingham edited edge metadata.Feb 22 2017, 6:11 PM

There should be some doc describing this process. Yes I know none of this is really documented, but since this seems actually useful, we should document it.

scripts/Xcode/build-llvm.py
48–49

Do you really want to exit here? You should really fall back to the fallback file.

50–51

It looks like find exits in all the bad cases, and with a better error message since it knows what it did wrong, so this in unnecessary.

scripts/Xcode/repo.py
43

Put in the actual path that you looked for the fallback file in.

Probably README.md is the right place to mention this.

spyffe updated this revision to Diff 89456.Feb 22 2017, 6:22 PM

Updated to reflect Jim's comments:
• Removed redundant errors
• Improved existing errors
• Added documentation