Skip to content

Commit 9c5a13a

Browse files
authored
Merge pull request #2343 from apple/revert-2340-module-interface
Revert "[bootstrap] Install swiftinterface instead of swiftmodule for PD"
2 parents 195f047 + 4835127 commit 9c5a13a

File tree

1 file changed

+23
-51
lines changed

1 file changed

+23
-51
lines changed

Utilities/bootstrap

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ class Target(object):
159159
self.is_swift = False
160160
# FIXME: Currently only C libraries are supported in bootstrap script.
161161
self.is_c = False
162-
self.enable_module_interface = False
163162

164163
self.sources = []
165164
self.module_root_dir = os.path.join(g_source_root, subpath or self.name)
@@ -203,7 +202,6 @@ class Target(object):
203202
link_input_nodes, predecessor_node, target_map):
204203
# Compute the derived paths.
205204
module_path = os.path.join(module_dir, "%s.swiftmodule" % (self.name,))
206-
module_interface_path = os.path.join(module_dir, "%s.swiftinterface" % (self.name,))
207205

208206
# Create the per-file entries.
209207
swift_objects = []
@@ -232,13 +230,7 @@ class Target(object):
232230
compile_swift_node = '<compile-swift-%s>' % (self.name,)
233231
link_input_nodes.append(compile_swift_node)
234232

235-
if self.enable_module_interface:
236-
other_args.extend(["-enable-library-evolution", "-emit-module-interface-path", module_interface_path])
237-
other_args.extend(["-swift-version", "5"])
238-
else:
239-
# FIXME: We should just update to the newer version.
240-
other_args.extend(["-swift-version", "4"])
241-
233+
other_args.extend(["-swift-version", "4"])
242234
other_args.extend(["-module-cache-path", os.path.join(args.sandbox_path, "ModuleCache")])
243235

244236
print(" %s:" % json.dumps(compile_swift_node), file=output)
@@ -648,8 +640,6 @@ def build_runtimes(targets, sandbox_path, args):
648640
target_copy.name = 'PackageDescription'
649641
target_copy.release = args.release
650642
target_copy.swiftflags = ["-DPACKAGE_DESCRIPTION_%s" % (version)]
651-
if platform.system() == 'Darwin':
652-
target_copy.enable_module_interface = True
653643
build = llbuild(
654644
os.path.join(sandbox_path, "runtimes", version), [target_copy], args)
655645
build.create_manifest()
@@ -660,8 +650,6 @@ def build_runtimes(targets, sandbox_path, args):
660650
def process_runtime_libraries(build, args, lib_path):
661651
module_input_path = os.path.join(
662652
build.module_dir, "PackageDescription.swiftmodule")
663-
moduleinterface_input_path = os.path.join(
664-
build.module_dir, "PackageDescription.swiftinterface")
665653
swiftdoc_input_path = os.path.join(
666654
build.module_dir, "PackageDescription.swiftdoc")
667655
input_lib_path = os.path.join(
@@ -670,19 +658,13 @@ def process_runtime_libraries(build, args, lib_path):
670658
mkdir_p(lib_path)
671659
runtime_module_path = os.path.join(
672660
lib_path, "PackageDescription.swiftmodule")
673-
runtime_moduleinterface_path = os.path.join(
674-
lib_path, "PackageDescription.swiftinterface")
675661
runtime_swiftdoc_path = os.path.join(
676662
lib_path, "PackageDescription.swiftdoc")
677663

678-
if platform.system() == 'Darwin':
679-
distutils.file_util.copy_file(moduleinterface_input_path, runtime_moduleinterface_path,
680-
update=1)
681-
else:
682-
distutils.file_util.copy_file(module_input_path, runtime_module_path,
683-
update=1)
684-
distutils.file_util.copy_file(swiftdoc_input_path, runtime_swiftdoc_path,
685-
update=1)
664+
distutils.file_util.copy_file(module_input_path, runtime_module_path,
665+
update=1)
666+
distutils.file_util.copy_file(swiftdoc_input_path, runtime_swiftdoc_path,
667+
update=1)
686668

687669
if platform.system() == 'Darwin':
688670
runtime_lib_path = os.path.join(lib_path, "libPackageDescription.dylib")
@@ -691,7 +673,6 @@ def process_runtime_libraries(build, args, lib_path):
691673
"-Xlinker", "-all_load",
692674
input_lib_path,
693675
"-sdk", args.sysroot,
694-
"-enable-library-evolution",
695676
"-target", "x86_64-apple-macosx10.10"]
696677
elif platform.system() == 'Windows':
697678
runtime_lib_path = os.path.join(lib_path, "PackageDescription.dll")
@@ -715,7 +696,7 @@ def process_runtime_libraries(build, args, lib_path):
715696
cmd.extend(["-module-cache-path", os.path.join(args.sandbox_path, "ModuleCache")])
716697

717698
subprocess.check_call(cmd)
718-
return (runtime_moduleinterface_path, runtime_module_path, runtime_swiftdoc_path, runtime_lib_path)
699+
return (runtime_module_path, runtime_swiftdoc_path, runtime_lib_path)
719700

720701

721702
def get_swift_build_tool_path():
@@ -1387,38 +1368,29 @@ def main():
13871368

13881369
# Install the runtimes.
13891370
for version, runtime in processed_runtimes.items():
1390-
runtime_moduleinterface_path, runtime_module_path, runtime_swiftdoc_path, runtime_lib_path = runtime
1371+
runtime_module_path, runtime_swiftdoc_path, runtime_lib_path = runtime
13911372
install_path = os.path.join(lib_install_path, version)
13921373

13931374
# Install library.
13941375
installBinary(runtime_lib_path, install_path, args)
13951376

1396-
if platform.system() == 'Darwin':
1397-
cmd = ["install", "-m", "0644",
1398-
runtime_moduleinterface_path, install_path]
1399-
note("installing %s: %s" % (
1400-
os.path.basename(runtime_moduleinterface_path), ' '.join(cmd)))
1401-
result = subprocess.call(cmd)
1402-
if result != 0:
1403-
error("module install failed with exit status %d" % (result,))
1404-
else:
1405-
# Install module.
1406-
cmd = ["install", "-m", "0644",
1407-
runtime_module_path, install_path]
1408-
note("installing %s: %s" % (
1409-
os.path.basename(runtime_module_path), ' '.join(cmd)))
1410-
result = subprocess.call(cmd)
1411-
if result != 0:
1412-
error("module install failed with exit status %d" % (result,))
1377+
# Install module.
1378+
cmd = ["install", "-m", "0644",
1379+
runtime_module_path, install_path]
1380+
note("installing %s: %s" % (
1381+
os.path.basename(runtime_module_path), ' '.join(cmd)))
1382+
result = subprocess.call(cmd)
1383+
if result != 0:
1384+
error("module install failed with exit status %d" % (result,))
14131385

1414-
# Install swiftdoc.
1415-
cmd = ["install", "-m", "0644",
1416-
runtime_swiftdoc_path, install_path]
1417-
note("installing %s: %s" % (
1418-
os.path.basename(runtime_swiftdoc_path), ' '.join(cmd)))
1419-
result = subprocess.call(cmd)
1420-
if result != 0:
1421-
error("swiftdoc install failed with exit status %d" % (result,))
1386+
# Install swiftdoc.
1387+
cmd = ["install", "-m", "0644",
1388+
runtime_swiftdoc_path, install_path]
1389+
note("installing %s: %s" % (
1390+
os.path.basename(runtime_swiftdoc_path), ' '.join(cmd)))
1391+
result = subprocess.call(cmd)
1392+
if result != 0:
1393+
error("swiftdoc install failed with exit status %d" % (result,))
14221394

14231395

14241396
# Copy the libSwiftPM library to a directory, if we've been asked to do so.

0 commit comments

Comments
 (0)