Skip to content

Commit 2d2cf93

Browse files
committedOct 10, 2019
[test] Pass DSYMUTIL and SDKROOT as part of the Make invocation.
Pass the DSYMUTIL and SDKROOT variables on the command line instead of the environment. This makes it easier to reproduce the make invocation during development. Differential revision: https://reviews.llvm.org/D68812 llvm-svn: 374385
1 parent 99c9d7b commit 2d2cf93

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed
 

‎lldb/packages/Python/lldbsuite/test/plugins/builder_base.py

+36-5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,23 @@ def getCCSpec(compiler):
104104
else:
105105
return ""
106106

107+
def getDsymutilSpec():
108+
"""
109+
Helper function to return the key-value string to specify the dsymutil
110+
used for the make system.
111+
"""
112+
if "DSYMUTIL" in os.environ:
113+
return "DSYMUTIL={}".format(os.environ["DSYMUTIL"])
114+
return "";
115+
116+
def getSDKRootSpec():
117+
"""
118+
Helper function to return the key-value string to specify the SDK root
119+
used for the make system.
120+
"""
121+
if "SDKROOT" in os.environ:
122+
return "SDKROOT={}".format(os.environ["SDKROOT"])
123+
return "";
107124

108125
def getCmdLine(d):
109126
"""
@@ -145,8 +162,13 @@ def buildDefault(
145162
testname=None):
146163
"""Build the binaries the default way."""
147164
commands = []
148-
commands.append(getMake(testdir, testname) + ["all", getArchSpec(architecture),
149-
getCCSpec(compiler), getCmdLine(dictionary)])
165+
commands.append(getMake(testdir, testname) +
166+
["all",
167+
getArchSpec(architecture),
168+
getCCSpec(compiler),
169+
getDsymutilSpec(),
170+
getSDKRootSpec(),
171+
getCmdLine(dictionary)])
150172

151173
runBuildCommands(commands, sender=sender)
152174

@@ -164,8 +186,12 @@ def buildDwarf(
164186
"""Build the binaries with dwarf debug info."""
165187
commands = []
166188
commands.append(getMake(testdir, testname) +
167-
["MAKE_DSYM=NO", getArchSpec(architecture),
168-
getCCSpec(compiler), getCmdLine(dictionary)])
189+
["MAKE_DSYM=NO",
190+
getArchSpec(architecture),
191+
getCCSpec(compiler),
192+
getDsymutilSpec(),
193+
getSDKRootSpec(),
194+
getCmdLine(dictionary)])
169195

170196
runBuildCommands(commands, sender=sender)
171197
# True signifies that we can handle building dwarf.
@@ -182,9 +208,12 @@ def buildDwo(
182208
"""Build the binaries with dwarf debug info."""
183209
commands = []
184210
commands.append(getMake(testdir, testname) +
185-
["MAKE_DSYM=NO", "MAKE_DWO=YES",
211+
["MAKE_DSYM=NO",
212+
"MAKE_DWO=YES",
186213
getArchSpec(architecture),
187214
getCCSpec(compiler),
215+
getDsymutilSpec(),
216+
getSDKRootSpec(),
188217
getCmdLine(dictionary)])
189218

190219
runBuildCommands(commands, sender=sender)
@@ -206,6 +235,8 @@ def buildGModules(
206235
"MAKE_GMODULES=YES",
207236
getArchSpec(architecture),
208237
getCCSpec(compiler),
238+
getDsymutilSpec(),
239+
getSDKRootSpec(),
209240
getCmdLine(dictionary)])
210241

211242
lldbtest.system(commands, sender=sender)

0 commit comments

Comments
 (0)
Please sign in to comment.