Files
ladybird/Meta/Azure/Serenity.yml
Andrew Kaster b5c98ede08 Meta: Switch to a SuperBuild that splits host and target builds
Replace the old logic where we would start with a host build, and swap
all the CMake compiler and target variables underneath it to trick
CMake into building for Serenity after we configured and built the Lagom
code generators.

The SuperBuild creates two ExternalProjects, one for Lagom and one for
Serenity. The Serenity project depends on the install stage for the
Lagom build. The SuperBuild also generates a CMakeToolchain file for the
Serenity build to use that replaces the old toolchain file that was only
used for Ports.

To ensure that code generators are rebuilt when core libraries such as
AK and LibCore are modified, developers will need to direct their manual
`ninja` invocations to the SuperBuild's binary directory instead of the
Serenity binary directory.

This commit includes warning coalescing and option style cleanup for the
affected CMakeLists in the Kernel, top level, and runtime support
libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN
with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be
confused by a host clang compiler.
2021-09-15 19:04:52 +04:30

91 lines
2.5 KiB
YAML

parameters:
arch: 'i686'
jobs:
- job: 'Serenity_Clang_${{ parameters.arch }}'
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
variables:
- name: CCACHE_DIR
value: $(Build.SourcesDirectory)/.ccache
pool:
vmImage: ubuntu-20.04
steps:
- template: Setup.yml
parameters:
os: 'Serenity'
- template: Caches.yml
parameters:
arch: '${{ parameters.arch }}'
toolchain: 'clang'
build_directory: 'Build/${{ parameters.arch }}clang'
- script: ./Toolchain/BuildClang.sh
displayName: Build Toolchain
env:
TRY_USE_LOCAL_TOOLCHAIN: 'y'
ARCH: '${{ parameters.arch }}'
- script: |
mkdir -p Build/superbuild
displayName: 'Create Build Directory'
- script: |
cmake -S Meta/CMake/Superbuild -B Build/superbuild -GNinja \
-DSERENITY_ARCH=${{ parameters.arch }} \
-DSERENITY_TOOLCHAIN=Clang \
-DENABLE_UNDEFINED_SANITIZER=ON \
-DENABLE_PCI_IDS_DOWNLOAD=OFF \
-DENABLE_USB_IDS_DOWNLOAD=OFF \
-DCMAKE_C_COMPILER=gcc-10 \
-DCMAKE_CXX_COMPILER=g++-10
displayName: 'Create Build Environment'
workingDirectory: $(Build.SourcesDirectory)
- script: |
cmake --build ./Build/superbuild
displayName: 'Build'
workingDirectory: $(Build.SourcesDirectory)
- script: |
ninja install && ninja image
displayName: 'Create RootFS'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
- script: |
ninja run
echo "##[group]Verify Output File"
mkdir fsmount
sudo mount -t ext2 -o loop,rw _disk_image fsmount
echo "Results: "
sudo cat fsmount/home/anon/test-results.log
echo "##[endgroup]"
if ! sudo grep -q "Failed: 0" fsmount/home/anon/test-results.log
then
echo "##[error]:^( Tests failed, failing job"
exit 1
fi
displayName: 'Test'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
timeoutInMinutes: 60
env:
SERENITY_QEMU_CPU: 'max,vmx=off'
SERENITY_KERNEL_CMDLINE: 'boot_mode=self-test'
SERENITY_RUN: 'ci'
- script: |
[ ! -e debug.log ] || cat debug.log
displayName: 'Print Target Logs'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
condition: failed()
- script: |
ccache -s
displayName: 'Cache Stats'