Skip to content

Commit

Permalink
[workflows] Fix CI for release_14x
Browse files Browse the repository at this point in the history
1. Parameterize Ubuntu20Dockerfile with the branch name. Previously the
   Dockerfile was still creating container images from the hardcoded
   release_13x branch.

2. Update the workaround for MacOS X build failures according to
   actions/runner-images#2274.

3. For debugging purpose, add a -v option to build-llvm-project.sh to enable
   verbose output. The option sets $VERBOSE to an non-empty string which
   forces the CMake-generated Makefile to print every command it runs.

4. Delete the repo-lockdown workflow to eliminate the job which is always
   a no-op for classic-flang-llvm-project.
  • Loading branch information
bryanpkc committed Jul 21, 2022
1 parent c5102dc commit dd852a6
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 33 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/Ubuntu20Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN apt-get install -y software-properties-common && \
apt-get install -f -y llvm-10 clang-10 && \
apt-get install -f -y llvm-11 clang-11

# Install the tools for release_13x
# Install the tools for release_13x and newer
RUN apt --fix-missing update && \
apt install -y build-essential manpages-dev \
libssl-dev zlib1g-dev \
Expand All @@ -51,10 +51,11 @@ RUN ln -s /usr/bin/ninja-build /usr/local/bin/ninja

RUN mkdir /home/github/

ARG BRANCH_NAME
RUN mkdir /home/root && cd home/root && \
git clone --depth 1 --single-branch --branch release_13x https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
git clone --depth 1 --single-branch --branch $BRANCH_NAME https://github.com/flang-compiler/classic-flang-llvm-project.git classic-flang-llvm-project && \
cd classic-flang-llvm-project && \
./build-llvm-project.sh -t AArch64 -p /home/github/usr/local -n `nproc --ignore=1` -a /usr/bin/gcc-10 -b /usr/bin/g++-10 -i
./build-llvm-project.sh -t AArch64 -p /home/github/usr/local -n `nproc --ignore=1` -a /usr/bin/gcc-10 -b /usr/bin/g++-10 -i -v

RUN useradd github && \
chown -R github:github /home/github
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_push_docker_image_Ubuntu20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
cache-to: type=local,dest=/tmp/.buildx-cache-new
tags: ghcr.io/${{ github.repository_owner }}/ubuntu20-flang-${{ steps.extract_branch.outputs.branch }}:latest
platforms: linux/arm64
build-args: |
BRANCH_NAME=${{ steps.extract_branch.outputs.branch }}
# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/flang-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
${{ matrix.cpp }}-${{ matrix.version }} --version
- name: Build and install llvm
run: ./build-llvm-project.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} -n $(nproc) -c -i -s
run: ./build-llvm-project.sh -t ${{ matrix.target }} -p ${{ env.install_prefix }} -a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} -b /usr/bin/${{ matrix.cpp }}-${{ matrix.version }} -n $(nproc) -c -i -s -v

- name: Checkout flang
run: |
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ concurrency:
group: llvm-project-${{ github.workflow }}-${{ inputs.projects}}${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

env:
# Workaround for build faliure on Mac OS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274
CPLUS_INCLUDE_PATH: /usr/local/opt/llvm/include/c++/v1:/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include

jobs:
lit-tests:
name: Lit Tests
Expand All @@ -35,7 +31,7 @@ jobs:
target: [X86]
os:
- ubuntu-latest
# Use a specific version of macOS to ensure the CPLUS_INCLUDE_PATH workaround works.
# Use a specific version of macOS to ensure the MacOSX.sdk workaround works.
- macOS-10.15
steps:
- name: Setup Windows
Expand All @@ -52,15 +48,22 @@ jobs:
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.os }}
# Workaround for build faliure on MacOS X: llvm.org/PR46190, https://github.com/actions/virtual-environments/issues/2274
- name: Override the MacOS.sdk symlink
if: ${{ matrix.os == 'macOS-10.15'}}
run: |
sudo rm /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
sudo rm -rf /Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk
sudo ln -sf MacOSX10.15.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
- name: Test clang macOS
if: ${{ matrix.os == 'macOS-10.15'}}
run: |
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i
./build-llvm-project.sh -t X86 -e "clang" -p /usr/local -s -n $(sysctl -n hw.logicalcpu) -i -v
cd build
make check-all
- name: Test clang ubuntu
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i
./build-llvm-project.sh -t X86 -e "${{ inputs.projects }}" -p /usr/local -s -n $(nproc) -i -v
cd build
make check-all
3 changes: 2 additions & 1 deletion .github/workflows/pre-compile_llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ jobs:
-p /usr/local \
-a /usr/bin/${{ matrix.cc }}-${{ matrix.version }} \
-b /usr/bin/${{env.cpp}}-${{ matrix.version }} \
-n $(nproc)
-n $(nproc) \
-v
# Archive the source + build directories for future installation
cd ..
tar -zcf llvm_build.tar.gz classic-flang-llvm-project
Expand Down
19 changes: 0 additions & 19 deletions .github/workflows/repo-lockdown.yml

This file was deleted.

11 changes: 9 additions & 2 deletions build-llvm-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ USE_SUDO="0"
C_COMPILER_PATH="/usr/bin/gcc"
CXX_COMPILER_PATH="/usr/bin/g++"
LLVM_ENABLE_PROJECTS="clang;openmp"
VERBOSE=""

set -e # Exit script on first error.

Expand All @@ -36,8 +37,9 @@ function print_usage {
echo " -a C compiler path. Default: /usr/bin/gcc";
echo " -b C++ compiler path. Default: /usr/bin/g++";
echo " -e List of the LLVM sub-projects to build. Default: clang;openmp";
echo " -v Enable verbose output";
}
while getopts "t:d:p:n:c?i?s?a:b:e:" opt; do
while getopts "t:d:p:n:c?i?s?a:b:e:v" opt; do
case "$opt" in
t) TARGET=$OPTARG;;
d) BUILD_TYPE=$OPTARG;;
Expand All @@ -49,6 +51,7 @@ while getopts "t:d:p:n:c?i?s?a:b:e:" opt; do
a) C_COMPILER_PATH=$OPTARG;;
b) CXX_COMPILER_PATH=$OPTARG;;
e) LLVM_ENABLE_PROJECTS=$OPTARG;;
v) VERBOSE="1";;
?) print_usage; exit 0;;
esac
done
Expand All @@ -72,8 +75,12 @@ fi

# Build and install
mkdir -p build && cd build
if [ -n "$VERBOSE" ]; then
set -x
fi
cmake $CMAKE_OPTIONS -DLLVM_ENABLE_PROJECTS=$LLVM_ENABLE_PROJECTS ../llvm
make -j$NPROC
set +x
make -j$NPROC VERBOSE=$VERBOSE
if [ $DO_INSTALL == "1" ]; then
if [ $USE_SUDO == "1" ]; then
echo "Install with sudo"
Expand Down

0 comments on commit dd852a6

Please sign in to comment.