Skip to content

Commit 3150086

Browse files
authored
Revert "[Build] Make cmark build a build-script product (#37102)"
This reverts commit 3c19cc4.
1 parent 069e51d commit 3150086

File tree

9 files changed

+19
-338
lines changed

9 files changed

+19
-338
lines changed

Diff for: utils/build-script

+2-3
Original file line numberDiff line numberDiff line change
@@ -886,12 +886,11 @@ class BuildScriptInvocation(object):
886886
if self.args.build_early_swift_driver:
887887
before_impl_product_classes.append(products.EarlySwiftDriver)
888888

889-
if self.args.build_cmark:
890-
before_impl_product_classes.append(products.CMark)
891-
892889
# FIXME: This is a weird division (returning a list of class objects),
893890
# but it matches the existing structure of the `build-script-impl`.
894891
impl_product_classes = []
892+
if self.args.build_cmark:
893+
impl_product_classes.append(products.CMark)
895894

896895
# If --skip-build-llvm is passed in, LLVM cannot be completely disabled, as
897896
# Swift still needs a few LLVM targets like tblgen to be built for it to be

Diff for: utils/build_swift/build_swift/driver_arguments.py

-3
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,6 @@ def create_argument_parser():
288288
help='instead of building, write JSON to stdout containing '
289289
'various values used to build in this configuration')
290290

291-
option(['--reconfigure'], store_true,
292-
help="Reconfigure all projects as we build")
293-
294291
option('--legacy-impl', store_true('legacy_impl'),
295292
help='use legacy implementation')
296293

Diff for: utils/build_swift/tests/expected_options.py

-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@
197197
'native_llvm_tools_path': None,
198198
'native_swift_tools_path': None,
199199
'dump_config': False,
200-
'reconfigure': False,
201200
'relocate_xdg_cache_home_under_build_subdir': False,
202201
'show_sdks': False,
203202
'skip_build': False,
@@ -507,7 +506,6 @@ class BuildScriptImplOption(_BaseOption):
507506

508507
SetTrueOption('--legacy-impl', dest='legacy_impl'),
509508
SetTrueOption('--infer', dest='infer_dependencies'),
510-
SetTrueOption('--reconfigure'),
511509

512510
EnableOption('--android'),
513511
EnableOption('--build-external-benchmarks'),

Diff for: utils/swift_build_support/swift_build_support/products/cmake_product.py

-116
This file was deleted.

Diff for: utils/swift_build_support/swift_build_support/products/cmark.py

+4-64
Original file line numberDiff line numberDiff line change
@@ -10,87 +10,27 @@
1010
#
1111
# ----------------------------------------------------------------------------
1212

13-
from . import cmake_product
13+
from . import product
1414

1515

16-
class CMark(cmake_product.CMakeProduct):
16+
class CMark(product.Product):
1717
@classmethod
1818
def is_build_script_impl_product(cls):
1919
"""is_build_script_impl_product -> bool
2020
2121
Whether this product is produced by build-script-impl.
2222
"""
23-
return False
23+
return True
2424

2525
@classmethod
2626
def is_before_build_script_impl_product(cls):
2727
"""is_before_build_script_impl_product -> bool
2828
2929
Whether this product is build before any build-script-impl products.
3030
"""
31-
return True
31+
return False
3232

3333
# This is the root of the build-graph, so it doesn't have any dependencies.
3434
@classmethod
3535
def get_dependencies(cls):
3636
return []
37-
38-
def should_build(self, host_target):
39-
"""should_build() -> Bool
40-
41-
Whether or not this product should be built with the given arguments.
42-
"""
43-
return self.args.build_cmark
44-
45-
def build(self, host_target):
46-
"""build() -> void
47-
48-
Perform the build, for a non-build-script-impl product.
49-
"""
50-
self.cmake_options.define('CMAKE_BUILD_TYPE:STRING',
51-
self.args.cmark_build_variant)
52-
53-
self.build_with_cmake(["all"], self.args.cmark_build_variant, [])
54-
55-
def should_test(self, host_target):
56-
"""should_test() -> Bool
57-
58-
Whether or not this product should be tested with the given arguments.
59-
"""
60-
if self.args.cross_compile_hosts and \
61-
host_target in self.args.cross_compile_hosts:
62-
return False
63-
64-
return self.args.test
65-
66-
def test(self, host_target):
67-
"""
68-
Perform the test phase for the product.
69-
70-
This phase might build and execute the product tests.
71-
"""
72-
executable_target = 'api_test'
73-
results_targets = ['test']
74-
if self.args.cmake_generator == 'Xcode':
75-
# Xcode generator uses "RUN_TESTS" instead of "test".
76-
results_targets = ['RUN_TESTS']
77-
78-
self.test_with_cmake(executable_target, results_targets,
79-
self.args.cmark_build_variant, [])
80-
81-
def should_install(self, host_target):
82-
"""should_install() -> Bool
83-
84-
Whether or not this product should be installed with the given
85-
arguments.
86-
"""
87-
return self.args.install_all
88-
89-
def install(self, host_target):
90-
"""
91-
Perform the install phase for the product.
92-
93-
This phase might copy the artifacts from the previous phases into a
94-
destination directory.
95-
"""
96-
self.install_with_cmake(["install"], self.host_install_destdir(host_target))

Diff for: utils/swift_build_support/swift_build_support/products/product.py

-25
Original file line numberDiff line numberDiff line change
@@ -190,31 +190,6 @@ def install_toolchain_path(self, host_target):
190190
return targets.toolchain_path(install_destdir,
191191
self.args.install_prefix)
192192

193-
def should_include_host_in_lipo(self, host_target):
194-
if self.args.cross_compile_hosts:
195-
if host_target.startswith("macosx") or \
196-
host_target.startswith("iphone") or \
197-
host_target.startswith("appletv") or \
198-
host_target.startswith("watch"):
199-
return True
200-
return False
201-
202-
def host_install_destdir(self, host_target):
203-
if self.args.cross_compile_hosts:
204-
# If cross compiling tools, install into a host-specific subdirectory.
205-
if self.should_include_host_in_lipo(host_target):
206-
# If this is one of the hosts we should lipo,
207-
# install in to a temporary subdirectory.
208-
return '%s/intermediate-install/%s' % \
209-
(self.args.install_destdir, host_target)
210-
elif host_target == "merged-hosts":
211-
# This assumes that all hosts are merged to the lipo.
212-
return self.args.install_destdir
213-
else:
214-
return '%s/%s' % (self.args.install_destdir, host_target)
215-
else:
216-
return self.args.install_destdir
217-
218193

219194
class ProductBuilder(object):
220195
"""

Diff for: utils/swift_build_support/tests/products/test_cmark.py

-113
This file was deleted.

0 commit comments

Comments
 (0)