[libcxx-commits] [PATCH] D116958: [libc++] Alphabetize CMakeLists.txt and module.modulemap; enforce in CI.

Alexander Richardson via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jan 10 14:57:05 PST 2022


arichardson added a comment.

In D116958#3232507 <https://reviews.llvm.org/D116958#3232507>, @ldionne wrote:

> I would like to suggest a different approach, which would make sure that these tests are executed all the time, not only in the CI. You could create a file like `libcxx/test/libcxx/lint_cmakelist.sh.py` with something like this inside it:
>
>   # RUN: %{python} %s '%{libcxx}'
>   
>   libcxx = sys.argv[1]
>   cmakelist = os.path.join(libcxx, 'include', 'CMakeLists.txt')
>   assert os.path.exists(cmakelist)
>   with open(cmakelist, 'r') as f:
>       lines = f.readlines()
>   assert lines[0] == 'set(files\n'
>   
>   okay = True
>   prevline = lines[1]
>   for line in lines[2:]:
>       if (line == '  )\n'):
>           break
>       if (line < prevline):
>           okay = False
>           print('LINES OUT OF ORDER in libcxx/include/CMakeLists.txt!')
>           print(prevline)
>           print(line)
>       prevline = line
>   assert okay
>
> Then, this would be executed whenever we run the tests. That would require moving the `%{python}`-related logic in `libcxx/test/libcxx/selftest/dsl/lit.local.cfg` to `libcxx/test/libcxx`.

Will that work as expected with remote executors? I don't believe the sources are guaranteed to be accessible?

Maybe it would also make sense to add a .arclint file to run these scripts when uploading patches with arc (in addition to the CI check).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116958/new/

https://reviews.llvm.org/D116958



More information about the libcxx-commits mailing list