diff --git a/azure-pipelines/signing.yml b/azure-pipelines/signing.yml index b72a9f9361..3c92d0393f 100644 --- a/azure-pipelines/signing.yml +++ b/azure-pipelines/signing.yml @@ -24,10 +24,6 @@ variables: - group: vcpkg-dependency-source-blobs - name: FMT_TARBALL_URL value: "$(fmt-tarball-url)" - - name: FMT_TARBALL_SHA - value: "$(fmt-tarball-sha)" - - name: FMT_TARBALL_DIRNAME - value: "$(fmt-tarball-dirname)" # If the user didn't override the signing type, then only real-sign on main. - ${{ if ne(parameters.SignTypeOverride, 'default') }}: - name: SignType @@ -189,22 +185,12 @@ jobs: VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ] VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: - - task: CmdLine@2 - displayName: "Download fmt library" - inputs: - failOnStderr: true - workingDirectory: "$(Build.BinariesDirectory)" - script: | - curl -sSL "$FMT_TARBALL_URL" --output ./fmtlib.tar.gz - printf "$FMT_TARBALL_SHA *./fmtlib.tar.gz\n" >checksum - shasum -c ./checksum -a 512 || exit 1 - tar -xf ./fmtlib.tar.gz - task: CmdLine@2 displayName: "Build vcpkg with CMake" 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" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build" + 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_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build" make -j 8 -C "$(Build.BinariesDirectory)/build" zip -j "$(Build.ArtifactStagingDirectory)/vcpkg-macos.zip" "$(Build.BinariesDirectory)/build/vcpkg" - task: PublishBuildArtifacts@1 @@ -223,23 +209,12 @@ jobs: VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ] VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: - - task: CmdLine@2 - displayName: "Download fmt library" - inputs: - failOnStderr: true - workingDirectory: "$(Build.BinariesDirectory)" - script: | - curl -sSL "$FMT_TARBALL_URL" --output "./fmtlib.tar.gz" - printf "$FMT_TARBALL_SHA *./fmtlib.tar.gz\n" >checksum - # shasum doesn't exist on rhel - sha512sum -c ./checksum || exit 1 - tar -xf ./fmtlib.tar.gz - task: CmdLine@2 displayName: "Build vcpkg with CMake" inputs: failOnStderr: true 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++" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" -DVCPKG_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"' + 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_BASE_VERSION=$VCPKG_BASE_VERSION -DVCPKG_STANDALONE_BUNDLE_SHA=$VCPKG_STANDALONE_BUNDLE_SHA -DVCPKG_CE_SHA=$VCPKG_CE_SHA -B "$(Build.BinariesDirectory)/build"' make -j 4 -C "$(Build.BinariesDirectory)/build" mv "$(Build.BinariesDirectory)/build/vcpkg" "$(Build.ArtifactStagingDirectory)/vcpkg-glibc" - task: PublishBuildArtifacts@1 @@ -258,23 +233,12 @@ jobs: VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ] VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: - - task: CmdLine@2 - displayName: "Download fmt library" - inputs: - failOnStderr: true - workingDirectory: "$(Build.BinariesDirectory)" - script: | - curl -sSL "$FMT_TARBALL_URL" --output "./fmtlib.tar.gz" - printf "$FMT_TARBALL_SHA *./fmtlib.tar.gz\n" >checksum - shasum -c ./checksum -a 512 || exit 1 - tar -xf ./fmtlib.tar.gz - task: CmdLine@2 displayName: "Build vcpkg in Alpine" inputs: failOnStderr: true script: | - mv "$(Build.BinariesDirectory)/$FMT_TARBALL_DIRNAME" external-fmtlib - docker build -t vcpkg-muslc-image -f azure-pipelines/vcpkg-alpine/Dockerfile . + docker build --build-arg "VCPKG_FMT_URL=$FMT_TARBALL_URL" -t vcpkg-muslc-image -f azure-pipelines/vcpkg-alpine/Dockerfile . docker create -ti --name vcpkg-muslc-container vcpkg-muslc-image sh docker cp vcpkg-muslc-container:/build/vcpkg "$(Build.ArtifactStagingDirectory)/vcpkg-muslc" docker container rm vcpkg-muslc-container @@ -298,22 +262,6 @@ jobs: VCPKG_CE_SHA: $[ dependencies.arch_independent.outputs['shas.VCPKG_CE_SHA'] ] VCPKG_BASE_VERSION: $[ dependencies.arch_independent.outputs['versions.VCPKG_BASE_VERSION'] ] steps: - - task: PowerShell@2 - displayName: "Download fmt library" - inputs: - targetType: 'inline' - pwsh: true - failOnStderr: true - workingDirectory: "$(Build.BinariesDirectory)" - script: | - curl.exe -sSL "$env:FMT_TARBALL_URL" --output ./fmtlib.tar.gz - $hash = (Get-FileHash -Algorithm SHA512 -Path ./fmtlib.tar.gz).Hash - if ($hash -ne "$env:FMT_TARBALL_SHA") { - throw "Unexpected hash for fmtlib download; - expected: $env:FMT_TARBALL_SHA - found : $hash" - } - tar.exe -xf ./fmtlib.tar.gz - task: CmdLine@2 displayName: "Build vcpkg x86 with CMake" inputs: @@ -321,7 +269,7 @@ jobs: script: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x86 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 -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\x86" + 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_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\x86" ninja.exe -C "$(Build.BinariesDirectory)\x86" - task: CmdLine@2 displayName: "Build vcpkg arm64 with CMake" @@ -330,7 +278,7 @@ jobs: script: | call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=x86 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" -DFETCHCONTENT_FULLY_DISCONNECTED=ON "-DFETCHCONTENT_SOURCE_DIR_FMT=$(Build.BinariesDirectory)\%FMT_TARBALL_DIRNAME%" -DVCPKG_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_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_BASE_VERSION=%VCPKG_BASE_VERSION% -DVCPKG_STANDALONE_BUNDLE_SHA=%VCPKG_STANDALONE_BUNDLE_SHA% -DVCPKG_CE_SHA=%VCPKG_CE_SHA% -B "$(Build.BinariesDirectory)\arm64" ninja.exe -C "$(Build.BinariesDirectory)\arm64" - task: MicroBuildSigningPlugin@3 displayName: Install MicroBuild Signing diff --git a/azure-pipelines/vcpkg-alpine/Dockerfile b/azure-pipelines/vcpkg-alpine/Dockerfile index cb82923ec7..e3c7d3717b 100644 --- a/azure-pipelines/vcpkg-alpine/Dockerfile +++ b/azure-pipelines/vcpkg-alpine/Dockerfile @@ -4,6 +4,8 @@ RUN apk add alpine-sdk cmake ninja git curl tar gzip zip COPY . /source -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=OFF -DCMAKE_CXX_FLAGS="-static -s -static-libgcc -static-libstdc++" -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DFETCHCONTENT_SOURCE_DIR_FMT=/source/external-fmtlib -S /source -B /build +ARG VCPKG_FMT_URL + +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=OFF -DCMAKE_CXX_FLAGS="-static -s -static-libgcc -static-libstdc++" "-DVCPKG_FMT_URL=$VCPKG_FMT_URL" -S /source -B /build RUN ninja -C build diff --git a/cmake/Findfmt.cmake b/cmake/Findfmt.cmake index 5af5ed5714..9a188c2656 100644 --- a/cmake/Findfmt.cmake +++ b/cmake/Findfmt.cmake @@ -1,10 +1,11 @@ option(VCPKG_DEPENDENCY_EXTERNAL_FMT "Use an external version of the fmt library" OFF) +set(VCPKG_FMT_URL "https://github.com/fmtlib/fmt/archive/refs/tags/8.1.1.tar.gz" CACHE STRING "URL to the fmt release tarball to use.") include(FetchContent) FetchContent_Declare( fmt - GIT_REPOSITORY https://github.com/fmtlib/fmt - GIT_TAG b6f4ceaed0a0a24ccf575fab6c56dd50ccf6f1a9 # 8.1.1 + URL "${VCPKG_FMT_URL}" + URL_HASH SHA512=794a47d7cb352a2a9f2c050a60a46b002e4157e5ad23e15a5afc668e852b1e1847aeee3cda79e266c789ff79310d792060c94976ceef6352e322d60b94e23189 ) if(NOT fmt_FIND_REQUIRED)