Skip to content

[Build System: build-script] Remove the debug module from swift_build_support. #29461

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, 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
22 changes: 20 additions & 2 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ from build_swift.build_swift import presets
import six

from swift_build_support.swift_build_support import (
debug,
diagnostics,
products,
shell,
Expand Down Expand Up @@ -71,6 +70,25 @@ class JSONDumper(json.JSONEncoder):
return six.text_type(o)


def print_xcodebuild_versions(file=sys.stdout):
"""
Print the host machine's `xcodebuild` version, as well as version
information for all available SDKs.
"""
version = shell.capture(
['xcodebuild', '-version'], dry_run=False, echo=False).rstrip()
# Allow non-zero exit codes. Under certain obscure circumstances
# xcodebuild can exit with a non-zero exit code even when the SDK is
# usable.
sdks = shell.capture(
['xcodebuild', '-version', '-sdk'], dry_run=False, echo=False,
allow_non_zero_exit=True).rstrip()
fmt = '{version}\n\n--- SDK versions ---\n{sdks}\n'

print(fmt.format(version=version, sdks=sdks), file=file)
file.flush()


class BuildScriptInvocation(object):

"""Represent a single build script invocation."""
Expand Down Expand Up @@ -1116,7 +1134,7 @@ def main_normal():

# Show SDKs, if requested.
if args.show_sdks:
debug.print_xcodebuild_versions()
print_xcodebuild_versions()

if args.dump_config:
print(JSONDumper().encode(invocation))
Expand Down
46 changes: 0 additions & 46 deletions utils/swift_build_support/swift_build_support/debug.py

This file was deleted.

41 changes: 0 additions & 41 deletions utils/swift_build_support/tests/test_debug.py

This file was deleted.