Skip to content

Add --release flag for bootstrap script #231

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 2 commits into from
Apr 2, 2016
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
17 changes: 13 additions & 4 deletions Utilities/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,8 @@ def main():
help="Path to Foundation build directory")
parser.add_argument("--xctest", dest="xctest_path",
help="Path to XCTest build directory")
parser.add_argument("--release", action="store_true",
help="Build stage 2 for release")
args = parser.parse_args()

if not args.swiftc_path:
Expand Down Expand Up @@ -638,6 +640,9 @@ def main():
cmd.extend(["-Xswiftc", "-I{}".format(args.foundation_path)])
cmd.extend(["-Xswiftc", "-I{}".format(core_foundation_path)])

if args.release:
cmd.extend(["--configuration", "release"])

cmd = env_cmd + cmd

note("building self-hosted 'swift-build': %s" % (
Expand All @@ -646,16 +651,20 @@ def main():
if result != 0:
Copy link
Contributor

Choose a reason for hiding this comment

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

These paths aren't correct, and they are used in the testing step below...

Never mind, I see now that was fixed in the other commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, sorry, I spotted it later though at least.

error("build failed with exit status %d" % (result,))

swift_build_path = os.path.join(build_path, "debug", "swift-build")
swift_test_path = os.path.join(build_path, "debug", "swift-test")
note("built: %s" % (swift_build_path,))
if args.release:
conf = "release"
else:
conf = "debug"

swift_build_path = os.path.join(build_path, conf, "swift-build")
swift_test_path = os.path.join(build_path, conf, "swift-test")

# If testing, run each of the test bundles.
if "test" in build_actions:
# Construct the test environment.
env_cmd = ["env", "SWIFT_EXEC=" + os.path.join(bindir, "swiftc"),
"SWIFT_BUILD_PATH=" + build_path]
cmd = env_cmd + [os.path.join(build_path, "debug", "swift-test")]
cmd = env_cmd + [swift_test_path]
result = subprocess.call(cmd, cwd=g_project_root)
if result != 0:
error("tests failed with exit status %d" % (result,))
Expand Down