From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../thrift/build/docker/msvc2017/Dockerfile | 103 +++++++++++++++++++++ .../thrift/build/docker/msvc2017/README.md | 50 ++++++++++ .../build/docker/msvc2017/build-compiler.bat | 44 +++++++++ .../thrift/build/docker/msvc2017/build.bat | 45 +++++++++ 4 files changed, 242 insertions(+) create mode 100644 src/jaegertracing/thrift/build/docker/msvc2017/Dockerfile create mode 100644 src/jaegertracing/thrift/build/docker/msvc2017/README.md create mode 100644 src/jaegertracing/thrift/build/docker/msvc2017/build-compiler.bat create mode 100644 src/jaegertracing/thrift/build/docker/msvc2017/build.bat (limited to 'src/jaegertracing/thrift/build/docker/msvc2017') diff --git a/src/jaegertracing/thrift/build/docker/msvc2017/Dockerfile b/src/jaegertracing/thrift/build/docker/msvc2017/Dockerfile new file mode 100644 index 000000000..a2b3cd7e2 --- /dev/null +++ b/src/jaegertracing/thrift/build/docker/msvc2017/Dockerfile @@ -0,0 +1,103 @@ +# escape=` +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM microsoft/dotnet-framework:4.7.1 + +# Restore the default Windows shell for correct batch processing below. +SHELL ["cmd", "/S", "/C"] + +# Install Build Tools excluding workloads and components with known issues. +ADD https://aka.ms/vs/15/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe +RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache ` + --installPath C:\BuildTools ` + --all ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 ` + --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 ` + --remove Microsoft.VisualStudio.Component.Windows81SDK ` + || IF "%ERRORLEVEL%"=="3010" EXIT 0 +RUN DEL C:\TEMP\vs_buildtools.exe + +# Install CMake +ADD https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-win64-x64.msi C:\TEMP\cmake.msi +RUN msiexec.exe /i C:\TEMP\cmake.msi /qn && ` + SETX PATH "%PATH%;C:\Program Files\CMake\bin" && ` + DEL C:\TEMP\cmake.msi + +# Install boost (for the thrift runtime library build) +ADD https://boost.teeks99.com/bin/1.69.0/boost_1_69_0-msvc-14.1-64.exe C:\TEMP\boost.exe +RUN C:\TEMP\boost.exe /DIR="C:\Libraries\boost_1_69_0" /SILENT && ` + DEL C:\TEMP\boost.exe + +# Install chocolatey +RUN @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" ` + -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command ` + "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" ` + && SETX PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + +# Install winflexbison (for the thrift compiler build) +RUN choco install winflexbison3 -y + +# Install 7zip and curl (used by the libevent and zlib build scripts) +RUN choco install 7zip curl -y + +# Install libevent +COPY appveyor\build-libevent.bat C:\TEMP\build-libevent.bat +ENV LIBEVENT_VERSION=2.1.8 +ENV WIN3P=C:\TEMP\WIN3P +RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 && ` + MKDIR C:\TEMP\WIN3P && ` + C:\TEMP\build-libevent.bat && ` + MKDIR C:\Libraries\libevent-%LIBEVENT_VERSION% && ` + MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\include C:\Libraries\libevent-%LIBEVENT_VERSION% && ` + MOVE C:\TEMP\WIN3P\libevent-%LIBEVENT_VERSION%-stable\lib C:\Libraries\libevent-%LIBEVENT_VERSION% && ` + RMDIR /S /Q C:\TEMP\WIN3P + +# Install zlib +COPY appveyor\build-zlib.bat C:\TEMP\build-zlib.bat +ENV ZLIB_VERSION=1.2.11 +ENV WIN3P=C:\TEMP\WIN3P +RUN C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 && ` + MKDIR C:\TEMP\WIN3P && ` + C:\TEMP\build-zlib.bat && ` + MOVE C:\TEMP\WIN3P\zlib-inst C:\Libraries\zlib-%ZLIB_VERSION% && ` + RMDIR /S /Q C:\TEMP\WIN3P + +# Install OpenSSL 1.1.0 +ADD http://slproweb.com/download/Win64OpenSSL-1_1_0j.exe C:\TEMP\openssl.exe +RUN C:\TEMP\openssl.exe /silent && ` + DEL C:\TEMP\openssl.exe + +# Install java +RUN choco install jdk8 -y + +# Install haskell +RUN choco install ghc -y + +# Install python3 +RUN choco install python3 -y + +# Install Adobe Flex 4.6 SDK and set FLEX_HOME so it can be found +ADD http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip C:\Adobe\Flex\SDK\4.6\SDK.zip +RUN CD C:\Adobe\Flex\SDK\4.6 && ` + 7z x SDK.zip && ` + DEL SDK.zip && ` + SETX FLEX_HOME "C:\Adobe\Flex\SDK\4.6" + +# Start developer command prompt with any other commands specified. +ENTRYPOINT C:\BuildTools\Common7\Tools\VsDevCmd.bat -arch=amd64 && + +# Default to PowerShell if no other command specified. +CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/src/jaegertracing/thrift/build/docker/msvc2017/README.md b/src/jaegertracing/thrift/build/docker/msvc2017/README.md new file mode 100644 index 000000000..0c882d747 --- /dev/null +++ b/src/jaegertracing/thrift/build/docker/msvc2017/README.md @@ -0,0 +1,50 @@ +# Building Thrift using Docker for Windows + +The build image is very large (just under 30GB) so plan accordingly. +Once Microsoft supports build tools in nano, it should get better. + +Install Docker for Windows and switch to Windows container mode. + +Pull from docker hub: + + PS C:\> docker pull thrift/thrift-build:msvc2017 + +or build in a docker for windows environment: + + PS C:\Thrift> docker build -t thrift/thrift-build:msvc2017 -f build\docker\msvc2017\Dockerfile build\ + +The following directories are used inside the container: + + C:\Build the out-of-tree build directory + C:\Install the install target directory + C:\Thrift the source tree + +You can override these as docker volumes if desired. + +### Compiler + +To build a portable windows thrift compiler (with a statically linked +runtime) and get it placed into C:\install: + + docker run -v C:\thrift:C:\thrift^ + -v C:\install:C:\install^ + --rm -t thrift/thrift-build:msvc2017^ + C:\thrift\build\docker\msvc2017\build-compiler.bat + +The end result is a portable windows thrift compiler located at + + C:\Install\bin\thrift.exe + +If you run it through the [Dependency Walker](http://www.dependencywalker.com/) +you will see it only depends on KERNEL32.DLL which means the runtime is statically +linked, so the executable is portable and self-contained. This is how the +windows thrift compiler is built for each Apache Thrift release. + +### Libraries + +To build, test everything and get the C++ SDK placed into C:\install: + + docker run -v C:\thrift:C:\thrift^ + -v C:\install:C:\install^ + -m 4096 --rm -t thrift/thrift-build:msvc2017^ + C:\thrift\build\docker\msvc2017\build.bat \ No newline at end of file diff --git a/src/jaegertracing/thrift/build/docker/msvc2017/build-compiler.bat b/src/jaegertracing/thrift/build/docker/msvc2017/build-compiler.bat new file mode 100644 index 000000000..5534428b4 --- /dev/null +++ b/src/jaegertracing/thrift/build/docker/msvc2017/build-compiler.bat @@ -0,0 +1,44 @@ +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: + +:: +:: Build script example for inside the windows docker container +:: +:: C:\build is the out-of-tree build directory +:: C:\install is the location where artifacts are placed +:: C:\thrift is where the sources are +:: + +:: Make and go into the out-of-tree directory +IF NOT EXIST C:\build (MKDIR C:\build) +cd c:\build + +:: Generate the out-of-tree build files +cmake^ + -DBOOST_ROOT=C:\Libraries\boost_1_69_0^ + -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_69_0\lib64-msvc-14.1^ + -DBUILD_LIBRARIES=OFF^ + -DCMAKE_BUILD_TYPE=Release^ + -DCMAKE_INSTALL_PREFIX=C:\install^ + -DWITH_MT=ON^ + c:\thrift || EXIT /B + +:: Build +cmake --build . --target thrift-compiler --config Release || EXIT /B + +:: Test +cmake --build . --target check || EXIT /B + +:: Install +cmake --build . --target install \ No newline at end of file diff --git a/src/jaegertracing/thrift/build/docker/msvc2017/build.bat b/src/jaegertracing/thrift/build/docker/msvc2017/build.bat new file mode 100644 index 000000000..018805bca --- /dev/null +++ b/src/jaegertracing/thrift/build/docker/msvc2017/build.bat @@ -0,0 +1,45 @@ +:: +:: Licensed under the Apache License, Version 2.0 (the "License"); +:: you may not use this file except in compliance with the License. +:: You may obtain a copy of the License at +:: +:: http://www.apache.org/licenses/LICENSE-2.0 +:: +:: Unless required by applicable law or agreed to in writing, software +:: distributed under the License is distributed on an "AS IS" BASIS, +:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +:: See the License for the specific language governing permissions and +:: limitations under the License. +:: + +:: +:: Build script example for inside the windows docker container +:: +:: C:\build is the out-of-tree build directory +:: C:\install is the location where artifacts are placed +:: C:\thrift is where the sources are +:: + +:: Make and go into the out-of-tree directory +IF NOT EXIST C:\build (MKDIR C:\build) +cd c:\build + +:: Generate the out-of-tree build files +cmake^ + -DBOOST_ROOT=C:\Libraries\boost_1_69_0^ + -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_69_0\lib64-msvc-14.1^ + -DFLEX_HOME=C:\Adobe\Flex\SDK\4.6^ + -DLIBEVENT_ROOT=C:\Libraries\libevent-2.1.8^ + -DZLIB_ROOT=C:\Libraries\zlib-1.2.11^ + -DCMAKE_BUILD_TYPE=Release^ + -DCMAKE_INSTALL_PREFIX=C:\install^ + c:\thrift || EXIT /B + +:: Build +cmake --build . --config Release || EXIT /B + +:: Test +cmake --build . --target check || EXIT /B + +:: Install +cmake --build . --target install -- cgit v1.2.3