cederom commented on code in PR #17849:
URL: https://github.com/apache/nuttx/pull/17849#discussion_r2704640276


##########
tools/ci/docker/linux/Dockerfile:
##########
@@ -380,30 +371,64 @@ RUN apt-get update -qq && 
DEBIAN_FRONTEND="noninteractive" TZ=Etc/UTC apt-get in
   zip \
   && rm -rf /var/lib/apt/lists/*
 
-# Set GCC-12 as Default compiler
-RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 && \
-  update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 20 && \
-  update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && \
-  update-alternatives --set cc /usr/bin/gcc && \
-  update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && \
-  update-alternatives --set c++ /usr/bin/g++
+# Add LLVM repository for clang-21 (Targeting Noble)
+# Note: Clang-21 is a snapshot, ensured repo is noble
+RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee 
/etc/apt/trusted.gpg.d/apt.llvm.org.asc
+RUN echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | tee 
/etc/apt/sources.list.d/llvm.list
+RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y 
-qq \
+  clang-21 \
+  clang++-21 \
+  clang-tidy-21 \
+  && rm -rf /var/lib/apt/lists/*
+
+# Set Clang-21 as Default clang compiler
+RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-21 50 && 
\
+  update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-21 
50 && \
+  update-alternatives --install /usr/bin/clang-tidy clang-tidy 
/usr/bin/clang-tidy-21 50
 
-# Configure out base setup for adding python packages
+# Install GCC 14 from Ubuntu packages
+RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y 
-qq \
+  gcc-14 \
+  g++-14 \
+  && rm -rf /var/lib/apt/lists/*
+
+# Remove existing cpp symlinks to avoid circular reference
+RUN rm -f /lib/cpp /usr/bin/cpp /etc/alternatives/cpp
+
+# Set up update-alternatives for GCC 14 and system GCC 13
+RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 && \
+  update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 50 && \
+  update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100 && \
+  update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 50 && \
+  update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-14 100 && \
+  update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-13 50 && \
+  update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-14 100 
&& \
+  update-alternatives --install /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 50 
&& \
+  update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-14 100 
&& \
+  update-alternatives --install /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-13 50 
&& \
+  update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib 
/usr/bin/gcc-ranlib-14 100 && \
+  update-alternatives --install /usr/bin/gcc-ranlib gcc-ranlib 
/usr/bin/gcc-ranlib-13 50 && \
+  update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-14 100 && \
+  update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-13 50 && \
+  update-alternatives --install /usr/bin/gcov-tool gcov-tool 
/usr/bin/gcov-tool-14 100 && \
+  update-alternatives --install /usr/bin/gcov-tool gcov-tool 
/usr/bin/gcov-tool-13 50 && \
+  update-alternatives --install /usr/bin/gcov-dump gcov-dump 
/usr/bin/gcov-dump-14 100 && \
+  update-alternatives --install /usr/bin/gcov-dump gcov-dump 
/usr/bin/gcov-dump-13 50 && \
+  update-alternatives --install /usr/bin/lto-dump lto-dump 
/usr/bin/lto-dump-14 100 && \
+  update-alternatives --install /usr/bin/lto-dump lto-dump 
/usr/bin/lto-dump-13 50
+
+# Configure Python Environment
+# PEP 668 in Ubuntu 24.04 prevents global pip install.
+# We explicitly allow breaking system packages for this CI container.
+ENV PIP_BREAK_SYSTEM_PACKAGES=1

Review Comment:
   i know we save doubled disk space.. but python became self-incompatible.. 
just worried if that won't break the system?
   
   what do you think @lupyuen ? :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to