diff options
Diffstat (limited to 'coin')
-rw-r--r-- | coin/instructions/call_cmake.yaml | 24 | ||||
-rw-r--r-- | coin/instructions/cmake_build_and_upload_test_artifacts.yaml | 29 | ||||
-rw-r--r-- | coin/instructions/cmake_cross_compilation.yaml | 58 | ||||
-rw-r--r-- | coin/instructions/cmake_module_build_instructions.yaml | 46 | ||||
-rw-r--r-- | coin/instructions/cmake_qtbase_build_instructions.yaml | 49 | ||||
-rw-r--r-- | coin/instructions/cmake_regular_test_instructions.yaml | 26 | ||||
-rw-r--r-- | coin/instructions/prepare_building_env.yaml | 202 | ||||
-rw-r--r-- | coin/module_config.yaml | 40 |
8 files changed, 474 insertions, 0 deletions
diff --git a/coin/instructions/call_cmake.yaml b/coin/instructions/call_cmake.yaml new file mode 100644 index 0000000000..421a7c2ed1 --- /dev/null +++ b/coin/instructions/call_cmake.yaml @@ -0,0 +1,24 @@ +type: Group +instructions: + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} {{.InstallDir}}\\bin\\qt-cmake {{.Env.COIN_CMAKE_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: ExecuteCommand + command: "{{.InstallDir}}/bin/qt-cmake {{.Env.COIN_CMAKE_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + disable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml new file mode 100644 index 0000000000..59a2f09f0d --- /dev/null +++ b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml @@ -0,0 +1,29 @@ +type: Group +instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: MakeDirectory + directory: "standalone_tests" + - type: SetBuildDirectory + directory: "{{.SourceDir}}/standalone_tests" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "-DQT_BUILD_STANDALONE_TESTS=ON -S {{.SourceDir}} -B ." + - !include "{{qt/qtbase}}/call_cmake.yaml" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: UploadTestArtifact + transferType: UploadModuleTestsArtifact + archiveDirectory: "{{.BuildDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 +disable_if: + condition: property + property: configureArgs + contains_value: "-DBUILD_SHARED_LIBS=OFF" diff --git a/coin/instructions/cmake_cross_compilation.yaml b/coin/instructions/cmake_cross_compilation.yaml new file mode 100644 index 0000000000..2037a4d331 --- /dev/null +++ b/coin/instructions/cmake_cross_compilation.yaml @@ -0,0 +1,58 @@ +type: Group +instructions: + - type: MakeDirectory + directory: .git + - type: MakeDirectory + directory: build + - type: ChangeDirectory + directory: "{{.BuildDir}}/build" + - type: MakeDirectory + directory: host + - type: MakeDirectory + directory: target + - type: SetBuildDirectory + directory: "{{.SourceDir}}/build/host" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/host -DBUILD_TESTING=OFF {{.SourceDir}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. + - type: SetBuildDirectory + directory: "{{.SourceDir}}/build/target" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.TARGET_CONFIGURE_ARGS}} -DQT_HOST_PATH={{.InstallDir}}/host -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/target -DBUILD_TESTING=OFF {{.SourceDir}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. diff --git a/coin/instructions/cmake_module_build_instructions.yaml b/coin/instructions/cmake_module_build_instructions.yaml new file mode 100644 index 0000000000..8a9798a148 --- /dev/null +++ b/coin/instructions/cmake_module_build_instructions.yaml @@ -0,0 +1,46 @@ +type: Group +instructions: + - type: MakeDirectory + directory: .git + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "-DBUILD_TESTING=OFF {{.SourceDir}}" + - !include "{{qt/qtbase}}/call_cmake.yaml" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package for archiving. + - type: SignPackage + enable_if: + condition: property + property: host.os + equals_value: Windows + directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + - type: UploadArtifact + archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/cmake_qtbase_build_instructions.yaml b/coin/instructions/cmake_qtbase_build_instructions.yaml new file mode 100644 index 0000000000..5e6e6e9a5c --- /dev/null +++ b/coin/instructions/cmake_qtbase_build_instructions.yaml @@ -0,0 +1,49 @@ +type: Group +instructions: + - type: MakeDirectory + directory: .git + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DBUILD_TESTING=OFF {{.SourceDir}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. Contact Liang then. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to build sources. In the current state bug can be everywhere. Contact Liang first. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package. + - type: EnvironmentVariable + variableName: DESTDIR + variableValue: "{{.InstallRoot}}" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --install ." + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install package for archiving. + - type: SignPackage + enable_if: + condition: property + property: host.os + equals_value: Windows + directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + - type: UploadArtifact + archiveDirectory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/cmake_regular_test_instructions.yaml b/coin/instructions/cmake_regular_test_instructions.yaml new file mode 100644 index 0000000000..6974b293dd --- /dev/null +++ b/coin/instructions/cmake_regular_test_instructions.yaml @@ -0,0 +1,26 @@ +type: Group +instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: MakeDirectory + directory: "standalone_tests" + - type: InstallTestBinaryArchive + relativeStoragePath: "{{.Env.MODULE_ARTIFACTS_RELATIVE_STORAGE_PATH}}/tests.tar.gz" + directory: "{{.SourceDir}}/standalone_tests" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to install tests archive. + - type: ChangeDirectory + directory: "{{.SourceDir}}/standalone_tests" + - type: ExecuteCommand + command: "ctest -V --rerun-failed" + ignoreExitCode: true + maxTimeInSeconds: 7200 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Failed to run tests. +disable_if: + condition: property + property: configureArgs + contains_value: "-DBUILD_SHARED_LIBS=OFF" diff --git a/coin/instructions/prepare_building_env.yaml b/coin/instructions/prepare_building_env.yaml new file mode 100644 index 0000000000..f862459ba3 --- /dev/null +++ b/coin/instructions/prepare_building_env.yaml @@ -0,0 +1,202 @@ +# Prepares environment for building Qt module. It sets all important environment variables in particular +# configures the right compiler and cmake generator +type: Group +instructions: + + # Set default cmake generator, it may be overwritten later + - type: EnvironmentVariable + variableName: CMAKE_GENERATOR + variableValue: Ninja + + + # Export ICC specific env. variables + - type: Group + instructions: + - type: EnvironmentVariable + variableName: LD_LIBRARY_PATH + variableValue: "{{.Env.ICC64_18_LDLP}}" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.ICC64_18_PATH}}" + enable_if: + condition: property + property: host.compiler + equals_value: ICC_18 + + + # Set CMAKE_C[XX]_COMPILER otherwise cmake may prioritize a wrong compiler + - type: Group + instructions: + - type: PrependToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: "-DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc " + enable_if: + condition: property + property: host.compiler + contains_value: ICC + - type: PrependToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ " + enable_if: + condition: property + property: host.compiler + contains_value: GCC + - type: PrependToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: "-DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe " + enable_if: + condition: property + property: host.compiler + contains_value: MSVC + - type: PrependToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ " + enable_if: + condition: property + property: host.compiler + contains_value: Clang + + + # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation + - type: Group + enable_if: + condition: property + property: host.os + equals_value: Windows + instructions: + - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: amd64 # TODO add something like "{{toLower .Config host.arch}}" + disable_if: + condition: property + property: host.arch + not_equals_property: target.arch + - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: amd64_x86 + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_property: X86 + - condition: property + property: host.arch + equals_property: X86_64 + - type: EnvironmentVariable + # HACK. Overwrite TARGET_ARCHITECTURE as we do not use standard MSVC cross + # compilation targets here. The target architecture will be detected by Qt. + variableName: TARGET_ARCHITECTURE + variableValue: x86 + enable_if: + condition: property + property: target.os + in_values: ["WINRT", "WINPHONE", "WINCE"] + - type: EnvironmentVariable + variableName: WINDOWS_SDK_VERSION + variableValue: "10.0.14393.0" + enable_if: + condition: property + property: target.os + equals_value: WINRT + - type: EnvironmentVariable + variableName: WINDOWS_SDK_VERSION + variableValue: "" + disable_if: + condition: property + property: host.os + equals_value: WINRT # TODO set windows sdk version for desktop windows as well + + + # MSVC is installed in somehow arbitrary places. To reduce amount of combinations we need to make a variable. + # This seems inverted, but on 64 bit hosts VS is installed into the x86 path, otherwise the regular one + # TODO cleanup, that step could be removed if we have same installation paths or we read the path from registry + # or we use compiler specific generator (probably superior solution as it allows to get rid of ENV_PREFIX). + - type: Group + enable_if: + condition: property + property: host.os + equals_value: Windows + instructions: + # Try to pick one of many coexistent MSVC installation to use + # TODO cleanup, that could be much simpler if all tools are installed to similar paths, so it would + # be enough to substitute compiler name. + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%VS90COMNTOOLS%\\vsvars32.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2008 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%VS100COMNTOOLS%\\vsvars32.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2010 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2012 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2013 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2015 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2017\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2017 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2019 + + + # With MSVC we need setup the environment before every subprocess call, the group below creates a script that + # does it. It is enough to prepand it to every call (it is safe to add it even on other OSes) + - type: Group + instructions: + - type: WriteFile + fileContents: "call \"{{.Env.VC_SCRIPT}}\" {{.Env.TARGET_ARCHITECTURE}} {{.Env.WINDOWS_SDK_VERSION}}\r\ncmd /c %*" + filename: c:\\users\\qt\\prefix.bat + fileMode: 420 + maxTimeInSeconds: 20 + maxTimeBetweenOutput: 20 + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: ENV_PREFIX + variableValue: "c:\\users\\qt\\prefix.bat" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: ENV_PREFIX + variableValue: "" + disable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/module_config.yaml b/coin/module_config.yaml new file mode 100644 index 0000000000..ab615583a5 --- /dev/null +++ b/coin/module_config.yaml @@ -0,0 +1,40 @@ +version: 2 +accept_configuration: + condition: property + property: features + not_contains_value: Disable + +instructions: + Build: + - !include "{{qt/qtbase}}/prepare_building_env.yaml" + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_qtbase_build_instructions.yaml" + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" + enable_if: + condition: property + property: host.os + equals_property: target.os + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_cross_compilation.yaml" + disable_if: + condition: property + property: host.os + equals_property: target.os + + Test: + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_regular_test_instructions.yaml" + enable_if: + condition: property + property: host.os + equals_property: target.os + - type: EnvironmentVariable + variableName: Dummy + variableValue: dummy + disable_if: + condition: property + property: host.os + equals_property: target.os |