Skip to content

Commit 53e9c2d

Browse files
committed
[libc++] Use the monorepo for the back-deployment testing scripts
llvm-svn: 368077
1 parent 26e60f0 commit 53e9c2d

File tree

2 files changed

+27
-59
lines changed

2 files changed

+27
-59
lines changed

libcxx/utils/ci/macos-backdeployment.sh

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ set -ue
44

55
function usage() {
66
cat <<EOM
7-
$(basename ${0}) [-h|--help] --libcxx-root <LIBCXX-ROOT> --libcxxabi-root <LIBCXXABI-ROOT> --std <STD> --arch <ARCHITECTURE> --deployment-target <TARGET> --sdk-version <SDK-VERSION> [--lit-args <ARGS...>]
7+
$(basename ${0}) [-h|--help] --monorepo-root <MONOREPO-ROOT> --std <STD> --arch <ARCHITECTURE> --deployment-target <TARGET> --sdk-version <SDK-VERSION> [--lit-args <ARGS...>]
88
99
This script is used to continually test the back-deployment use case of libc++ and libc++abi on MacOS.
1010
11-
--libcxx-root Full path to the root of the libc++ repository to test.
12-
--libcxxabi-root Full path to the root of the libc++abi repository to test.
11+
--monorepo-root Full path to the root of the LLVM monorepo. Both libc++ and libc++abi headers from the monorepo are used.
1312
--std Version of the C++ Standard to run the tests under (c++03, c++11, etc..).
1413
--arch Architecture to build the tests for (32, 64).
1514
--deployment-target The deployment target to run the tests for. This should be a version number of MacOS (e.g. 10.12). All MacOS versions until and including 10.9 are supported.
@@ -22,19 +21,10 @@ EOM
2221

2322
while [[ $# -gt 0 ]]; do
2423
case "$1" in
25-
--libcxx-root)
26-
LIBCXX_ROOT="${2}"
27-
if [[ ! -d "${LIBCXX_ROOT}" ]]; then
28-
echo "--libcxx-root '${LIBCXX_ROOT}' is not a valid directory"
29-
usage
30-
exit 1
31-
fi
32-
shift; shift
33-
;;
34-
--libcxxabi-root)
35-
LIBCXXABI_ROOT="${2}"
36-
if [[ ! -d "${LIBCXXABI_ROOT}" ]]; then
37-
echo "--libcxxabi-root '${LIBCXXABI_ROOT}' is not a valid directory"
24+
--monorepo-root)
25+
MONOREPO_ROOT="${2}"
26+
if [[ ! -d "${MONOREPO_ROOT}" ]]; then
27+
echo "--monorepo-root '${MONOREPO_ROOT}' is not a valid directory"
3828
usage
3929
exit 1
4030
fi
@@ -76,8 +66,7 @@ while [[ $# -gt 0 ]]; do
7666
esac
7767
done
7868

79-
if [[ -z ${LIBCXX_ROOT+x} ]]; then echo "--libcxx-root is a required parameter"; usage; exit 1; fi
80-
if [[ -z ${LIBCXXABI_ROOT+x} ]]; then echo "--libcxxabi-root is a required parameter"; usage; exit 1; fi
69+
if [[ -z ${MONOREPO_ROOT+x} ]]; then echo "--monorepo-root is a required parameter"; usage; exit 1; fi
8170
if [[ -z ${STD+x} ]]; then echo "--std is a required parameter"; usage; exit 1; fi
8271
if [[ -z ${ARCH+x} ]]; then echo "--arch is a required parameter"; usage; exit 1; fi
8372
if [[ -z ${DEPLOYMENT_TARGET+x} ]]; then echo "--deployment-target is a required parameter"; usage; exit 1; fi
@@ -98,53 +87,32 @@ function cleanup {
9887
trap cleanup EXIT
9988

10089

101-
LLVM_ROOT="${TEMP_DIR}/llvm"
102-
LIBCXX_BUILD_DIR="${TEMP_DIR}/libcxx-build"
103-
LIBCXX_INSTALL_DIR="${TEMP_DIR}/libcxx-install"
104-
LIBCXXABI_BUILD_DIR="${TEMP_DIR}/libcxxabi-build"
105-
LIBCXXABI_INSTALL_DIR="${TEMP_DIR}/libcxxabi-install"
90+
LLVM_BUILD_DIR="${TEMP_DIR}/llvm-build"
91+
LLVM_INSTALL_DIR="${TEMP_DIR}/llvm-install"
10692

10793
PREVIOUS_DYLIBS_URL="http://lab.llvm.org:8080/roots/libcxx-roots.tar.gz"
10894
LLVM_TARBALL_URL="https://github.com/llvm-mirror/llvm/archive/master.tar.gz"
10995

11096

111-
echo "@@@ Downloading LLVM tarball of master (only used for CMake configuration) @@@"
112-
mkdir "${LLVM_ROOT}"
113-
curl -L "${LLVM_TARBALL_URL}" | tar -xz --strip-components=1 -C "${LLVM_ROOT}"
114-
echo "@@@@@@"
115-
116-
11797
echo "@@@ Configuring architecture-related stuff @@@"
11898
if [[ "${ARCH}" == "64" ]]; then CMAKE_ARCH_STRING="x86_64"; else CMAKE_ARCH_STRING="i386"; fi
11999
if [[ "${ARCH}" == "64" ]]; then LIT_ARCH_STRING=""; else LIT_ARCH_STRING="--param=enable_32bit=true"; fi
120100
echo "@@@@@@"
121101

122102

123-
echo "@@@ Configuring CMake for libc++ @@@"
124-
mkdir -p "${LIBCXX_BUILD_DIR}"
125-
(cd "${LIBCXX_BUILD_DIR}" &&
126-
xcrun cmake "${LIBCXX_ROOT}" -GNinja \
127-
-DLLVM_PATH="${LLVM_ROOT}" \
128-
-DCMAKE_INSTALL_PREFIX="${LIBCXX_INSTALL_DIR}" \
129-
-DCMAKE_OSX_ARCHITECTURES="${CMAKE_ARCH_STRING}"
130-
)
131-
echo "@@@@@@"
132-
133-
134-
echo "@@@ Configuring CMake for libc++abi @@@"
135-
mkdir -p "${LIBCXXABI_BUILD_DIR}"
136-
(cd "${LIBCXXABI_BUILD_DIR}" &&
137-
xcrun cmake "${LIBCXXABI_ROOT}" -GNinja \
138-
-DLIBCXXABI_LIBCXX_PATH="${LIBCXX_ROOT}" \
139-
-DLLVM_PATH="${LLVM_ROOT}" \
140-
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_INSTALL_DIR}" \
103+
echo "@@@ Configuring CMake @@@"
104+
mkdir -p "${LLVM_BUILD_DIR}"
105+
(cd "${LLVM_BUILD_DIR}" &&
106+
xcrun cmake "${MONOREPO_ROOT}/llvm" -GNinja \
107+
-DCMAKE_INSTALL_PREFIX="${LLVM_INSTALL_DIR}" \
108+
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
141109
-DCMAKE_OSX_ARCHITECTURES="${CMAKE_ARCH_STRING}"
142110
)
143111
echo "@@@@@@"
144112

145113

146114
echo "@@@ Installing the latest libc++ headers @@@"
147-
ninja -C "${LIBCXX_BUILD_DIR}" install-cxx-headers
115+
ninja -C "${LLVM_BUILD_DIR}" install-cxx-headers
148116
echo "@@@@@@"
149117

150118

@@ -161,14 +129,14 @@ echo "@@@@@@"
161129

162130
# TODO: We need to also run the tests for libc++abi.
163131
echo "@@@ Running tests for libc++ @@@"
164-
"${LIBCXX_BUILD_DIR}/bin/llvm-lit" -sv "${LIBCXX_ROOT}/test" \
165-
--param=enable_experimental=false \
166-
${LIT_ARCH_STRING} \
167-
--param=cxx_headers="${LIBCXX_INSTALL_DIR}/include/c++/v1" \
168-
--param=std="${STD}" \
169-
--param=platform="macosx${DEPLOYMENT_TARGET}" \
170-
--param=cxx_runtime_root="$(dirname "${LIBCXX_ON_DEPLOYMENT_TARGET}")" \
171-
--param=abi_library_path="$(dirname "${LIBCXXABI_ON_DEPLOYMENT_TARGET}")" \
172-
--param=use_system_cxx_lib="$(dirname "${LIBCXX_IN_SDK}")" \
173-
${ADDITIONAL_LIT_ARGS}
132+
"${LLVM_BUILD_DIR}/bin/llvm-lit" -sv "${MONOREPO_ROOT}/libcxx/test" \
133+
--param=enable_experimental=false \
134+
${LIT_ARCH_STRING} \
135+
--param=cxx_headers="${LLVM_INSTALL_DIR}/include/c++/v1" \
136+
--param=std="${STD}" \
137+
--param=platform="macosx${DEPLOYMENT_TARGET}" \
138+
--param=cxx_runtime_root="$(dirname "${LIBCXX_ON_DEPLOYMENT_TARGET}")" \
139+
--param=abi_library_path="$(dirname "${LIBCXXABI_ON_DEPLOYMENT_TARGET}")" \
140+
--param=use_system_cxx_lib="$(dirname "${LIBCXX_IN_SDK}")" \
141+
${ADDITIONAL_LIT_ARGS}
174142
echo "@@@@@@"

libcxx/utils/ci/macos-trunk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -ue
44

55
function usage() {
66
cat <<EOM
7-
$(basename ${0}) [-h|--help] --libcxx-root <LIBCXX-ROOT> --libcxxabi-root <LIBCXXABI-ROOT> --std <STD> --arch <ARCHITECTURE> [--lit-args <ARGS...>]
7+
$(basename ${0}) [-h|--help] --monorepo-root <MONOREPO-ROOT> --std <STD> --arch <ARCHITECTURE> [--lit-args <ARGS...>]
88
99
This script is used to continually test libc++ and libc++abi trunk on MacOS.
1010

0 commit comments

Comments
 (0)