@@ -22,8 +22,7 @@ RUN apt-get update && \
2222 build-essential \
2323 # Dependency for arrow
2424 bison \
25- clang-12 \
26- lld-12 \
25+ clang \
2726 cmake \
2827 curl \
2928 # Dependency for arrow
@@ -32,10 +31,8 @@ RUN apt-get update && \
3231 git \
3332 gcc \
3433 g++ \
35- # Required by Ubsan in Ubuntu 22.04
36- libunwind-12-dev \
37- libc++-12-dev \
38- libc++abi-12-dev \
34+ libc++-dev \
35+ libc++abi-dev \
3936 libcurl4-openssl-dev \
4037 # Needed to use autoreconf
4138 libltdl-dev \
@@ -61,28 +58,22 @@ RUN apt-get update && \
6158 apt-utils \
6259 ca-certificates \
6360 apt-transport-https \
64- clang-tidy-12
61+ clang-tidy
62+
63+ # Set Clang 12 as default
64+ RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 && \
65+ update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
66+
67+ # Set the compiler environment variables
68+ ENV CC=/usr/bin/clang
69+ ENV CXX=/usr/bin/clang++
6570
6671# Needed for the existing driver v3.1.2.1004+
6772RUN locale-gen en_US.UTF-8
6873ENV LANG en_US.UTF-8
6974ENV LANGUAGE en_US.UTF-8
7075ENV LC_ALL en_US.UTF-8
7176
72- # Set clang as default
73- RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 100 && \
74- update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 100
75-
76- ENV CC=clang
77- ENV CXX=clang++
78-
79- # Install modern CMake locally
80- RUN mkdir -p /opt/cmake && \
81- curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.30.1/cmake-3.30.1-linux-x86_64.tar.gz \
82- | tar -xz --strip-components=1 -C /opt/cmake
83-
84- ENV PATH=/opt/cmake/bin:$PATH
85-
8677# clang-tidy-cache needs python
8778RUN update-alternatives --install /usr/bin/python python $(which python3) 10
8879
@@ -91,63 +82,6 @@ WORKDIR /var/tmp/downloads
9182RUN if [ $(ls /var/tmp/ci/requirements.txt | grep -c requirements.txt) -eq 0 ] ; \
9283 then echo 'Unable to find requirements.txt for python...' ; exit 1 ; fi
9384RUN pip3 install --require-hashes --no-deps -r /var/tmp/ci/requirements.txt
94-
95- # Install all the direct (and indirect) dependencies for cpp-bigquery-odbc.
96- # Use a different directory for each build, and remove the downloaded
97- # files and any temporary artifacts after a successful build to keep the
98- # image smaller (and with fewer layers)
99-
100- WORKDIR /var/tmp/build/abseil-cpp
101- RUN curl -fsSL https://github.com/abseil/abseil-cpp/archive/20240722.0.tar.gz | \
102- tar -xzf - --strip-components=1 && \
103- cmake \
104- -DCMAKE_BUILD_TYPE="Release" \
105- -DCMAKE_CXX_STANDARD=17 \
106- -DABSL_BUILD_TESTING=OFF \
107- -DABSL_PROPAGATE_CXX_STD=ON \
108- -DBUILD_SHARED_LIBS=yes \
109- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
110- -S . -B cmake-out -GNinja && \
111- cmake --build cmake-out --target install && \
112- ldconfig && \
113- cd /var/tmp && rm -fr build
114-
115- WORKDIR /var/tmp/build/googletest
116- RUN curl -fsSL https://github.com/google/googletest/archive/v1.15.2.tar.gz | \
117- tar -xzf - --strip-components=1 && \
118- cmake \
119- -DCMAKE_BUILD_TYPE="Release" \
120- -DBUILD_SHARED_LIBS=yes \
121- -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
122- -S . -B cmake-out -GNinja && \
123- cmake --build cmake-out --target install && \
124- ldconfig && \
125- cd /var/tmp && rm -fr build
126-
127- # Install ctcache to speed up our clang-tidy build
128- WORKDIR /var/tmp/build
129- RUN curl -fsSL https://github.com/matus-chochlik/ctcache/archive/0ad2e227e8a981a9c1a6060ee6c8ec144bb976c6.tar.gz | \
130- tar -xzf - --strip-components=1 && \
131- cp clang-tidy /usr/local/bin/clang-tidy-wrapper && \
132- cp clang-tidy-cache /usr/local/bin/clang-tidy-cache && \
133- cd /var/tmp && rm -fr build
134-
135- # Install sccache from https://github.com/mozilla/sccache
136- WORKDIR /var/tmp/sccache
137- RUN curl -fsSL https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-x86_64-unknown-linux-musl.tar.gz | \
138- tar -zxf - --strip-components=1 && \
139- mkdir -p /usr/local/bin && \
140- mv sccache /usr/local/bin/sccache && \
141- chmod +x /usr/local/bin/sccache
142-
143- # Needed to use autoreconf
144- WORKDIR /var/tmp/m4
145- RUN curl -fsSL https://ftp.gnu.org/gnu/m4/m4-1.4.1.tar.gz | \
146- tar -zxf - --strip-components=1 && \
147- ./configure --enable-gui=no && \
148- make && \
149- make install -j "$(nproc)"
150-
15185# Install the Cloud SDK
15286COPY ./dependencies/cloud-sdk.sh /var/tmp/ci/dependencies/cloud-sdk.sh
15387WORKDIR /var/tmp/downloads
0 commit comments