-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace RHEL 7 with CBL-Mariner (#1373)
- Loading branch information
1 parent
de85ec9
commit c729404
Showing
8 changed files
with
154 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
FROM vcpkgdockercontainers.azurecr.io/vcpkg/alpine:3.11 | ||
FROM vcpkgdockercontainers.azurecr.io/vcpkg/alpine:3.16 | ||
|
||
RUN apk add alpine-sdk cmake ninja git curl tar gzip zip | ||
|
||
COPY . /source | ||
|
||
ARG FMT_TARBALL_URL | ||
|
||
ARG CMAKERC_TARBALL_URL | ||
|
||
ARG VCPKG_BASE_VERSION | ||
|
||
ARG VCPKG_STANDALONE_BUNDLE_SHA | ||
|
||
RUN cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DCMAKE_CXX_FLAGS="-static -s -static-libgcc -static-libstdc++" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" "-DVCPKG_FMT_URL=$FMT_TARBALL_URL" "-DVCPKG_CMAKERC_URL=$CMAKERC_TARBALL_URL" -S /source -B /build 2>&1 | ||
|
||
RUN ninja -C build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This infrastructure is adapted from that the .NET team uses, see | ||
# https://github.com/dotnet/dotnet-buildtools-prereqs-docker | ||
# and | ||
# https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/linux-instructions.md | ||
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 | ||
|
||
RUN tdnf install -y \ | ||
# Common utilities | ||
ca-certificates \ | ||
git \ | ||
tar \ | ||
curl \ | ||
# Build tools | ||
binutils \ | ||
cmake \ | ||
ninja-build \ | ||
# Rootfs build dependencies | ||
bzip2-devel \ | ||
debootstrap \ | ||
libarchive-devel \ | ||
openssl-devel | ||
|
||
# Obtain ubuntu package signing key (for use by debootstrap) | ||
# 1. Download the ubuntu keyrings | ||
RUN curl -L -o ubuntu-keyring_2021.03.26.tar.gz https://mirrors.edge.kernel.org/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2021.03.26.tar.gz && \ | ||
# 2. Check that they have the correct SHA | ||
echo "492eed5c06408c6f632577adb0796130af5d6542013ef418f47187a209e49bb1 ubuntu-keyring_2021.03.26.tar.gz" | sha256sum -c && \ | ||
tar xf ubuntu-keyring_2021.03.26.tar.gz && \ | ||
rm ubuntu-keyring_2021.03.26.tar.gz && \ | ||
# 3. Install the needed keyring and delete the rest | ||
pushd ubuntu-keyring-2021.03.26 && \ | ||
mkdir -p /usr/share/keyrings && \ | ||
mv keyrings/ubuntu-archive-keyring.gpg /usr/share/keyrings && \ | ||
popd && \ | ||
rm -r ubuntu-keyring-2021.03.26 | ||
|
||
# Build the 'crossrootfs' | ||
# Note that we only need libstdc++-9-dev rather than all of g++-9, but choosing g++-9 | ||
# gets other optional dependencies to agree with g++-9 rather than older gccs | ||
RUN debootstrap "--variant=minbase" --force-check-gpg --arch amd64 xenial /crossrootfs/x64 http://archive.ubuntu.com/ubuntu/ | ||
COPY sources.list . | ||
RUN chroot /crossrootfs/x64 apt-get clean && \ | ||
cp /etc/resolv.conf /crossrootfs/x64/etc/resolv.conf && \ | ||
cp sources.list /crossrootfs/x64/etc/apt/sources.list && \ | ||
chroot /crossrootfs/x64 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F && \ | ||
chroot /crossrootfs/x64 apt-get update -o Acquire::CompressionTypes::Order::=gz | ||
|
||
# Repeated runs of apt-get install workaround 'hash sum mismatch' errors | ||
# (This is also why these are a separate cache layer) | ||
RUN chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" || \ | ||
chroot /crossrootfs/x64 apt-get install -y build-essential symlinks "g++-9" && \ | ||
chroot /crossrootfs/x64 symlinks -cr /usr && \ | ||
chroot /crossrootfs/x64 apt-get clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
deb http://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu xenial main | ||
deb-src http://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu xenial main | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial main restricted universe | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-backports main restricted | ||
|
||
deb http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse | ||
deb-src http://archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set(CMAKE_SYSTEM_NAME Linux) | ||
set(LINUX 1) | ||
set(CMAKE_SYSTEM_VERSION 1) | ||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
set(CMAKE_SYSROOT "/crossrootfs/x64") | ||
set(C_HEADER_ARGS "-B/crossrootfs/x64/usr/lib/x86_64-linux-gnu/ -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include-fixed -isystem /crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/include -isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu -isystem /crossrootfs/x64/usr/include") | ||
set(CMAKE_C_FLAGS_INIT "${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc") | ||
set(CMAKE_CXX_FLAGS_INIT "-isystem /crossrootfs/x64/usr/include/x86_64-linux-gnu/c++/9 -isystem /crossrootfs/x64/usr/include/c++/9 ${C_HEADER_ARGS} -static -s -static-libgcc -nostdinc -static-libstdc++ -L/crossrootfs/x64/usr/lib/gcc/x86_64-linux-gnu/9/") | ||
set(CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
set(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
set(CMAKE_ASM_COMPILER_EXTERNAL_TOOLCHAIN "/crossrootfs/x64/usr") | ||
function(add_toolchain_linker_flag Flag) | ||
set("CMAKE_EXE_LINKER_FLAGS_INIT" "${CMAKE_EXE_LINKER_FLAGS_INIT} ${Flag}" PARENT_SCOPE) | ||
set("CMAKE_SHARED_LINKER_FLAGS_INIT" "${CMAKE_SHARED_LINKER_FLAGS_INIT} ${Flag}" PARENT_SCOPE) | ||
endfunction() | ||
|
||
add_toolchain_linker_flag("-Wl,--rpath-link=/crossrootfs/x64/lib/x86_64-linux-gnu") | ||
add_toolchain_linker_flag("-Wl,--rpath-link=/crossrootfs/x64/usr/lib/x86_64-linux-gnu") | ||
|
||
set(CMAKE_C_COMPILER /usr/bin/gcc) | ||
set(CMAKE_CXX_COMPILER /usr/bin/g++) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.