Skip to content

Commit 1ff4349

Browse files
committed
[lldb] Print SWIFTC in the Make invocation
Don't pass SWIFTC through the environment but rather make it part of the Make invocation. This makes it possible to reproduce the Make step by copying the invocation. rdar://68730409
1 parent 117fc5b commit 1ff4349

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

lldb/packages/Python/lldbsuite/test/builders/builder.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ def getCCSpec(self, compiler):
116116
else:
117117
return ""
118118

119+
def getSwiftCSpec(self):
120+
"""
121+
Helper function to return the key-value string to specify the Swift
122+
compiler used for the make system.
123+
"""
124+
if configuration.swiftCompiler:
125+
return "SWIFTC=\"{}\"".format(configuration.swiftCompiler)
126+
else:
127+
return ""
128+
119129
def getSDKRootSpec(self):
120130
"""
121131
Helper function to return the key-value string to specify the SDK root
@@ -151,6 +161,7 @@ def buildDefault(self,
151161
self.getArchSpec(architecture),
152162
self.getSwiftTargetFlags(architecture),
153163
self.getCCSpec(compiler),
164+
self.getSwiftCSpec(),
154165
self.getExtraMakeArgs(),
155166
self.getSDKRootSpec(),
156167
self.getModuleCacheSpec(),
@@ -178,6 +189,7 @@ def buildDwarf(self,
178189
self.getArchSpec(architecture),
179190
self.getSwiftTargetFlags(architecture),
180191
self.getCCSpec(compiler),
192+
self.getSwiftCSpec(),
181193
self.getExtraMakeArgs(),
182194
self.getSDKRootSpec(),
183195
self.getModuleCacheSpec(),
@@ -204,6 +216,7 @@ def buildDwo(self,
204216
self.getArchSpec(architecture),
205217
self.getSwiftTargetFlags(architecture),
206218
self.getCCSpec(compiler),
219+
self.getSwiftCSpec(),
207220
self.getExtraMakeArgs(),
208221
self.getSDKRootSpec(),
209222
self.getModuleCacheSpec(),
@@ -230,6 +243,7 @@ def buildGModules(self,
230243
self.getArchSpec(architecture),
231244
self.getSwiftTargetFlags(architecture),
232245
self.getCCSpec(compiler),
246+
self.getSwiftCSpec(),
233247
self.getExtraMakeArgs(),
234248
self.getSDKRootSpec(),
235249
self.getModuleCacheSpec(),

lldb/packages/Python/lldbsuite/test/builders/darwin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def buildDsym(self,
125125
self.getArchSpec(architecture),
126126
self.getSwiftTargetFlags(architecture),
127127
self.getCCSpec(compiler),
128+
self.getSwiftCSpec(),
128129
self.getExtraMakeArgs(),
129130
self.getSDKRootSpec(),
130131
self.getModuleCacheSpec(), "all",

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -973,8 +973,6 @@ def run_suite():
973973
# Iterating over all possible architecture and compiler combinations.
974974
os.environ["ARCH"] = configuration.arch
975975
os.environ["CC"] = configuration.compiler
976-
if configuration.swiftCompiler:
977-
os.environ["SWIFTC"] = configuration.swiftCompiler
978976
configString = "arch=%s compiler=%s" % (configuration.arch,
979977
configuration.compiler)
980978

lldb/test/API/lang/swift/backwards_compatibility/simple/TestSwiftBackwardsCompatibilitySimple.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# ------------------------------------------------------------------------------
1212
import lldb
1313
from lldbsuite.test.decorators import *
14+
from lldbsuite.test import configuration
1415
import lldbsuite.test.lldbtest as lldbtest
1516
import lldbsuite.test.lldbutil as lldbutil
1617
import os
@@ -25,8 +26,8 @@ class TestSwiftBackwardsCompatibilitySimple(lldbtest.TestBase):
2526
@swiftTest
2627
@skipIf(compiler="swiftc", compiler_version=['<', '5.0'])
2728
def test_simple(self):
28-
if 'SWIFTC' in os.environ:
29-
compiler = os.environ['SWIFTC']
29+
if configuration.swiftCompiler:
30+
compiler = configuration.swiftCompiler
3031
else:
3132
compiler = swift.getSwiftCompiler()
3233
version = self.getCompilerVersion(compiler)

0 commit comments

Comments
 (0)