Skip to content

Commit 8442252

Browse files
committed
[libc++] Use the monorepo in the macos-trunk CI script
llvm-svn: 368051
1 parent 51b0032 commit 8442252

File tree

1 file changed

+17
-54
lines changed

1 file changed

+17
-54
lines changed

libcxx/utils/ci/macos-trunk.sh

Lines changed: 17 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ $(basename ${0}) [-h|--help] --libcxx-root <LIBCXX-ROOT> --libcxxabi-root <LIBCX
88
99
This script is used to continually test libc++ and libc++abi trunk 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 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
--libcxx-exceptions Whether to enable exceptions when building libc++ and running the libc++ tests. libc++abi is always built with support for exceptions because other libraries in the runtime depend on it (like libobjc). This must be ON or OFF.
@@ -22,19 +21,10 @@ EOM
2221

2322
while [[ $# -gt 0 ]]; do
2423
case "$1" in
25-
--libcxx-root)
26-
LIBCXX_ROOT="${2}"
27-
if [[ ! -e "${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 [[ ! -e "${LIBCXXABI_ROOT}" ]]; then
37-
echo "--libcxxabi-root '${LIBCXXABI_ROOT}' is not a valid directory"
24+
--monorepo-root)
25+
MONOREPO_ROOT="${2}"
26+
if [[ ! -e "${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 [[ "${LIBCXX_EXCEPTIONS}" != "ON" && "${LIBCXX_EXCEPTIONS}" != "OFF" ]]; then echo "--libcxx-exceptions is a required parameter and must be either ON or OFF"; usage; exit 1; fi
@@ -98,19 +87,8 @@ 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"
106-
107-
108-
echo "@@@ Downloading LLVM tarball of master (only used for CMake configuration) @@@"
109-
mkdir "${LLVM_ROOT}"
110-
LLVM_TARBALL_URL="https://github.com/llvm-mirror/llvm/archive/master.tar.gz"
111-
curl -L "${LLVM_TARBALL_URL}" | tar -xz --strip-components=1 -C "${LLVM_ROOT}"
112-
echo "@@@@@@"
113-
90+
LLVM_BUILD_DIR="${TEMP_DIR}/llvm-build"
91+
LLVM_INSTALL_DIR="${TEMP_DIR}/llvm-install"
11492

11593
echo "@@@ Setting up LIT flags @@@"
11694
LIT_FLAGS="-sv --param=std=${STD} ${ADDITIONAL_LIT_ARGS}"
@@ -120,49 +98,34 @@ fi
12098
echo "@@@@@@"
12199

122100

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}" \
101+
echo "@@@ Configuring CMake @@@"
102+
mkdir -p "${LLVM_BUILD_DIR}"
103+
(cd "${LLVM_BUILD_DIR}" &&
104+
xcrun cmake "${MONOREPO_ROOT}/llvm" -GNinja \
105+
-DCMAKE_INSTALL_PREFIX="${LLVM_INSTALL_DIR}" \
129106
-DLIBCXX_ENABLE_EXCEPTIONS="${LIBCXX_EXCEPTIONS}" \
130107
-DLIBCXX_ENABLE_NEW_DELETE_DEFINITIONS=OFF \
131-
${ADDITIONAL_CMAKE_ARGS} \
132-
-DLLVM_LIT_ARGS="${LIT_FLAGS}" \
133-
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" # Build a universal dylib
134-
)
135-
echo "@@@@@@"
136-
137-
138-
echo "@@@ Configuring CMake for libc++abi @@@"
139-
mkdir -p "${LIBCXXABI_BUILD_DIR}"
140-
(cd "${LIBCXXABI_BUILD_DIR}" &&
141-
xcrun cmake "${LIBCXXABI_ROOT}" -GNinja \
142-
-DLIBCXXABI_LIBCXX_PATH="${LIBCXX_ROOT}" \
143-
-DLLVM_PATH="${LLVM_ROOT}" \
144-
-DCMAKE_INSTALL_PREFIX="${LIBCXXABI_INSTALL_DIR}" \
145108
-DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
146109
-DLIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS=ON \
147110
${ADDITIONAL_CMAKE_ARGS} \
148111
-DLLVM_LIT_ARGS="${LIT_FLAGS}" \
112+
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
149113
-DCMAKE_OSX_ARCHITECTURES="i386;x86_64" # Build a universal dylib
150114
)
151115
echo "@@@@@@"
152116

153117

154118
echo "@@@ Building libc++.dylib and libc++abi.dylib from sources (just to make sure it works) @@@"
155-
ninja -C "${LIBCXX_BUILD_DIR}" install-cxx -v
156-
ninja -C "${LIBCXXABI_BUILD_DIR}" install-cxxabi -v
119+
ninja -C "${LLVM_BUILD_DIR}" install-cxx install-cxxabi -v
157120
echo "@@@@@@"
158121

159122

160123
echo "@@@ Running tests for libc++ @@@"
161124
# TODO: We should run check-cxx-abilist too
162-
ninja -C "${LIBCXX_BUILD_DIR}" check-cxx
125+
ninja -C "${LLVM_BUILD_DIR}" check-cxx
163126
echo "@@@@@@"
164127

165128

166129
echo "@@@ Running tests for libc++abi @@@"
167-
ninja -C "${LIBCXXABI_BUILD_DIR}" check-cxxabi
130+
ninja -C "${LLVM_BUILD_DIR}" check-cxxabi
168131
echo "@@@@@@"

0 commit comments

Comments
 (0)