Skip to content

[lldb] Remove obsolete signBinary helper #79656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2024

Conversation

JDevlieghere
Copy link
Member

On Darwin, the Makefile already (ad-hoc) signs everything it builds. There's also no need to use lldb_codesign for this.

On Darwin, the Makefile already (ad-hoc) signs everything it builds.
There's also no need to use lldb_codesign for this.
@llvmbot
Copy link
Member

llvmbot commented Jan 26, 2024

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

On Darwin, the Makefile already (ad-hoc) signs everything it builds. There's also no need to use lldb_codesign for this.


Full diff: https://github.com/llvm/llvm-project/pull/79656.diff

8 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/dotest.py (-2)
  • (modified) lldb/packages/Python/lldbsuite/test/dotest_args.py (-6)
  • (modified) lldb/packages/Python/lldbsuite/test/lldbtest.py (-8)
  • (modified) lldb/test/API/CMakeLists.txt (-6)
  • (modified) lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py (-1)
  • (modified) lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py (-1)
  • (modified) lldb/test/API/api/multiple-targets/TestMultipleTargets.py (-1)
  • (modified) lldb/test/API/api/multithreaded/TestMultithreaded.py (-1)
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py
index a639714480cf4eb..4393e0caacaab88 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -442,8 +442,6 @@ def parseOptionsAndInitTestdirs():
             os.path.realpath(os.path.abspath(x)) for x in args.args
         ]
 
-    lldbtest_config.codesign_identity = args.codesign_identity
-
 
 def registerFaulthandler():
     try:
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 70a65078f1d3a88..e4de786ec054894 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -217,12 +217,6 @@ def create_parser():
         action="store_true",
         help="Leave logs/traces even for successful test runs (useful for creating reference log files during debugging.)",
     )
-    group.add_argument(
-        "--codesign-identity",
-        metavar="Codesigning identity",
-        default="lldb_codesign",
-        help="The codesigning identity to use",
-    )
     group.add_argument(
         "--build-dir",
         dest="test_build_dir",
diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index 3abc713398490e7..d944b09cbcc4720 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1543,14 +1543,6 @@ def buildProgram(self, sources, exe_name):
         d = {"CXX_SOURCES": sources, "EXE": exe_name}
         self.build(dictionary=d)
 
-    def signBinary(self, binary_path):
-        if sys.platform.startswith("darwin"):
-            codesign_cmd = 'codesign --force --sign "%s" %s' % (
-                lldbtest_config.codesign_identity,
-                binary_path,
-            )
-            call(codesign_cmd, shell=True)
-
     def findBuiltClang(self):
         """Tries to find and use Clang from the build directory as the compiler (instead of the system compiler)."""
         paths_to_try = [
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 0b63ffdb4bd9ae3..4e02112c29e4cd5 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -98,12 +98,6 @@ if(CMAKE_HOST_APPLE)
     set(LLDB_FRAMEWORK_DIR ${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework)
   endif()
 
-  # Use the same identity for testing
-  get_property(code_sign_identity_used GLOBAL PROPERTY LLDB_DEBUGSERVER_CODESIGN_IDENTITY)
-  if(code_sign_identity_used)
-    list(APPEND LLDB_TEST_COMMON_ARGS_VAR --codesign-identity "${code_sign_identity_used}")
-  endif()
-
   if(LLDB_USE_SYSTEM_DEBUGSERVER)
     lldb_find_system_debugserver(system_debugserver_path)
     if(LLDB_BUILD_FRAMEWORK)
diff --git a/lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py b/lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py
index 77f146f7bcb0389..98f089377363494 100644
--- a/lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py
+++ b/lldb/test/API/api/command-return-object/TestSBCommandReturnObject.py
@@ -18,7 +18,6 @@ def test_sb_command_return_object(self):
         self.driver_exe = self.getBuildArtifact("command-return-object")
         self.buildDriver("main.cpp", self.driver_exe)
         self.addTearDownHook(lambda: os.remove(self.driver_exe))
-        self.signBinary(self.driver_exe)
 
         if self.TraceOn():
             print("Running test %s" % self.driver_exe)
diff --git a/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py b/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
index 889784ccc60b634..15b2012eee13b6b 100644
--- a/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
+++ b/lldb/test/API/api/multiple-debuggers/TestMultipleDebuggers.py
@@ -24,7 +24,6 @@ def test_multiple_debuggers(self):
         self.driver_exe = self.getBuildArtifact("multi-process-driver")
         self.buildDriver("multi-process-driver.cpp", self.driver_exe)
         self.addTearDownHook(lambda: os.remove(self.driver_exe))
-        self.signBinary(self.driver_exe)
 
         self.inferior_exe = self.getBuildArtifact("testprog")
         self.buildDriver("testprog.cpp", self.inferior_exe)
diff --git a/lldb/test/API/api/multiple-targets/TestMultipleTargets.py b/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
index 831ce325bcdb52e..4fb9279e978d7b3 100644
--- a/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
+++ b/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
@@ -24,7 +24,6 @@ def test_multiple_targets(self):
         self.driver_exe = self.getBuildArtifact("multi-target")
         self.buildDriver("main.cpp", self.driver_exe)
         self.addTearDownHook(lambda: os.remove(self.driver_exe))
-        self.signBinary(self.driver_exe)
 
         # check_call will raise a CalledProcessError if multi-process-driver doesn't return
         # exit code 0 to indicate success.  We can let this exception go - the test harness
diff --git a/lldb/test/API/api/multithreaded/TestMultithreaded.py b/lldb/test/API/api/multithreaded/TestMultithreaded.py
index 631079b1d1db625..1eeff12da4920d8 100644
--- a/lldb/test/API/api/multithreaded/TestMultithreaded.py
+++ b/lldb/test/API/api/multithreaded/TestMultithreaded.py
@@ -106,7 +106,6 @@ def build_and_test(self, sources, test_name, args=None):
         self.addTearDownHook(lambda: os.remove(self.getBuildArtifact(test_name)))
 
         test_exe = self.getBuildArtifact(test_name)
-        self.signBinary(test_exe)
         exe = [test_exe, self.getBuildArtifact(self.inferior)]
 
         env = {self.dylibPath: self.getLLDBLibraryEnvVal()}

Copy link
Member

@bulbazord bulbazord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@JDevlieghere JDevlieghere merged commit 7595287 into llvm:main Jan 27, 2024
@JDevlieghere JDevlieghere deleted the deprecate-signBinary branch January 27, 2024 04:37
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Jan 27, 2024
On Darwin, the Makefile already (ad-hoc) signs everything it builds.
There's also no need to use lldb_codesign for this.

(cherry picked from commit 7595287)
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants