Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Use GCC compilers from compiler explorer #97218

Closed

Conversation

philnik777
Copy link
Contributor

@philnik777 philnik777 commented Jun 30, 2024

This avoids the very recent system requirements for new GCC versions, making it a lot easier to update GCC in a timely manner.

@philnik777 philnik777 requested a review from a team as a code owner June 30, 2024 15:32
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jun 30, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 30, 2024

@llvm/pr-subscribers-libcxx

Author: Nikolas Klauser (philnik777)

Changes

This avoids the very recent system requirements for new GCC versions, making it a lot easier to update GCC in a timely matter.


Full diff: https://github.com/llvm/llvm-project/pull/97218.diff

1 Files Affected:

  • (modified) libcxx/utils/ci/Dockerfile (+10-8)
diff --git a/libcxx/utils/ci/Dockerfile b/libcxx/utils/ci/Dockerfile
index 234b0b5873eb6..9e1865ee61fdf 100644
--- a/libcxx/utils/ci/Dockerfile
+++ b/libcxx/utils/ci/Dockerfile
@@ -99,9 +99,9 @@ RUN sudo apt-get update \
         unzip \
         uuid-dev \
         wget \
+        xz-utils \
     && sudo rm -rf /var/lib/apt/lists/*
 
-
 # Install various tools used by the build or the test suite
 #RUN apt-get update && apt-get install -y ninja-build python3 python3-distutils python3-psutil git gdb ccache
 # TODO add ninja-build once 1.11 is available in Ubuntu, also remove the manual installation.
@@ -142,13 +142,15 @@ EOF
 
 # Install the most recent GCC, like clang install the previous version as a transition.
 RUN <<EOF
-  sudo apt-get update
-  sudo apt-get install -y \
-    gcc-$((GCC_LATEST_VERSION - 1)) \
-    g++-$((GCC_LATEST_VERSION - 1)) \
-    gcc-$GCC_LATEST_VERSION \
-    g++-$GCC_LATEST_VERSION
-  sudo rm -rf /var/lib/apt/lists/*
+  sudo git clone https://github.com/compiler-explorer/infra.git /tmp/ce-infra
+  (cd /tmp/ce-infra && sudo make ce)
+  sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $GCC_LATEST_VERSION.1.0
+  sudo /tmp/ce-infra/bin/ce_install install compilers/c++/x86/gcc $((GCC_LATEST_VERSION - 1)).1.0
+  sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/gcc /usr/bin/gcc-$GCC_LATEST_VERSION
+  sudo ln -s /opt/compiler-explorer/gcc-$GCC_LATEST_VERSION.1.0/bin/g++ /usr/bin/g++-$GCC_LATEST_VERSION
+  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/gcc /usr/bin/gcc-$((GCC_LATEST_VERSION - 1))
+  sudo ln -s /opt/compiler-explorer/gcc-$((GCC_LATEST_VERSION - 1)).1.0/bin/g++ /usr/bin/g++-$((GCC_LATEST_VERSION - 1))
+  sudo rm -rf /tmp/ce-infra
 EOF
 
 RUN <<EOF

@philnik777 philnik777 closed this Jun 30, 2024
@philnik777 philnik777 deleted the users/philnik777/use_ce_compilers branch September 25, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants