Skip to content

Remove support for installing the swift modules in a toolchain #324

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
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
33 changes: 4 additions & 29 deletions build-script.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def __init__(
self.swiftpm_call.extend(["--verbose"])
self.verbose = verbose

def build(self, product_name, module_group_path=""):
def build(self, product_name):
print("** Building " + product_name + " **")
command = list(self.swiftpm_call)
command.extend(["--product", product_name])
Expand Down Expand Up @@ -607,7 +607,7 @@ def check_and_sync(file_path, install_path):
fatal_error("install failed with exit status %d" % (result,))


def install(build_dir, dylib_dir, swiftmodule_base_name, stdlib_rpath):
def install(build_dir, dylib_dir, stdlib_rpath):
for dylib_name in get_installed_dylib_names():

dylib_path = os.path.join(build_dir, dylib_name)
Expand All @@ -621,15 +621,6 @@ def install(build_dir, dylib_dir, swiftmodule_base_name, stdlib_rpath):
file_path=dylib_path, install_path=os.path.join(dylib_dir, dylib_name)
)

# Optionally install .swiftmodule
if swiftmodule_base_name:
module_path = os.path.join(build_dir, "SwiftSyntax.swiftmodule")
doc_path = os.path.join(build_dir, "SwiftSyntax.swiftdoc")
module_dest = swiftmodule_base_name + ".swiftmodule"
doc_dest = swiftmodule_base_name + ".swiftdoc"
check_and_sync(file_path=module_path, install_path=module_dest)
check_and_sync(file_path=doc_path, install_path=doc_dest)


# -----------------------------------------------------------------------------
# Arugment Parsing
Expand All @@ -654,17 +645,6 @@ def install(build_dir, dylib_dir, swiftmodule_base_name, stdlib_rpath):
"""


_SWIFTMODULE_BASE_NAME_HELP = """
The name under which the Swift module should be installed. A .swiftdoc and
.swiftmodule file extension will be added to this path and the corresponding
files will be copied there.

Example /path/to/SwiftSyntax.swiftmodule/x86_64 copies files to
/path/to/SwiftSyntax.swiftmodule/x86_64.swiftmodule and
/path/to/SwiftSyntax.swiftmodule/x86_64.swiftdoc
"""


def parse_args():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter, description=_DESCRIPTION
Expand Down Expand Up @@ -751,10 +731,6 @@ def parse_args():
"--dylib-dir", help="The directory to where the .dylib should be installed."
)

install_group.add_argument(
"--swiftmodule-base-name", help=_SWIFTMODULE_BASE_NAME_HELP
)

# -------------------------------------------------------------------------
test_group = parser.add_argument_group("Test")

Expand Down Expand Up @@ -809,7 +785,6 @@ def main():
install(
build_dir=build_dir,
dylib_dir=args.dylib_dir,
swiftmodule_base_name=args.swiftmodule_base_name,
stdlib_rpath=stdlib_rpath,
)
sys.exit(0)
Expand Down Expand Up @@ -859,8 +834,8 @@ def main():
)
# Until rdar://53881101 is implemented, we cannot request a build of multiple
# targets simultaneously. For now, just build one product after the other.
builder.build("SwiftSyntax", module_group_path=GROUP_INFO_PATH)
builder.build("SwiftSyntaxParser", module_group_path=GROUP_INFO_PATH)
builder.build("SwiftSyntax")
builder.build("SwiftSyntaxParser")

# Only build lit-test-helper if we are planning to run tests
if args.test:
Expand Down