Skip to content

[lldb] Print SWIFTC in the Make invocation #2239

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
Dec 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions lldb/packages/Python/lldbsuite/test/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ def getCCSpec(self, compiler):
else:
return ""

def getSwiftCSpec(self):
"""
Helper function to return the key-value string to specify the Swift
compiler used for the make system.
"""
if configuration.swiftCompiler:
return "SWIFTC=\"{}\"".format(configuration.swiftCompiler)
else:
return ""

def getSDKRootSpec(self):
"""
Helper function to return the key-value string to specify the SDK root
Expand Down Expand Up @@ -151,6 +161,7 @@ def buildDefault(self,
self.getArchSpec(architecture),
self.getSwiftTargetFlags(architecture),
self.getCCSpec(compiler),
self.getSwiftCSpec(),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(),
Expand Down Expand Up @@ -178,6 +189,7 @@ def buildDwarf(self,
self.getArchSpec(architecture),
self.getSwiftTargetFlags(architecture),
self.getCCSpec(compiler),
self.getSwiftCSpec(),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(),
Expand All @@ -204,6 +216,7 @@ def buildDwo(self,
self.getArchSpec(architecture),
self.getSwiftTargetFlags(architecture),
self.getCCSpec(compiler),
self.getSwiftCSpec(),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(),
Expand All @@ -230,6 +243,7 @@ def buildGModules(self,
self.getArchSpec(architecture),
self.getSwiftTargetFlags(architecture),
self.getCCSpec(compiler),
self.getSwiftCSpec(),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(),
Expand Down
1 change: 1 addition & 0 deletions lldb/packages/Python/lldbsuite/test/builders/darwin.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def buildDsym(self,
self.getArchSpec(architecture),
self.getSwiftTargetFlags(architecture),
self.getCCSpec(compiler),
self.getSwiftCSpec(),
self.getExtraMakeArgs(),
self.getSDKRootSpec(),
self.getModuleCacheSpec(), "all",
Expand Down
2 changes: 0 additions & 2 deletions lldb/packages/Python/lldbsuite/test/dotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,8 +973,6 @@ def run_suite():
# Iterating over all possible architecture and compiler combinations.
os.environ["ARCH"] = configuration.arch
os.environ["CC"] = configuration.compiler
if configuration.swiftCompiler:

Choose a reason for hiding this comment

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

Why does this go away here while CC is still in the environment? Should CC also disappear? I'm just wondering because of the apparent inconsistency.

Copy link
Author

Choose a reason for hiding this comment

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

They've already been removed upstream.

os.environ["SWIFTC"] = configuration.swiftCompiler
configString = "arch=%s compiler=%s" % (configuration.arch,
configuration.compiler)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# ------------------------------------------------------------------------------
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test import configuration
import lldbsuite.test.lldbtest as lldbtest
import lldbsuite.test.lldbutil as lldbutil
import os
Expand All @@ -25,8 +26,8 @@ class TestSwiftBackwardsCompatibilitySimple(lldbtest.TestBase):
@swiftTest
@skipIf(compiler="swiftc", compiler_version=['<', '5.0'])
def test_simple(self):
if 'SWIFTC' in os.environ:
compiler = os.environ['SWIFTC']
if configuration.swiftCompiler:
compiler = configuration.swiftCompiler
else:
compiler = swift.getSwiftCompiler()
version = self.getCompilerVersion(compiler)
Expand Down