This is an archive of the discontinued LLVM Phabricator instance.

Fix update_cc_test_checks.py --llvm-bin after D78478
ClosedPublic

Authored by arichardson on Jul 24 2020, 4:18 AM.

Details

Summary

Not passing --clang would result in a python exception after this change:
(TypeError: expected str, bytes or os.PathLike object, not NoneType)
because the --clang argument default was only being populated in the
initial argument parsing pass but not later on.
Fix this by adding an argparse callback to set the default values.

Diff Detail

Event Timeline

arichardson created this revision.Jul 24 2020, 4:18 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 24 2020, 4:18 AM
MaskRay added inline comments.Jul 24 2020, 8:21 AM
clang/test/utils/update_cc_test_checks/lit.local.cfg
24 ↗(On Diff #280399)

The substitution is here just to make a test. Can it be tested with existing substitutions?

arichardson marked an inline comment as done.Jul 24 2020, 9:12 AM
arichardson added inline comments.
clang/test/utils/update_cc_test_checks/lit.local.cfg
24 ↗(On Diff #280399)

I can't think of an easy way since we need to invoke update_cc_test_checks.py without the "--clang" argument and we need a substitution for the path to the update script.

LGTM as it fixes update_cc_test_checks.py

llvm/utils/update_cc_test_checks.py
116–126

I guess empty clang also make no sense, "not args.clang" is better here

vitalybuka accepted this revision.Jul 28 2020, 4:57 PM
This revision is now accepted and ready to land.Jul 28 2020, 4:57 PM
vitalybuka added inline comments.Jul 28 2020, 4:59 PM
clang/test/utils/update_cc_test_checks/lit.local.cfg
24 ↗(On Diff #280399)

If there are concerns here, I'd recommend to land minimal fix for the tool and move test plumbing into a separate patch.

MaskRay accepted this revision.Jul 28 2020, 5:03 PM

LGTM.

clang/test/utils/update_cc_test_checks/lit.local.cfg
24 ↗(On Diff #280399)

If there are concerns here, I'd recommend to land minimal fix for the tool and move test plumbing into a separate patch.

+1

remove tests and check for empty instead of none

This revision was landed with ongoing or failed builds.Aug 3 2020, 3:23 AM
This revision was automatically updated to reflect the committed changes.