Skip to content

install Foundation via the ninja script and add the test phase for Foundation #4

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
Nov 19, 2015
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
12 changes: 12 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,11 @@ build the Debug variant of the Swift standard library and SDK overlay""",
action="store_const",
const="Debug",
dest="cmark_build_variant")
build_variant_override_group.add_argument("--debug-foundation",
help="build the Debug variant of Foundation",
action="store_const",
const="Debug",
dest="foundation_build_variant")

assertions_group = parser.add_mutually_exclusive_group(required=False)
assertions_group.add_argument("--assertions",
Expand Down Expand Up @@ -513,6 +518,9 @@ placed""",
if args.lldb_build_variant is None:
args.lldb_build_variant = args.build_variant

if args.foundation_build_variant is None:
args.foundation_build_variant = args.build_variant

# Assertions are enabled by default.
if args.assertions is None:
args.assertions = True
Expand Down Expand Up @@ -692,6 +700,10 @@ placed""",
"--cmake-generator", args.cmake_generator,
"--workspace", SWIFT_SOURCE_ROOT
]
if args.build_foundation:
build_script_impl_args += [
"--foundation-build-type", args.foundation_build_variant
]
build_script_impl_args += build_script_impl_inferred_args

# If we have extra_swift_args, combine all of them together and then add
Expand Down
14 changes: 11 additions & 3 deletions utils/build-script-impl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ KNOWN_SETTINGS=(
swift-stdlib-enable-assertions "1" "enable assertions in Swift"
lldb-build-type "Debug" "the CMake build variant for LLDB"
llbuild-build-type "Debug" "the CMake build variant for llbuild"
foundation-build-type "Debug" "the build variant for Foundation"
llbuild-enable-assertions "1" "enable assertions in llbuild"
enable-asan "" "enable AddressSanitizer"
cmake "" "path to the cmake binary"
Expand Down Expand Up @@ -1706,6 +1707,8 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
continue
;;
foundation)
# the configuration script requires knowing about XCTest's location for building and running the tests
XCTEST_BUILD_DIR=$(build_directory $deployment_target xctest)
SWIFTC_BIN="$(build_directory_bin $deployment_target swift)/swiftc"
SWIFT_BIN="$(build_directory_bin $deployment_target swift)/swift"
SWIFT_BUILD_PATH="$(build_directory $deployment_target swift)"
Expand All @@ -1720,7 +1723,7 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
set -x
pushd "${FOUNDATION_SOURCE_DIR}"
SWIFTC="${SWIFTC_BIN}" CLANG="${LLVM_BIN}"/clang SWIFT="${SWIFT_BIN}" \
SDKROOT="${SWIFT_BUILD_PATH}" BUILD_DIR="${build_dir}" ./configure
SDKROOT="${SWIFT_BUILD_PATH}" BUILD_DIR="${build_dir}" DSTROOT="${INSTALL_DESTDIR}" PREFIX="${INSTALL_PREFIX}" SWIFTCFLAGS="-I${XCTEST_BUILD_DIR}" LDFLAGS="-L${XCTEST_BUILD_DIR}" ./configure "${FOUNDATION_BUILD_TYPE}"
$NINJA_BIN
popd
{ set +x; } 2>/dev/null
Expand Down Expand Up @@ -1900,7 +1903,12 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do
if [[ "$SKIP_TEST_FOUNDATION" ]]; then
continue
fi
# FIXME: We don't test foundation, yet...
build_dir=$(build_directory $deployment_target $product)
XCTEST_BUILD_DIR=$(build_directory $deployment_target xctest)
pushd "${FOUNDATION_SOURCE_DIR}"
$NINJA_BIN TestFoundation
LD_LIBRARY_PATH="${INSTALL_DESTDIR}"/"${INSTALL_PREFIX}"/lib/swift/:"${build_dir}/Foundation":"${XCTEST_BUILD_DIR}":$LD_LIBRARY_PATH "${build_dir}"/TestFoundation/TestFoundation
popd
continue
;;
*)
Expand Down Expand Up @@ -2048,7 +2056,7 @@ for deployment_target in "${NATIVE_TOOLS_DEPLOYMENT_TARGETS[@]}" "${CROSS_TOOLS_
build_dir=$(build_directory $deployment_target $product)
set -x
pushd "${FOUNDATION_SOURCE_DIR}"
DSTROOT="${INSTALL_DESTDIR}" BUILD_DIR="${build_dir}" ./install
$NINJA_BIN install
popd
{ set +x; } 2>/dev/null

Expand Down