Skip to content

Commit bc17558

Browse files
committed
Auto merge of #66194 - alexcrichton:update-clang, r=<try>
Update Clang & build MSVC LLVM with it This is a general update of our builders to Clang 9, and then it also attempts to tackle a bit of #66192 by building LLVM for rustc with Clang, not with the system `cl.exe` on MSVC.
2 parents 50f8aad + 3cf7f98 commit bc17558

File tree

7 files changed

+56
-75
lines changed

7 files changed

+56
-75
lines changed

src/ci/azure-pipelines/auto.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ jobs:
318318
# 32/64 bit MSVC and GNU deployment
319319
dist-x86_64-msvc:
320320
MSYS_BITS: 64
321-
RUST_CONFIGURE_ARGS: >
321+
RUST_CONFIGURE_ARGS: >-
322322
--build=x86_64-pc-windows-msvc
323323
--target=x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
324324
--enable-full-tools
@@ -328,7 +328,7 @@ jobs:
328328
DEPLOY: 1
329329
dist-i686-msvc:
330330
MSYS_BITS: 32
331-
RUST_CONFIGURE_ARGS: >
331+
RUST_CONFIGURE_ARGS: >-
332332
--build=i686-pc-windows-msvc
333333
--target=i586-pc-windows-msvc
334334
--enable-full-tools

src/ci/azure-pipelines/try.yml

+18-59
Original file line numberDiff line numberDiff line change
@@ -17,62 +17,21 @@ jobs:
1717
dist-x86_64-linux:
1818
IMAGE: dist-x86_64-linux
1919
DEPLOY: 1
20-
21-
dist-x86_64-linux-alt:
22-
IMAGE: dist-x86_64-linux
23-
DEPLOY_ALT: 1
24-
25-
# The macOS and Windows builds here are currently disabled due to them not being
26-
# overly necessary on `try` builds. We also don't actually have anything that
27-
# consumes the artifacts currently. Perhaps one day we can reenable, but for now
28-
# it helps free up capacity on Azure.
29-
# - job: macOS
30-
# timeoutInMinutes: 600
31-
# pool:
32-
# vmImage: macos-10.13
33-
# steps:
34-
# - template: steps/run.yml
35-
# strategy:
36-
# matrix:
37-
# dist-x86_64-apple:
38-
# SCRIPT: ./x.py dist
39-
# RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc
40-
# DEPLOY: 1
41-
# RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
42-
# MACOSX_DEPLOYMENT_TARGET: 10.7
43-
# NO_LLVM_ASSERTIONS: 1
44-
# NO_DEBUG_ASSERTIONS: 1
45-
# DIST_REQUIRE_ALL_TOOLS: 1
46-
#
47-
# dist-x86_64-apple-alt:
48-
# SCRIPT: ./x.py dist
49-
# RUST_CONFIGURE_ARGS: --enable-extended --enable-profiler --set rust.jemalloc
50-
# DEPLOY_ALT: 1
51-
# RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
52-
# MACOSX_DEPLOYMENT_TARGET: 10.7
53-
# NO_LLVM_ASSERTIONS: 1
54-
# NO_DEBUG_ASSERTIONS: 1
55-
#
56-
# - job: Windows
57-
# timeoutInMinutes: 600
58-
# pool:
59-
# vmImage: 'vs2017-win2016'
60-
# steps:
61-
# - template: steps/run.yml
62-
# strategy:
63-
# matrix:
64-
# dist-x86_64-msvc:
65-
# RUST_CONFIGURE_ARGS: >
66-
# --build=x86_64-pc-windows-msvc
67-
# --target=x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
68-
# --enable-full-tools
69-
# --enable-profiler
70-
# SCRIPT: python x.py dist
71-
# DIST_REQUIRE_ALL_TOOLS: 1
72-
# DEPLOY: 1
73-
#
74-
# dist-x86_64-msvc-alt:
75-
# MSYS_BITS: 64
76-
# RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-extended --enable-profiler
77-
# SCRIPT: python x.py dist
78-
# DEPLOY_ALT: 1
20+
- job: Windows
21+
timeoutInMinutes: 600
22+
pool:
23+
vmImage: 'vs2017-win2016'
24+
steps:
25+
- template: steps/run.yml
26+
strategy:
27+
matrix:
28+
dist-x86_64-msvc:
29+
MSYS_BITS: 64
30+
RUST_CONFIGURE_ARGS: >-
31+
--build=x86_64-pc-windows-msvc
32+
--target=x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
33+
--enable-full-tools
34+
--enable-profiler
35+
SCRIPT: python x.py dist
36+
DIST_REQUIRE_ALL_TOOLS: 1
37+
DEPLOY: 1

src/ci/docker/dist-i686-linux/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN ./build-python.sh
6969

7070
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh /tmp/
72+
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
7373
RUN ./build-clang.sh
7474
ENV CC=clang CXX=clang++
7575

src/ci/docker/dist-x86_64-linux/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ RUN ./build-python.sh
6969

7070
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
72-
COPY dist-x86_64-linux/build-clang.sh /tmp/
72+
COPY dist-x86_64-linux/build-clang.sh dist-x86_64-linux/llvm-project-centos.patch /tmp/
7373
RUN ./build-clang.sh
7474
ENV CC=clang CXX=clang++
7575

src/ci/docker/dist-x86_64-linux/build-clang.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ set -ex
44

55
source shared.sh
66

7-
LLVM=llvmorg-8.0.0-rc2
7+
LLVM=llvmorg-9.0.0
88

99
mkdir llvm-project
1010
cd llvm-project
1111

1212
curl -L https://github.com/llvm/llvm-project/archive/$LLVM.tar.gz | \
1313
tar xzf - --strip-components=1
1414

15+
yum install -y patch
16+
patch -Np1 < ../llvm-project-centos.patch
17+
1518
mkdir clang-build
1619
cd clang-build
1720

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
2+
index 176d6d6abf3..a6d63bf24b8 100644
3+
--- a/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
4+
+++ b/clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp
5+
@@ -33,6 +33,13 @@ namespace {
6+
using namespace llvm;
7+
using namespace clang;
8+
9+
+#define EPOLL_CLOEXEC -1
10+
+#define IN_CLOEXEC -1
11+
+#define O_CLOEXEC -1
12+
+static int epoll_create1(int flags) { return -1; }
13+
+static int inotify_init1(int flags) { return -1; }
14+
+static int pipe2(int *fds, int flags) { return -1; }
15+
+
16+
/// Pipe for inter-thread synchronization - for epoll-ing on multiple
17+
/// conditions. It is meant for uni-directional 1:1 signalling - specifically:
18+
/// no multiple consumers, no data passing. Thread waiting for signal should

src/ci/scripts/install-clang.sh

+12-11
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ IFS=$'\n\t'
99
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1010

1111
if isMacOS; then
12-
curl -f "${MIRRORS_BASE}/clang%2Bllvm-7.0.0-x86_64-apple-darwin.tar.xz" | tar xJf -
12+
curl -f "${MIRRORS_BASE}/clang%2Bllvm-9.0.0-x86_64-darwin-apple.tar.xz" | tar xJf -
1313

14-
ciCommandSetEnv CC "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang"
15-
ciCommandSetEnv CXX "$(pwd)/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++"
14+
ciCommandSetEnv CC "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang"
15+
ciCommandSetEnv CXX "$(pwd)/clang+llvm-9.0.0-x86_64-darwin-apple/bin/clang++"
1616

1717
# Configure `AR` specifically so rustbuild doesn't try to infer it as
1818
# `clang-ar` by accident.
@@ -27,17 +27,18 @@ elif isWindows && [[ -z ${MINGW_URL+x} ]]; then
2727
# Note that the LLVM installer is an NSIS installer
2828
#
2929
# Original downloaded here came from
30-
# http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
31-
# That installer was run through `wine` on Linux and then the resulting
32-
# installation directory (found in `$HOME/.wine/drive_c/Program Files/LLVM`) was
33-
# packaged up into a tarball. We've had issues otherwise that the installer will
34-
# randomly hang, provide not a lot of useful information, pollute global state,
35-
# etc. In general the tarball is just more confined and easier to deal with when
36-
# working with various CI environments.
30+
# http://releases.llvm.org/9.0.0/LLVM-9.0.0-win64.exe
31+
# That installer was run through `wine ./installer.exe /S /NCRC` on Linux
32+
# and then the resulting installation directory (found in
33+
# `$HOME/.wine/drive_c/Program Files/LLVM`) was packaged up into a tarball.
34+
# We've had issues otherwise that the installer will randomly hang, provide
35+
# not a lot of useful information, pollute global state, etc. In general the
36+
# tarball is just more confined and easier to deal with when working with
37+
# various CI environments.
3738

3839
mkdir -p citools
3940
cd citools
40-
curl -f "${MIRRORS_BASE}/LLVM-7.0.0-win64.tar.gz" | tar xzf -
41+
curl -f "${MIRRORS_BASE}/LLVM-9.0.0-win64.tar.gz" | tar xzf -
4142
ciCommandSetEnv RUST_CONFIGURE_ARGS \
4243
"${RUST_CONFIGURE_ARGS} --set llvm.clang-cl=$(pwd)/clang-rust/bin/clang-cl.exe"
4344
fi

0 commit comments

Comments
 (0)