diff --git a/CMakeLists.txt b/CMakeLists.txt index f3a7ebec12..960e2b06ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,23 +54,27 @@ if(MSVC AND NOT COMMAND target_precompile_headers) endif() if(VCPKG_EMBED_GIT_SHA) - find_package(Git REQUIRED) - execute_process( - COMMAND "${GIT_EXECUTABLE}" status --porcelain=v1 - WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - OUTPUT_VARIABLE VCPKG_GIT_STATUS - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - if(VCPKG_GIT_STATUS STREQUAL "") + if(DEFINED VCPKG_VERSION) + message(STATUS "Using supplied version SHA ${VCPKG_VERSION}.") + else() + find_package(Git REQUIRED) execute_process( - COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD + COMMAND "${GIT_EXECUTABLE}" status --porcelain=v1 WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - OUTPUT_VARIABLE VCPKG_VERSION + OUTPUT_VARIABLE VCPKG_GIT_STATUS OUTPUT_STRIP_TRAILING_WHITESPACE ) - else() - message(WARNING "Skipping embedding SHA due to local changes.") + + if(VCPKG_GIT_STATUS STREQUAL "") + execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD + WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" + OUTPUT_VARIABLE VCPKG_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + else() + message(WARNING "Skipping embedding SHA due to local changes.") + endif() endif() endif() diff --git a/azure-pipelines/signing.yml b/azure-pipelines/signing.yml index cc8ea6b9d0..79325903ae 100644 --- a/azure-pipelines/signing.yml +++ b/azure-pipelines/signing.yml @@ -24,6 +24,7 @@ parameters: values: - 'GitHub and NuGet' - 'NuGet Only' + - 'None' variables: - group: vcpkg Terrapin URLs - name: TeamName @@ -201,7 +202,7 @@ jobs: inputs: failOnStderr: true script: | - cmake -DCMAKE_CXX_COMPILER=clang++ -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_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" -B "$(Build.BinariesDirectory)/build" 2>&1 + cmake -DCMAKE_CXX_COMPILER=clang++ -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_OSX_DEPLOYMENT_TARGET=10.13 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_VERSION=$(Build.SourceVersion)" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" -B "$(Build.BinariesDirectory)/build" 2>&1 make -j 8 -C "$(Build.BinariesDirectory)/build" zip -j "$(Build.ArtifactStagingDirectory)/vcpkg-macos.zip" "$(Build.BinariesDirectory)/build/vcpkg" - task: PublishBuildArtifacts@1 @@ -209,24 +210,28 @@ jobs: inputs: ArtifactName: 'staging' publishLocation: 'Container' - - job: rhel_build - displayName: 'glibc (RHEL) Build' + - job: glibc_build + displayName: 'glibc Build' dependsOn: - arch_independent pool: - name: 'vcpkg-rhel-7-5' + name: 'vcpkg-mariner-1espt' variables: VCPKG_STANDALONE_BUNDLE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_STANDALONE_BUNDLE_SHA'] ] VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: + - bash: | + az login --identity --username 29a4d3e7-c7d5-41c7-b5a0-fee8cf466371 + az acr login --name vcpkgdockercontainers + displayName: 'Set up managed identity' - task: CmdLine@2 - displayName: "Build vcpkg with CMake" + displayName: "Build vcpkg in Mariner with Ubuntu 16.04 Libraries" inputs: - failOnStderr: true + failOnStderr: false script: | - scl enable devtoolset-9 'cmake3 -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-libgcc -static-libstdc++" "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION" "-DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA" -B "$(Build.BinariesDirectory)/build"' 2>&1 - make -j 4 -C "$(Build.BinariesDirectory)/build" - mv "$(Build.BinariesDirectory)/build/vcpkg" "$(Build.ArtifactStagingDirectory)/vcpkg-glibc" + mkdir -p "$(Agent.TempDirectory)/build" + docker run --rm --mount "type=bind,source=$(Build.Repository.LocalPath),target=/source,readonly" --mount "type=bind,source=$(Agent.TempDirectory)/build,target=/build" vcpkgdockercontainers.azurecr.io/vcpkg/vcpkg-linux:2024-03-21 sh -c "cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=/source/azure-pipelines/vcpkg-linux/toolchain.cmake -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 -DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url) -DVCPKG_FMT_URL=$(fmt-tarball-url) -DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA) -DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION) -DVCPKG_VERSION=$(Build.SourceVersion) -S /source -B /build 2>&1 && ninja -C /build" + mv "$(Agent.TempDirectory)/build/vcpkg" "$(Build.ArtifactStagingDirectory)/vcpkg-glibc" - task: PublishBuildArtifacts@1 displayName: "Publish Unsigned glibc Binary" inputs: @@ -235,7 +240,7 @@ jobs: - job: muslc_build displayName: 'muslc (Alpine) Build' pool: - name: 'vcpkg-mariner-docker-gen1' + name: 'vcpkg-mariner-1espt' dependsOn: - arch_independent variables: @@ -243,7 +248,7 @@ jobs: VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: - bash: | - az login --identity + az login --identity --username 29a4d3e7-c7d5-41c7-b5a0-fee8cf466371 az acr login --name vcpkgdockercontainers displayName: 'Set up managed identity' - task: CmdLine@2 @@ -251,9 +256,9 @@ jobs: inputs: failOnStderr: false script: | - docker build --build-arg "FMT_TARBALL_URL=$(fmt-tarball-url)" --build-arg "CMAKERC_TARBALL_URL=$(cmakerc-tarball-url)" --build-arg "VCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA)" --build-arg "VCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION)" -t vcpkg-muslc-image -f azure-pipelines/vcpkg-alpine/Dockerfile . || exit 1 - docker create -ti --name vcpkg-muslc-container vcpkg-muslc-image sh || exit 1 - docker cp vcpkg-muslc-container:/build/vcpkg "$(Build.ArtifactStagingDirectory)/vcpkg-muslc" || exit 1 + mkdir -p "$(Agent.TempDirectory)/build" + docker run --rm --mount "type=bind,source=$(Build.Repository.LocalPath),target=/source,readonly" --mount "type=bind,source=$(Agent.TempDirectory)/build,target=/build" vcpkgdockercontainers.azurecr.io/vcpkg/vcpkg-alpine:3.16 sh -c "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_CMAKERC_URL=$(cmakerc-tarball-url) -DVCPKG_FMT_URL=$(fmt-tarball-url) -DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA) -DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION) -DVCPKG_VERSION=$(Build.SourceVersion) -S /source -B /build 2>&1 && ninja -C /build" + mv "$(Agent.TempDirectory)/build/vcpkg" "$(Build.ArtifactStagingDirectory)/vcpkg-muslc" - task: PublishBuildArtifacts@1 displayName: "Publish Unsigned muslc Binary" inputs: @@ -265,7 +270,7 @@ jobs: dependsOn: - arch_independent - macos_build - - rhel_build + - glibc_build - muslc_build pool: name: 'VSEngSS-MicroBuild2022-1ES' @@ -285,7 +290,7 @@ jobs: script: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 cmake.exe --version - cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION)" "-DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA)" -B "$(Build.BinariesDirectory)\amd64" + cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION)" "-DVCPKG_VERSION=$(Build.SourceVersion)" "-DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA)" -B "$(Build.BinariesDirectory)\amd64" ninja.exe -C "$(Build.BinariesDirectory)\amd64" - task: CmdLine@2 displayName: "Build vcpkg arm64 with CMake" @@ -294,7 +299,7 @@ jobs: script: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=amd64 cmake.exe --version - cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DVCPKG_PDB_SUFFIX="-arm64" "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION)" "-DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA)" -B "$(Build.BinariesDirectory)\arm64" + cmake.exe -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=ON -DVCPKG_WARNINGS_AS_ERRORS=ON -DVCPKG_BUILD_FUZZING=OFF -DVCPKG_BUILD_TLS12_DOWNLOADER=ON -DVCPKG_EMBED_GIT_SHA=ON -DVCPKG_OFFICIAL_BUILD=ON -DVCPKG_PDB_SUFFIX="-arm64" "-DVCPKG_FMT_URL=$(fmt-tarball-url)" "-DVCPKG_CMAKERC_URL=$(cmakerc-tarball-url)" "-DVCPKG_BASE_VERSION=$(VCPKG_BASE_VERSION)" "-DVCPKG_VERSION=$(Build.SourceVersion)" "-DVCPKG_STANDALONE_BUNDLE_SHA=$(VCPKG_STANDALONE_BUNDLE_SHA)" -B "$(Build.BinariesDirectory)\arm64" ninja.exe -C "$(Build.BinariesDirectory)\arm64" - task: CodeQL3000Finalize@0 displayName: 'CodeQL Finalize' @@ -471,21 +476,23 @@ jobs: ArtifactName: 'Drop' publishLocation: 'Container' # Publish everything to VS Insertion - - task: NuGetCommand@2 - displayName: 'NuGet publish for VS Insertion' - condition: and(eq(variables.SignType, 'real'), succeeded()) - inputs: - command: push - packagesToPush: '$(Build.ArtifactStagingDirectory)/vs-insertion/drop/VS.Redist.Vcpkg.amd64.1.0.0-$(VCPKG_FULL_VERSION).nupkg' - publishVstsFeed: '97a41293-2972-4f48-8c0e-05493ae82010' + - ${{ if or(eq(parameters.PublishTo, 'GitHub and NuGet'),eq(parameters.PublishTo, 'NuGet Only')) }}: + - task: NuGetCommand@2 + displayName: 'NuGet publish for VS Insertion' + condition: and(eq(variables.SignType, 'real'), succeeded()) + inputs: + command: push + packagesToPush: '$(Build.ArtifactStagingDirectory)/vs-insertion/drop/VS.Redist.Vcpkg.amd64.1.0.0-$(VCPKG_FULL_VERSION).nupkg' + publishVstsFeed: '97a41293-2972-4f48-8c0e-05493ae82010' # Publish symbols - - task: MicroBuildArchiveSymbols@4 - displayName: 'Upload Symbols' - inputs: - SymbolsFeatureName: 'vcpkg' - SymbolsProject: 'VS' - SymbolsAgentPath: '$(Build.ArtifactStagingDirectory)\symbols' - azureSubscription: 'Symbols Upload (DevDiv)' + - ${{ if ne(parameters.PublishTo, 'None') }}: + - task: MicroBuildArchiveSymbols@4 + displayName: 'Upload Symbols' + inputs: + SymbolsFeatureName: 'vcpkg' + SymbolsProject: 'VS' + SymbolsAgentPath: '$(Build.ArtifactStagingDirectory)\symbols' + azureSubscription: 'Symbols Upload (DevDiv)' # Publish everything to a GitHub Release - ${{ if eq(parameters.PublishTo, 'GitHub and NuGet') }}: - task: DownloadSecureFile@1 diff --git a/azure-pipelines/vcpkg-alpine/Dockerfile b/azure-pipelines/vcpkg-alpine/Dockerfile index 514997424d..c8d127b014 100644 --- a/azure-pipelines/vcpkg-alpine/Dockerfile +++ b/azure-pipelines/vcpkg-alpine/Dockerfile @@ -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 diff --git a/azure-pipelines/vcpkg-linux/Dockerfile b/azure-pipelines/vcpkg-linux/Dockerfile new file mode 100644 index 0000000000..5dab74283d --- /dev/null +++ b/azure-pipelines/vcpkg-linux/Dockerfile @@ -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 diff --git a/azure-pipelines/vcpkg-linux/sources.list b/azure-pipelines/vcpkg-linux/sources.list new file mode 100644 index 0000000000..bde48550c0 --- /dev/null +++ b/azure-pipelines/vcpkg-linux/sources.list @@ -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 diff --git a/azure-pipelines/vcpkg-linux/toolchain.cmake b/azure-pipelines/vcpkg-linux/toolchain.cmake new file mode 100644 index 0000000000..98ba9a46aa --- /dev/null +++ b/azure-pipelines/vcpkg-linux/toolchain.cmake @@ -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) diff --git a/azure-pipelines/vcpkg-rhel-7-5.json b/azure-pipelines/vcpkg-rhel-7-5.json deleted file mode 100644 index 2ba80175f6..0000000000 --- a/azure-pipelines/vcpkg-rhel-7-5.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "imageType": "Managed", - "baseImage": "/RedHat/RHEL/75-gen2/latest", - "artifacts": [ - { - "name": "linux-centos-yum-packages", - "parameters": { - "packages": "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm" - } - }, - { - "name": "linux-centos7-install-git" - }, - { - "name": "linux-centos-yum-packages", - "parameters": { - "packages": "devtoolset-9-toolchain cmake3" - } - } - ], - "publishingProfile": { - "targetRegions": [ - { - "name": "southcentralus", - "replicas": 1 - } - ] - } -} diff --git a/azure-pipelines/vcpkg-ubuntu-20-04-docker.json b/azure-pipelines/vcpkg-ubuntu-20-04-docker.json deleted file mode 100644 index 945e24c213..0000000000 --- a/azure-pipelines/vcpkg-ubuntu-20-04-docker.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "imageType": "Managed", - "baseImage": "/Canonical/0001-com-ubuntu-server-focal/20_04-lts-gen2/latest", - "artifacts": [ - { - "name": "linux-install-docker" - } - ], - "publishingProfile": { - "targetRegions": [ - { - "name": "westus2", - "replicas": 1 - } - ] - } -}