Skip to content

[lldb/crashlog] Use environment variable to manually set dsymForUUIDBinary #94517

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
Jun 5, 2024

Conversation

medismailben
Copy link
Member

In lldb, users can change the dsymForUUID binary using the LLDB_APPLE_DSYMFORUUID_EXECUTABLE environment variable.

This patch changes the crashlog to support the same behaviour as lldb and uses this environment variable to disable dsymForUUID lookups in crashlog test by having it be empty. Since CI bots shoudn't have access to images on build records, it doesn't make sense to make use of dsymForUUID in tests.

rdar://128953725

…inary

In lldb, users can change the `dsymForUUID` binary using the
`LLDB_APPLE_DSYMFORUUID_EXECUTABLE` environment variable.

This patch changes the crashlog to support the same behaviour as lldb
and uses this environment variable to disable `dsymForUUID` lookups in
crashlog test by having it be empty. Since CI bots shoudn't have
access to images on build records, it doesn't make sense to make use of
`dsymForUUID` in tests.

rdar://128953725

Signed-off-by: Med Ismail Bennani <[email protected]>
@llvmbot llvmbot added the lldb label Jun 5, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 5, 2024

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

Changes

In lldb, users can change the dsymForUUID binary using the LLDB_APPLE_DSYMFORUUID_EXECUTABLE environment variable.

This patch changes the crashlog to support the same behaviour as lldb and uses this environment variable to disable dsymForUUID lookups in crashlog test by having it be empty. Since CI bots shoudn't have access to images on build records, it doesn't make sense to make use of dsymForUUID in tests.

rdar://128953725


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

2 Files Affected:

  • (modified) lldb/examples/python/crashlog.py (+3-1)
  • (modified) lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg (+2)
diff --git a/lldb/examples/python/crashlog.py b/lldb/examples/python/crashlog.py
index 641b2e64d53b1..c874cb4d32e66 100755
--- a/lldb/examples/python/crashlog.py
+++ b/lldb/examples/python/crashlog.py
@@ -284,7 +284,9 @@ class DarwinImage(symbolication.Image):
         """Class that represents a binary images in a darwin crash log"""
 
         dsymForUUIDBinary = "/usr/local/bin/dsymForUUID"
-        if not os.path.exists(dsymForUUIDBinary):
+        if "LLDB_APPLE_DSYMFORUUID_EXECUTABLE" in os.environ:
+            dsymForUUIDBinary = os.environ["LLDB_APPLE_DSYMFORUUID_EXECUTABLE"]
+        elif not os.path.exists(dsymForUUIDBinary):
             try:
                 dsymForUUIDBinary = (
                     subprocess.check_output("which dsymForUUID", shell=True)
diff --git a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
index 417069653d68e..3da9265b3553d 100644
--- a/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
+++ b/lldb/test/Shell/ScriptInterpreter/Python/Crashlog/lit.local.cfg
@@ -3,3 +3,5 @@ if 'system-darwin' not in config.available_features:
 
 if 'lldb-repro' in config.available_features:
   config.unsupported = True
+
+config.environment["LLDB_APPLE_DSYMFORUUID_EXECUTABLE"] = ""

@medismailben medismailben merged commit f8afa76 into llvm:main Jun 5, 2024
7 checks passed
medismailben added a commit to medismailben/llvm-project that referenced this pull request Jun 6, 2024
…inary (llvm#94517)

In lldb, users can change the `dsymForUUID` binary using the
`LLDB_APPLE_DSYMFORUUID_EXECUTABLE` environment variable.

This patch changes the crashlog to support the same behaviour as lldb
and uses this environment variable to disable `dsymForUUID` lookups in
crashlog test by having it be empty. Since CI bots shoudn't have access
to images on build records, it doesn't make sense to make use of
`dsymForUUID` in tests.

rdar://128953725

Signed-off-by: Med Ismail Bennani <[email protected]>
(cherry picked from commit f8afa76)
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