This is an archive of the discontinued LLVM Phabricator instance.

[lldb][tests][NFC] Move C++ gmodules tests into new gmodules/ subdirectory
ClosedPublic

Authored by Michael137 on Sep 14 2022, 10:12 AM.

Details

Summary

This is in preparation for adding more gmodules
tests.

Diff Detail

Event Timeline

Michael137 created this revision.Sep 14 2022, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 10:12 AM
Michael137 requested review of this revision.Sep 14 2022, 10:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 14 2022, 10:12 AM
Michael137 retitled this revision from [lldb][tests] Move C++ gmodules tests into new gmodules/ subdirectory to [lldb][tests][NFC] Move C++ gmodules tests into new gmodules/ subdirectory.Sep 14 2022, 10:13 AM
aprantl accepted this revision.Sep 14 2022, 10:26 AM
This revision is now accepted and ready to land.Sep 14 2022, 10:26 AM
dyung added a subscriber: dyung.Sep 16 2022, 3:03 PM

@Michael137, your change is causing cmake to fail on one of our bots:

https://lab.llvm.org/buildbot/#/builders/217/builds/11819

CMake Error at cmake/modules/AddLLVM.cmake:1867 (add_custom_target):
  add_custom_target cannot create target
  "check-lldb-api-lang-cpp-gmodules-templates" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:1980 (add_lit_target)
  /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API/CMakeLists.txt:4 (add_lit_testsuites)

Can you take a look?

@Michael137, your change is causing cmake to fail on one of our bots:

https://lab.llvm.org/buildbot/#/builders/217/builds/11819

CMake Error at cmake/modules/AddLLVM.cmake:1867 (add_custom_target):
  add_custom_target cannot create target
  "check-lldb-api-lang-cpp-gmodules-templates" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:1980 (add_lit_target)
  /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API/CMakeLists.txt:4 (add_lit_testsuites)

Can you take a look?

Here I'm just renaming a directory. @dyung I think this might have to do with a stale __pycache__ directory in the test directory. Can you force a fresh checkout on the build bot and restart?

To be more specific, the problem is that there used to be a directory in the test suite called gmodules-template and Michael moved it to gmodules/template to better organize the tests. But our rule for making a test name from subdirectories is to replace the "/" with a "-" so these two ended up being the same test name, which is an error.

Michael's patch properly moved gmodules-template to gmodules/template so there actually shouldn't be a conflict. But because python insists on sticking these pycache directories alongside the test files git won't actually remove the directory on update, and thus until you either manually remove the gmodules-template directory or do a fresh checkout you'll get this error.

Is there a way to get the testsuite runs not to put these cache files into the source tree? Running the testsuite really shouldn't be changing the source tree... Or if we can't get it to stop that, is there a "git pull" that will clean up anything not actually in the repo? I don't think we ever actually want to preserve anything of that sort from run to run.

Jim

dyung added a comment.Sep 16 2022, 4:57 PM

@Michael137, your change is causing cmake to fail on one of our bots:

https://lab.llvm.org/buildbot/#/builders/217/builds/11819

CMake Error at cmake/modules/AddLLVM.cmake:1867 (add_custom_target):
  add_custom_target cannot create target
  "check-lldb-api-lang-cpp-gmodules-templates" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:1980 (add_lit_target)
  /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API/CMakeLists.txt:4 (add_lit_testsuites)

Can you take a look?

Here I'm just renaming a directory. @dyung I think this might have to do with a stale __pycache__ directory in the test directory. Can you force a fresh checkout on the build bot and restart?

I only found one pycache directory and deleting it didn't seem to make a difference. Any other suggestions?

@Michael137, your change is causing cmake to fail on one of our bots:

https://lab.llvm.org/buildbot/#/builders/217/builds/11819

CMake Error at cmake/modules/AddLLVM.cmake:1867 (add_custom_target):
  add_custom_target cannot create target
  "check-lldb-api-lang-cpp-gmodules-templates" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:1980 (add_lit_target)
  /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API/CMakeLists.txt:4 (add_lit_testsuites)

Can you take a look?

Here I'm just renaming a directory. @dyung I think this might have to do with a stale __pycache__ directory in the test directory. Can you force a fresh checkout on the build bot and restart?

I only found one pycache directory and deleting it didn't seem to make a difference. Any other suggestions?

Could you try deleting the lldb/test/API/lang/cpp/gmodules-templates directory?

dyung added a comment.Sep 16 2022, 6:26 PM

@Michael137, your change is causing cmake to fail on one of our bots:

https://lab.llvm.org/buildbot/#/builders/217/builds/11819

CMake Error at cmake/modules/AddLLVM.cmake:1867 (add_custom_target):
  add_custom_target cannot create target
  "check-lldb-api-lang-cpp-gmodules-templates" because another target with
  the same name already exists.  The existing target is a custom target
  created in source directory
  "/home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:1980 (add_lit_target)
  /home/buildbot/buildbot-root/cross-project-tests-sie-ubuntu/llvm-project/lldb/test/API/CMakeLists.txt:4 (add_lit_testsuites)

Can you take a look?

Here I'm just renaming a directory. @dyung I think this might have to do with a stale __pycache__ directory in the test directory. Can you force a fresh checkout on the build bot and restart?

I only found one pycache directory and deleting it didn't seem to make a difference. Any other suggestions?

Could you try deleting the lldb/test/API/lang/cpp/gmodules-templates directory?

That seemed to do the trick, thanks!

lldb/test/API/lang/cpp/gmodules/templates/main.cpp