diff options
Diffstat (limited to 'coin')
52 files changed, 2320 insertions, 210 deletions
diff --git a/coin/axivion/ci_config_linux.json b/coin/axivion/ci_config_linux.json new file mode 100644 index 0000000000..1999760450 --- /dev/null +++ b/coin/axivion/ci_config_linux.json @@ -0,0 +1,43 @@ +{ + "Project": { + "BuildSystemIntegration": { + "child_order": [ + "GCCSetup", + "CMake", + "LinkLibraries" + ] + }, + "CMake": { + "_active": true, + "_copy_from": "CMakeIntegration", + "build_environment": {}, + "build_options": "-j4", + "generate_options": "--fresh", + "generator": "Ninja" + }, + "GCCSetup": { + "_active": true, + "_copy_from": "Command", + "build_command": "gccsetup --cc gcc --cxx g++ --config ../../../axivion/" + }, + "LinkLibraries": { + "_active": true, + "_copy_from": "AxivionLinker", + "input_files": [ + "build/lib/lib*.so*.ir" + ], + "ir": "build/$(env:TESTED_MODULE_COIN).ir", + "plugin_files": [ + "build/plugins/*/lib*.so*.ir" + ] + } + }, + "_Format": "1.0", + "_Version": "7.6.2", + "_VersionNum": [ + 7, + 6, + 2, + 12725 + ] +} diff --git a/coin/instructions/README.md b/coin/instructions/README.md index aaefe3696f..f366642395 100644 --- a/coin/instructions/README.md +++ b/coin/instructions/README.md @@ -18,3 +18,61 @@ the ability to build and run tests for ``qemu`` cross-compiling configurations. * ``coin_module_test_template_v3`` changed the run test instructions to not ignore the exit code and thus enforce that tests pass in the CI. + +# Environment variable description and usage + +The following environment variables are used in Coin instructions when building Qt, tests, etc: + +`CONFIGURE_ARGS` - contains platform-specific ``configure-style`` arguments + (e.g. `-shared`), that will be passed to a qtbase configure call +`CMAKE_ARGS` - contains platform-specific ``CMake-style`` arguments + (e.g. `-DOPENSSL_ROOT_DIR=Foo`) that will be passed to a qtbase + configure call +`NON_QTBASE_CONFIGURE_ARGS` - contains platform-specific ``configure-style`` arguments + that will be passed to a non-qtbase qt-configure-module call +`NON_QTBASE_CMAKE_ARGS` - contains platform-specific ``CMake-style`` arguments + that will be passed to a non-qtbase qt-configure-module call +`COMMON_CMAKE_ARGS` - platform-independent ``CMake-style`` args set in + `prepare_building_env.yaml` that apply to qtbase configurations + only. +`COMMON_NON_QTBASE_CMAKE_ARGS` - platform-independent ``CMake-style`` args set in + `prepare_building_env.yaml` that apply to + configuration of repos other than qtbase +`COMMON_TEST_CMAKE_ARGS` - platform-independent ``CMake-style`` args set in + `prepare_building_env.yaml` that apply to configuration of + all standalone tests + +All of the above apply to host builds only. + +There is a a set of environment variables that apply to target builds when cross-compiling which +mirror the ones above. They are: + +`TARGET_CONFIGURE_ARGS` +`TARGET_CMAKE_ARGS` +`NON_QTBASE_TARGET_CONFIGURE_ARGS` +`NON_QTBASE_TARGET_CMAKE_ARGS` + +`COMMON_TARGET_CMAKE_ARGS` +`COMMON_NON_QTBASE_TARGET_CMAKE_ARGS` +`COMMON_TARGET_TEST_CMAKE_ARGS` + +Currently, there are no common ``configure-style`` variables for configuring +repos or tests, only ``CMake-style` ones. + + +`COIN_CMAKE_ARGS` contains the final set of cmake args that is passed to +`configure` / `qt-configure-module`, it is built up from the variables above + any additional values added +by custom instructions, like specification of `CMAKE_INSTALL_PREFIX` etc. + +`INSTALL_DIR_SUFFIX` is used to append either `/host` or `/target` suffixes to install paths in +instructions when cross-building. + +`CONFIGURE_EXECUTABLE` contains a platform-specific path to `configure` / `qt-configure-module` +or `cmake`/ `qt-cmake` depending on whether `UseConfigure` feature is enabled. + +`CONFIGURE_ENV_PREFIX` contains the value of either `ENV_PREFIX` or `TARGET_ENV_PREFIX` depending on +whether it's a cross-build configure call. The values are used when configuring and building, to ensure +that things like compilers are found correctly. + +We use `unixPathSeparators` to pass an install prefix with forward slashes even on Windows, +to avoid escaping issues when using configure. diff --git a/coin/instructions/call_cmake.yaml b/coin/instructions/call_cmake_for_standalone_examples.yaml index 96227c1f6a..eb811cbea4 100644 --- a/coin/instructions/call_cmake.yaml +++ b/coin/instructions/call_cmake_for_standalone_examples.yaml @@ -1,23 +1,25 @@ type: Group instructions: + - type: ChangeDirectory + directory: "{{.BuildDir}}" - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} {{.InstallDir}}\\bin\\qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" + command: "{{.Env.EXAMPLES_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_EXAMPLES}}\\bin\\qt-internal-configure-examples {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 userMessageOnFailure: > - Failed to call cmake. + Failed to call configure examples. enable_if: condition: property property: host.os equals_value: Windows - type: ExecuteCommand - command: "{{.InstallDir}}/bin/qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" + command: "{{.Env.EXAMPLES_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_EXAMPLES}}/libexec/qt-internal-configure-examples {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 userMessageOnFailure: > - Failed to call cmake. + Failed to call configure examples. disable_if: condition: property property: host.os diff --git a/coin/instructions/call_cmake_for_standalone_tests.yaml b/coin/instructions/call_cmake_for_standalone_tests.yaml index 7ab936cf87..9b7b9ad141 100644 --- a/coin/instructions/call_cmake_for_standalone_tests.yaml +++ b/coin/instructions/call_cmake_for_standalone_tests.yaml @@ -1,18 +1,6 @@ type: Group instructions: - type: ChangeDirectory - directory: "{{.SourceDir}}" - - type: ExecuteCommand - command: "{{.SourceDir}}/util/android/android_cmakelist_patcher.sh" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to patch CMakeLists.txt. - enable_if: - condition: property - property: features - contains_value: AndroidTestRun - - type: ChangeDirectory directory: "{{.BuildDir}}" - type: ExecuteCommand command: "{{.Env.TESTS_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_CMAKE_TESTS}}\\bin\\qt-internal-configure-tests {{.Env.COIN_CMAKE_ARGS}}" @@ -26,7 +14,7 @@ instructions: property: host.os equals_value: Windows - type: ExecuteCommand - command: "{{.Env.TESTS_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_CMAKE_TESTS}}/bin/qt-internal-configure-tests {{.Env.COIN_CMAKE_ARGS}}" + command: "{{.Env.TESTS_ENV_PREFIX}} {{.Env.INSTALL_DIR_FOR_CMAKE_TESTS}}/libexec/qt-internal-configure-tests {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/call_host_cmake.yaml b/coin/instructions/call_configure_module.yaml index 4182f9b622..e3b28503aa 100644 --- a/coin/instructions/call_host_cmake.yaml +++ b/coin/instructions/call_configure_module.yaml @@ -1,7 +1,8 @@ type: Group instructions: + - !include "{{qt/qtbase}}/prepare_configure_module_executable.yaml" - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} {{.InstallDir}}\\host\\bin\\qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" + command: "{{.Env.CONFIGURE_ENV_PREFIX}} {{.Env.CONFIGURE_EXECUTABLE}} {{.SourceDir}} {{.Env.COIN_CONFIGURE_ARGS}} -- {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 @@ -9,10 +10,10 @@ instructions: Failed to call cmake. enable_if: condition: property - property: host.os - equals_value: Windows + property: features + contains_value: UseConfigure - type: ExecuteCommand - command: "{{.InstallDir}}/host/bin/qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" + command: "{{.Env.CONFIGURE_ENV_PREFIX}} {{.Env.CONFIGURE_EXECUTABLE}} {{.SourceDir}} {{.Env.COIN_CONFIGURE_ARGS}} {{.Env.COIN_CMAKE_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 @@ -20,5 +21,5 @@ instructions: Failed to call cmake. disable_if: condition: property - property: host.os - equals_value: Windows + property: features + contains_value: UseConfigure diff --git a/coin/instructions/call_configure_qtbase.yaml b/coin/instructions/call_configure_qtbase.yaml new file mode 100644 index 0000000000..c08d7151ca --- /dev/null +++ b/coin/instructions/call_configure_qtbase.yaml @@ -0,0 +1,27 @@ +type: Group +instructions: + - !include "{{qt/qtbase}}/prepare_configure_executable.yaml" + - type: ExecuteCommand + # There is no SourceDir on purpose, because configure is called directly from qtbase, + # so the script knows it's own source dir. + command: "{{.Env.CONFIGURE_ENV_PREFIX}} {{.Env.CONFIGURE_EXECUTABLE}} {{.Env.COIN_CONFIGURE_ARGS}} -- {{.Env.COIN_CMAKE_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. + enable_if: + condition: property + property: features + contains_value: UseConfigure + - type: ExecuteCommand + command: "{{.Env.CONFIGURE_ENV_PREFIX}} {{.Env.CONFIGURE_EXECUTABLE}} {{.SourceDir}} {{.Env.COIN_CONFIGURE_ARGS}} {{.Env.COIN_CMAKE_ARGS}}" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call cmake. + disable_if: + condition: property + property: features + contains_value: UseConfigure diff --git a/coin/instructions/call_host_install.yaml b/coin/instructions/call_host_install.yaml index 4762763a1e..1d923fa8f5 100644 --- a/coin/instructions/call_host_install.yaml +++ b/coin/instructions/call_host_install.yaml @@ -1,9 +1,24 @@ type: Group instructions: - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_SCRIPT_PATH}}/bin/qt-cmake-private-install.cmake" + command: "{{.Env.ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_BUILD_LIBEXEC_DIR}}{{.Env.CI_PATH_SEP}}qt-cmake-private-install.cmake" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase + userMessageOnFailure: > + Failed to install package. + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_LIBEXEC_DIR}}{{.Env.CI_PATH_SEP}}qt-cmake-private-install.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + disable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase userMessageOnFailure: > Failed to install package. diff --git a/coin/instructions/call_target_cmake.yaml b/coin/instructions/call_target_cmake.yaml deleted file mode 100644 index e8dc7f3f97..0000000000 --- a/coin/instructions/call_target_cmake.yaml +++ /dev/null @@ -1,24 +0,0 @@ -type: Group -instructions: - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} {{.InstallDir}}\\target\\bin\\qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to call cmake. - enable_if: - condition: property - property: host.os - equals_value: Windows - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} {{.InstallDir}}/target/bin/qt-cmake-private {{.Env.COIN_CMAKE_ARGS}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to call cmake. - disable_if: - condition: property - property: host.os - equals_value: Windows diff --git a/coin/instructions/call_target_install.yaml b/coin/instructions/call_target_install.yaml index 0f45240101..f2a7fc10ef 100644 --- a/coin/instructions/call_target_install.yaml +++ b/coin/instructions/call_target_install.yaml @@ -1,9 +1,24 @@ type: Group instructions: - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_SCRIPT_PATH}}/bin/qt-cmake-private-install.cmake" + command: "{{.Env.TARGET_ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_BUILD_LIBEXEC_DIR}}{{.Env.CI_PATH_SEP}}qt-cmake-private-install.cmake" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase + userMessageOnFailure: > + Failed to install package. + - type: ExecuteCommand + command: "{{.Env.TARGET_ENV_PREFIX}} cmake -DQT_BUILD_DIR={{.BuildDir}} -P {{.Env.COIN_CMAKE_INSTALL_LIBEXEC_DIR}}{{.Env.CI_PATH_SEP}}qt-cmake-private-install.cmake" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + disable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + contains_value: qtbase userMessageOnFailure: > Failed to install package. diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml index 84077980b8..7fa663e4d2 100644 --- a/coin/instructions/cmake_build_and_upload_test_artifacts.yaml +++ b/coin/instructions/cmake_build_and_upload_test_artifacts.yaml @@ -10,32 +10,67 @@ instructions: directory: "{{.BuildDir}}" - type: AppendToEnvironmentVariable variableName: COIN_CMAKE_ARGS - variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -S {{.SourceDir}} -B ." + variableValue: " -S {{.SourceDir}} -B ." disable_if: condition: runtime env_var: COIN_CMAKE_ARGS equals_value: null - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - variableValue: "-DCMAKE_AUTOGEN_VERBOSE=ON -S {{.SourceDir}} -B ." + variableValue: "-S {{.SourceDir}} -B ." enable_if: condition: runtime env_var: COIN_CMAKE_ARGS equals_value: null + # Set an informational build environment env var during the an integration's build phase. + # It can be checked during Qt and standalone tests configuration (so configure, + # qt-configure-module and qt-internal-configure-tests time). + # It's currently needed for some CMake autotest iOS-specific decisions, but it could be useful + # for other scenarios as well. + # + # A related QTEST_ENVIRONMENT env var is set during an integration's test phase. + # + # Note that CMake auto tests are configured and built during the /test/ phase, NOT the build + # phase. + # BUT, the options that will be passed to the project cmake invocation in the test phase, are + # decided during the /build/ phase. + - type: EnvironmentVariable + variableName: QT_BUILD_ENVIRONMENT + variableValue: "ci" + + # Inform CMake to build just a minimal set of tests for static Qt builds. + - type: AppendToEnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: " -DQT_BUILD_MINIMAL_STATIC_TESTS=ON" + enable_if: + condition: property + property: features + contains_value: "MinimalStaticTests" + + # Inform CMake to build just a minimal set of tests for Android multi-ABI Qt builds. + - type: AppendToEnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: " -DQT_BUILD_MINIMAL_ANDROID_MULTI_ABI_TESTS=ON" + enable_if: + condition: property + property: features + contains_value: "MinimalAndroidMultiABITests" + - !include "{{qt/qtbase}}/call_cmake_for_standalone_tests.yaml" - type: ExecuteCommand command: "{{.Env.TESTS_ENV_PREFIX}} cmake --build . --parallel -v" maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + maxTimeBetweenOutput: 4800 userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: UploadTestArtifact transferType: UploadModuleTestsArtifact archiveDirectory: "{{.BuildDir}}" maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 -disable_if: - condition: property - property: configureArgs - contains_value: "-DBUILD_SHARED_LIBS=OFF" + # INTEGRITY artifacts aren't used. + disable_if: + condition: property + property: target.osVersion + equals_value: INTEGRITY diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts_host.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts_host.yaml index 847d095da9..bc16368fc2 100644 --- a/coin/instructions/cmake_build_and_upload_test_artifacts_host.yaml +++ b/coin/instructions/cmake_build_and_upload_test_artifacts_host.yaml @@ -10,9 +10,14 @@ instructions: variableValue: "{{.InstallDir}}" - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - variableValue: "{{.Env.TEST_CONFIGURE_ARGS}}" + variableValue: "{{.Env.COMMON_TEST_CMAKE_ARGS}}" - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" disable_if: - condition: property - property: features - contains_value: DisableTests + condition: or + conditions: + - condition: property + property: features + contains_value: DisableTests + - condition: property + property: features + contains_value: DoNotBuildTests diff --git a/coin/instructions/cmake_build_and_upload_test_artifacts_target.yaml b/coin/instructions/cmake_build_and_upload_test_artifacts_target.yaml index b34d408f4a..afc20b98a9 100644 --- a/coin/instructions/cmake_build_and_upload_test_artifacts_target.yaml +++ b/coin/instructions/cmake_build_and_upload_test_artifacts_target.yaml @@ -16,14 +16,29 @@ instructions: variableName: INSTALL_DIR_FOR_CMAKE_TESTS variableValue: "{{.InstallDir}}/target" disable_if: - condition: property - property: host.os - equals_value: Windows + condition: or + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Android_ANY + - condition: property + property: target.arch + equals_value: Multi - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - variableValue: "{{.Env.TARGET_TEST_CONFIGURE_ARGS}}" + variableValue: "{{.Env.COMMON_TARGET_TEST_CMAKE_ARGS}}" - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" disable_if: - condition: property - property: features - contains_value: DisableTests + condition: or + conditions: + - condition: property + property: features + contains_value: DisableTests + - condition: property + property: features + contains_value: DoNotBuildTests diff --git a/coin/instructions/cmake_build_standalone_examples.yaml b/coin/instructions/cmake_build_standalone_examples.yaml new file mode 100644 index 0000000000..ecc0d3a23b --- /dev/null +++ b/coin/instructions/cmake_build_standalone_examples.yaml @@ -0,0 +1,32 @@ +type: Group +instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: MakeDirectory + directory: "{{.SourceDir}}_standalone_examples" + - type: SetBuildDirectory + directory: "{{.SourceDir}}_standalone_examples" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: AppendToEnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: " -S {{.SourceDir}} -B ." + disable_if: + condition: runtime + env_var: COIN_CMAKE_ARGS + equals_value: null + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "-S {{.SourceDir}} -B ." + enable_if: + condition: runtime + env_var: COIN_CMAKE_ARGS + equals_value: null + + - !include "{{qt/qtbase}}/call_cmake_for_standalone_examples.yaml" + - type: ExecuteCommand + command: "{{.Env.EXAMPLES_ENV_PREFIX}} cmake --build . --parallel -v" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 4800 + userMessageOnFailure: > + Failed to build examples. diff --git a/coin/instructions/cmake_build_standalone_examples_host.yaml b/coin/instructions/cmake_build_standalone_examples_host.yaml new file mode 100644 index 0000000000..47f5ea05d3 --- /dev/null +++ b/coin/instructions/cmake_build_standalone_examples_host.yaml @@ -0,0 +1,16 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: EXAMPLES_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - type: EnvironmentVariable + variableName: INSTALL_DIR_FOR_EXAMPLES + variableValue: "{{.InstallDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "{{.Env.COMMON_EXAMPLES_CMAKE_ARGS}}" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples.yaml" +enable_if: + condition: property + property: features + contains_value: StandaloneExamples diff --git a/coin/instructions/cmake_build_standalone_examples_target.yaml b/coin/instructions/cmake_build_standalone_examples_target.yaml new file mode 100644 index 0000000000..faf7300430 --- /dev/null +++ b/coin/instructions/cmake_build_standalone_examples_target.yaml @@ -0,0 +1,30 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: EXAMPLES_ENV_PREFIX + variableValue: "{{.Env.TARGET_ENV_PREFIX}}" + - type: EnvironmentVariable + variableName: INSTALL_DIR_FOR_EXAMPLES + variableValue: "{{.InstallDir}}\\target" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: INSTALL_DIR_FOR_EXAMPLES + variableValue: "{{.InstallDir}}/target" + # TODO: Might need android multi-abi support whenever we decide to build examples for that + # config. See 7b9bb698b93e747e02bf6ab8310c439867318f8e in qtbase and how the instructions + # were modified for multi-abi android tests. + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "{{.Env.COMMON_TARGET_EXAMPLES_CMAKE_ARGS}}" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples.yaml" +enable_if: + condition: property + property: features + contains_value: StandaloneExamples diff --git a/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml b/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml index c6818a128d..a62ab0f48e 100644 --- a/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml +++ b/coin/instructions/cmake_cross_compilation_module_build_instructions.yaml @@ -1,5 +1,19 @@ type: Group instructions: + - type: EnvironmentVariable + variableName: CMAKE_BUILD_TIMEOUT + variableValue: "6000" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_TIMEOUT + equals_value: null + - type: EnvironmentVariable + variableName: CMAKE_BUILD_OUTPUT_TIMEOUT + variableValue: "1200" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_OUTPUT_TIMEOUT + equals_value: null - type: MakeDirectory directory: .git - type: MakeDirectory @@ -16,20 +30,62 @@ instructions: directory: "{{.SourceDir}}/build/host" - type: ChangeDirectory directory: "{{.BuildDir}}" + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}}" - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - # The lack of space between the non qtbase configure args and the rest of the args is important! - variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}" - - !include "{{qt/qtbase}}/call_host_cmake.yaml" + variableValue: "{{.Env.NON_QTBASE_CMAKE_ARGS}} {{.Env.COMMON_NON_QTBASE_CMAKE_ARGS}}" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/prepare_install_dir_suffix_host.yaml" + - !include "{{qt/qtbase}}/call_configure_module.yaml" + - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" + maxTimeInSeconds: "{{.Env.CMAKE_BUILD_TIMEOUT}}" + maxTimeBetweenOutput: "{{.Env.CMAKE_BUILD_OUTPUT_TIMEOUT}}" userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_DIR + variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}host" - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH - variableValue: "{{.InstallDir}}/host" + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_INSTALL_DIR}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}host{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -46,20 +102,62 @@ instructions: directory: "{{.SourceDir}}/build/target" - type: ChangeDirectory directory: "{{.BuildDir}}" + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.NON_QTBASE_TARGET_CONFIGURE_ARGS}}" - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - # The lack of space between the non qtbase configure args and the rest of the args is important! - variableValue: "{{.Env.NON_QTBASE_TARGET_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}" - - !include "{{qt/qtbase}}/call_target_cmake.yaml" + variableValue: "{{.Env.NON_QTBASE_TARGET_CMAKE_ARGS}} {{.Env.COMMON_NON_QTBASE_TARGET_CMAKE_ARGS}}" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.TARGET_ENV_PREFIX}}" + - !include "{{qt/qtbase}}/prepare_install_dir_suffix_target.yaml" + - !include "{{qt/qtbase}}/call_configure_module.yaml" + - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --build . --parallel -v" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" + maxTimeInSeconds: "{{.Env.CMAKE_BUILD_TIMEOUT}}" + maxTimeBetweenOutput: "{{.Env.CMAKE_BUILD_OUTPUT_TIMEOUT}}" userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH - variableValue: "{{.InstallDir}}/target" + variableName: COIN_CMAKE_INSTALL_DIR + variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}target" + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_INSTALL_DIR}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.InstallDir}}{{.Env.CI_PATH_SEP}}target{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -73,3 +171,9 @@ instructions: transferType: UploadModuleBuildArtifact maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 + - type: EnvironmentVariable + variableName: COIN_CONFIG_TYPE + variableValue: "Target" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples_target.yaml" + - !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml" + - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml" diff --git a/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml b/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml index 601e952c71..84dc535b61 100644 --- a/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml +++ b/coin/instructions/cmake_cross_compilation_qtbase_build_instructions.yaml @@ -16,22 +16,62 @@ instructions: directory: "{{.SourceDir}}/build/host" - type: ChangeDirectory directory: "{{.BuildDir}}" + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.CONFIGURE_ARGS}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + # Use unix separators even on Windows, to avoid escaping issues the in configure script. + variableValue: "{{.Env.CMAKE_ARGS}} {{.Env.COMMON_CMAKE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{unixPathSeparators .InstallDir}}/host" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_qtbase.yaml" + - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/host -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to call cmake. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v" + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + maxTimeBetweenOutput: 4800 userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableName: COIN_CMAKE_BUILD_DIR variableValue: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.BuildDir}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.BuildDir}}{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -48,36 +88,77 @@ instructions: directory: "{{.SourceDir}}/build/target" - type: ChangeDirectory directory: "{{.BuildDir}}" + - type: AppendToEnvironmentVariable - variableName: TARGET_CONFIGURE_ARGS + variableName: TARGET_CMAKE_ARGS variableValue: " -DQT_HOST_PATH={{.AgentWorkingDir}}/install" disable_if: condition: property property: platformDependency equals_value: null - type: AppendToEnvironmentVariable - variableName: TARGET_CONFIGURE_ARGS + variableName: TARGET_CMAKE_ARGS variableValue: " -DQT_HOST_PATH={{.InstallDir}}/host" enable_if: condition: property property: platformDependency equals_value: null + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.TARGET_CONFIGURE_ARGS}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + # Use unix separators even on Windows, to avoid escaping issues in the configure script. + variableValue: "{{.Env.TARGET_CMAKE_ARGS}} {{.Env.COMMON_TARGET_CMAKE_ARGS}} -DCMAKE_STAGING_PREFIX:PATH={{unixPathSeparators .InstallDir}}/target" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.TARGET_ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_qtbase.yaml" + - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake {{.Env.TARGET_CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}}/target -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to call cmake. - - type: ExecuteCommand - command: "{{.Env.TARGET_ENV_PREFIX}} cmake --build . --parallel -v" + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + maxTimeBetweenOutput: 4800 userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableName: COIN_CMAKE_BUILD_DIR variableValue: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_target_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -91,3 +172,9 @@ instructions: transferType: UploadModuleBuildArtifact maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 + - type: EnvironmentVariable + variableName: COIN_CONFIG_TYPE + variableValue: "Target" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples_target.yaml" + - !include "{{qt/qtbase}}/qmake/get_qmake_location_target.yaml" + - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml" diff --git a/coin/instructions/cmake_documentation_build.yaml b/coin/instructions/cmake_documentation_build.yaml new file mode 100644 index 0000000000..9630b503a1 --- /dev/null +++ b/coin/instructions/cmake_documentation_build.yaml @@ -0,0 +1,38 @@ +type: Group +instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}_build" + # If documentation feature is present, Coin installs top-level documentation + # built by product(qt5) build into <module_name>_doc_build/doc. Coin will + # silently omit installing the top-level documentations if not built by the product. + - type: ExecuteCommand + command: "rsync -a {{.SourceDir}}_doc_build/doc {{.SourceDir}}_build" + maxTimeInSeconds: 300 + maxTimeBetweenOutput: 300 + userMessageOnFailure: Failed to copy top-level docs to build dir. + # Filter list is created to exclude everything else than the + # generated documentation from the documentation archive. + - type: CreateFileListFromDirectory + directory: "{{.SourceDir}}_build/doc" + filterListFileName: "doc_build_filter" + userMessageOnFailure: "Failed to create filter list for docs" + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --target docs -v" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: Failed to generate documentation. + - type: UploadArtifact + archiveDirectory: "{{.SourceDir}}_build/doc" + transferType: UploadModuleDocumentation + filterListFileName: "doc_build_filter" + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 +enable_if: + condition: and + conditions: + - condition: property + property: features + contains_value: Documentation + - condition: runtime + env_var: BUILD_DOCUMENTATION + not_equals_value: null diff --git a/coin/instructions/cmake_module_build_instructions.yaml b/coin/instructions/cmake_module_build_instructions.yaml index e148321d39..a589941701 100644 --- a/coin/instructions/cmake_module_build_instructions.yaml +++ b/coin/instructions/cmake_module_build_instructions.yaml @@ -1,25 +1,74 @@ type: Group instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" - type: MakeDirectory directory: .git + - type: MakeDirectory + directory: "{{.SourceDir}}_build" - type: SetBuildDirectory - directory: "{{.SourceDir}}" + directory: "{{.SourceDir}}_build" - type: ChangeDirectory directory: "{{.BuildDir}}" + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}}" - type: EnvironmentVariable variableName: COIN_CMAKE_ARGS - # The lack of space between the non qtbase configure args and the rest of the args is important! - variableValue: "{{.Env.NON_QTBASE_CONFIGURE_ARGS}} -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON {{.SourceDir}}" - - !include "{{qt/qtbase}}/call_cmake.yaml" + variableValue: "{{.Env.NON_QTBASE_CMAKE_ARGS}} {{.Env.COMMON_NON_QTBASE_CMAKE_ARGS}}" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_module.yaml" + + - type: EnvironmentVariable + variableName: CMAKE_BUILD_TIMEOUT + variableValue: "6000" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_TIMEOUT + equals_value: null + - type: EnvironmentVariable + variableName: CMAKE_BUILD_OUTPUT_TIMEOUT + variableValue: "1200" + enable_if: + condition: runtime + env_var: CMAKE_BUILD_OUTPUT_TIMEOUT + equals_value: null - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" + maxTimeInSeconds: "{{.Env.CMAKE_BUILD_TIMEOUT}}" + maxTimeBetweenOutput: "{{.Env.CMAKE_BUILD_OUTPUT_TIMEOUT}}" userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableName: COIN_CMAKE_INSTALL_DIR variableValue: "{{.InstallDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_INSTALL_DIR}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_INSTALL_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_INSTALL_DIR}}{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -27,9 +76,14 @@ instructions: - !include "{{qt/qtbase}}/call_host_install.yaml" - type: SignPackage enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: features + contains_value: Packaging directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 @@ -38,3 +92,9 @@ instructions: transferType: UploadModuleBuildArtifact maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 + - type: EnvironmentVariable + variableName: COIN_CONFIG_TYPE + variableValue: "Host" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples_host.yaml" + - !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml" + - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml" diff --git a/coin/instructions/cmake_qtbase_build_instructions.yaml b/coin/instructions/cmake_qtbase_build_instructions.yaml index 4ed3e1ae6e..01eb7f3264 100644 --- a/coin/instructions/cmake_qtbase_build_instructions.yaml +++ b/coin/instructions/cmake_qtbase_build_instructions.yaml @@ -1,27 +1,71 @@ type: Group instructions: + - type: ChangeDirectory + directory: "{{.SourceDir}}" - type: MakeDirectory directory: .git + - type: MakeDirectory + directory: "{{.SourceDir}}_build" - type: SetBuildDirectory - directory: "{{.SourceDir}}" + directory: "{{.SourceDir}}_build" - type: ChangeDirectory directory: "{{.BuildDir}}" + + - type: EnvironmentVariable + variableName: COIN_CONFIGURE_ARGS + variableValue: "{{.Env.CONFIGURE_ARGS}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + # Use unix separators even on Windows, to avoid escaping issues in the configure script. + variableValue: "{{.Env.CMAKE_ARGS}} {{.Env.COMMON_CMAKE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{unixPathSeparators .InstallDir}}" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_qtbase.yaml" + - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake {{.Env.CONFIGURE_ARGS}} -DCMAKE_INSTALL_PREFIX:PATH={{.InstallDir}} -DQT_BUILD_TESTS=OFF {{.SourceDir}}" - executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to call cmake. - - type: ExecuteCommand - command: "{{.Env.ENV_PREFIX}} cmake --build . --parallel -v" + command: "{{.Env.CONFIGURE_ENV_PREFIX}} cmake --build . --parallel -v" maxTimeInSeconds: 6000 maxTimeBetweenOutput: 1200 userMessageOnFailure: > - Failed to build sources. In the current state bug can be everywhere. + Failed to build sources. - type: EnvironmentVariable - variableName: COIN_CMAKE_INSTALL_SCRIPT_PATH + variableName: COIN_CMAKE_BUILD_DIR variableValue: "{{.BuildDir}}" + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}libexec" + disable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] + - type: EnvironmentVariable + variableName: COIN_CMAKE_BUILD_LIBEXEC_DIR + variableValue: "{{.Env.COIN_CMAKE_BUILD_DIR}}{{.Env.CI_PATH_SEP}}bin" + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: and + conditions: + - condition: property + property: target.os + not_equals_value: QNX + - condition: property + property: target.osVersion + not_in_values: [WebAssembly, Android_ANY] - !include "{{qt/qtbase}}/call_host_install.yaml" - type: EnvironmentVariable variableName: DESTDIR @@ -29,9 +73,14 @@ instructions: - !include "{{qt/qtbase}}/call_host_install.yaml" - type: SignPackage enable_if: - condition: property - property: host.os - equals_value: Windows + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: features + contains_value: Packaging directory: "{{.InstallRoot}}/{{.AgentWorkingDir}}" maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 @@ -40,3 +89,9 @@ instructions: transferType: UploadModuleBuildArtifact maxTimeInSeconds: 1200 maxTimeBetweenOutput: 1200 + - type: EnvironmentVariable + variableName: COIN_CONFIG_TYPE + variableValue: "Host" + - !include "{{qt/qtbase}}/cmake_build_standalone_examples_host.yaml" + - !include "{{qt/qtbase}}/qmake/get_qmake_location_host.yaml" + - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_instructions.yaml" diff --git a/coin/instructions/cmake_regular_test_instructions_common.yaml b/coin/instructions/cmake_regular_test_instructions_common.yaml index 3a9e75c576..ec6f23a3f7 100644 --- a/coin/instructions/cmake_regular_test_instructions_common.yaml +++ b/coin/instructions/cmake_regular_test_instructions_common.yaml @@ -11,13 +11,3 @@ instructions: Failed to install tests archive. - type: ChangeDirectory directory: "{{.SourceDir}}_standalone_tests" - - type: ExecuteCommand - command: "ln -s {{.InstallDir}}/target fake_prefix" - maxTimeInSeconds: 6000 - maxTimeBetweenOutput: 1200 - userMessageOnFailure: > - Failed to run android hack. See QTBUG-88579 to check if this can be removed - enable_if: - condition: property - property: features - contains_value: AndroidTestRun diff --git a/coin/instructions/cmake_regular_test_instructions_enforced.yaml b/coin/instructions/cmake_regular_test_instructions_enforced.yaml index b7308a8f47..197b925c2a 100644 --- a/coin/instructions/cmake_regular_test_instructions_enforced.yaml +++ b/coin/instructions/cmake_regular_test_instructions_enforced.yaml @@ -2,7 +2,3 @@ type: Group instructions: - !include "{{qt/qtbase}}/cmake_regular_test_instructions_common.yaml" - !include "{{qt/qtbase}}/cmake_run_ctest_enforce_exit_code.yaml" -disable_if: - condition: property - property: configureArgs - contains_value: "-DBUILD_SHARED_LIBS=OFF" diff --git a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml index 9913bb4832..a7039b5015 100644 --- a/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml +++ b/coin/instructions/cmake_run_ctest_enforce_exit_code.yaml @@ -1,8 +1,74 @@ type: Group instructions: + - type: ScheduleUploadTestResults + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.PYTHON3_PATH}}:" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: TESTRUNNER + variableValue: "{{.Env.LIBEXEC_INSTALL_DIR}}qt-testrunner.py --" + # Running wasm tests with the coin testrunner is not yet implemented + disable_if: + condition: property + property: target.osVersion + in_values: [WebAssembly] + - type: AppendToEnvironmentVariable + variableName: TESTRUNNER + variableValue: " {{.SourceDir}}/coin_qnx_qemu_runner.sh" + enable_if: + condition: property + property: target.osVersion + in_values: [QNX_710] + - type: Group + enable_if: + condition: property + property: features + contains_value: UseAddressSanitizer + instructions: + - type: EnvironmentVariable + variableName: ASAN_OPTIONS + variableValue: "malloc_context_size=100:detect_leaks=0" + - type: EnvironmentVariable + # Override qt-testrunner as we don't want to gather test statistics + # because many tests FAIL when built with ASAN. + variableName: TESTRUNNER + variableValue: "{{.Env.LIBEXEC_INSTALL_DIR}}sanitizer-testrunner.py" + - type: EnvironmentVariable + variableName: COIN_CTEST_RESULTSDIR + variableValue: "{{.AgentWorkingDir}}\\testresults" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: COIN_CTEST_RESULTSDIR + variableValue: "{{.AgentWorkingDir}}/testresults" + disable_if: + condition: property + property: host.os + equals_value: Windows + + # Keep the testrun quiet for ASAN testruns, since there are FAILs happening all over the place... - type: EnvironmentVariable variableName: CTEST_ARGS - variableValue: "-V --rerun-failed --force-new-ctest-process --repeat until-pass:5" + variableValue: "-V" + disable_if: + condition: property + property: features + contains_value: UseAddressSanitizer + # ...and only print the output from a failing test, i.e. test with ASAN errors. + - type: EnvironmentVariable + variableName: CTEST_OUTPUT_ON_FAILURE + variableValue: "1" + enable_if: + condition: property + property: features + contains_value: UseAddressSanitizer + - type: AppendToEnvironmentVariable variableName: CTEST_ARGS variableValue: " --stop-on-failure" @@ -10,11 +76,85 @@ instructions: condition: property property: features contains_value: AbortTestingOnFirstFailure + + # Enable CTest's JUnit XML summary only for recent versions + - type: AppendToEnvironmentVariable + variableName: CTEST_ARGS + variableValue: " --output-junit {{.Env.COIN_CTEST_RESULTSDIR}}{{.Env.CI_PATH_SEP}}test_summary.ctest_junit_xml" + enable_if: + condition: runtime + env_var: CMAKE_MIN_SUPPORTED_BIN_PATH + equals_value: null + + - !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml" + + - type: EnvironmentVariable + variableName: COIN_CROSS_PLATFORM_VERSION_TEST + variableValue: "TRUE" + enable_if: + condition: and + conditions: + - condition: property + property: platformDependency + not_equals_value: null + - condition: property + property: platformDependency.target.osVersion + not_equals_property: target.osVersion + - condition: property + property: features + contains_value: TestOnly + - type: ExecuteCommand command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution ignoreExitCode: false - maxTimeInSeconds: 7200 - maxTimeBetweenOutput: 900 + maxTimeInSeconds: 10800 + maxTimeBetweenOutput: "{{.Env.COIN_COMMAND_OUTPUT_TIMEOUT}}" userMessageOnFailure: > Failed to run tests. + + - type: Group + instructions: + # Qttestrunner does not work with bic tests. + - type: EnvironmentVariable + variableName: TESTRUNNER + variableValue: "" + - type: EnvironmentVariable + variableName: QT_MODULE_TO_TEST + variableValue: "{{.SourceDir}}" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.InstallDir}}/bin:" + - type: InstallSourceArchive + maxTimeInSeconds: 600 + maxTimeBetweenOutput: 600 + project: qt/qtqa + ref: dev + directory: qt/qtqa + userMessageOnFailure: "Could not install qt/qtqa source archive. Please investigate why." + - type: ChangeDirectory + directory: "{{.AgentWorkingDir}}/qt/qtqa/tests/postbuild/bic" + - type: ExecuteCommand + command: ["{{.InstallDir}}/bin/qmake"] + maxTimeInSeconds: 7200 + maxTimeBetweenOutput: 300 + userMessageOnFailure: "Failed to execute qmake for bic tests" + - type: RunQtUnitTest + runTestCommand: ["make", "check", "-j1"] + directory: "{{.AgentWorkingDir}}/qt/qtqa/tests/postbuild/bic" + testRepetitionAllowance: 0 + maxTimeInSeconds: 7200 + maxTimeBetweenOutput: 300 + userMessageOnFailure: "Running bic tests failed." + enable_if: + condition: and + conditions: + - condition: property + property: features + contains_value: Packaging + - condition: property + property: target.os + equals_value: Linux + - condition: property + property: features + contains_value: EnableBicTests diff --git a/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml b/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml index d4f0c13e3f..b94717730b 100644 --- a/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml +++ b/coin/instructions/cmake_run_ctest_ignore_exit_code.yaml @@ -14,7 +14,7 @@ instructions: command: "{{.Env.TESTS_ENV_PREFIX}} ctest {{.Env.CTEST_ARGS}}" executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution ignoreExitCode: true - maxTimeInSeconds: 7200 + maxTimeInSeconds: 10800 maxTimeBetweenOutput: 900 userMessageOnFailure: > Failed to run tests. diff --git a/coin/instructions/cmake_setup_running_qnxqemu_tests_env_vars.yaml b/coin/instructions/cmake_setup_running_qnxqemu_tests_env_vars.yaml new file mode 100644 index 0000000000..0fb9768a15 --- /dev/null +++ b/coin/instructions/cmake_setup_running_qnxqemu_tests_env_vars.yaml @@ -0,0 +1,20 @@ +type: Group +instructions: + - type: WriteFile + filename: "{{.SourceDir}}/coin_qnx_qemu_runner.sh" + fileMode: 493 + fileContents: | + #!/bin/sh + + # Many tests require changing into their directory, in order to find + # files they depend on. + testdir=`dirname "$1"` + + # The remote SSH server executes everything we send under "sh -c". So + # the only way to preserve arguments is to shell-quote them and send + # them as a single string. We use python's shlex module for that. + + quoted_args=`python3 -c 'import sys, shlex; print(shlex.join(sys.argv[1:]))' "$@"` + + ssh "$QNX_QEMU_SSH" \ + cd "$testdir" \; $QNX_TEST_ENV "$quoted_args" diff --git a/coin/instructions/cmake_setup_running_tests_env_vars.yaml b/coin/instructions/cmake_setup_running_tests_env_vars.yaml index ac909a95cc..b9387d74c6 100644 --- a/coin/instructions/cmake_setup_running_tests_env_vars.yaml +++ b/coin/instructions/cmake_setup_running_tests_env_vars.yaml @@ -1,5 +1,7 @@ type: Group instructions: + # Informs qtestblacklist.cpp that tests are run in the CI. + # A related QT_BUILD_ENVIRONMENT env var is set during an integration's build phase. - type: EnvironmentVariable variableName: QTEST_ENVIRONMENT variableValue: "ci" @@ -16,7 +18,7 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - not_equals_value: QEMU + not_in_values: [QEMU, QNX_710] - type: Group instructions: - type: EnvironmentVariable @@ -30,4 +32,16 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - not_equals_value: QEMU + not_in_values: [QEMU, QNX_710] + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_setup_running_qnxqemu_tests_env_vars.yaml" + enable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: QNX_710 + - condition: property + property: features + not_contains_value: DisableTests diff --git a/coin/instructions/coin_module_axivion_template_v2.yaml b/coin/instructions/coin_module_axivion_template_v2.yaml new file mode 100644 index 0000000000..87d32f5d37 --- /dev/null +++ b/coin/instructions/coin_module_axivion_template_v2.yaml @@ -0,0 +1,98 @@ +analysis_instructions_axivion: &analysis_instructions_axivion + type: Group + instructions: + - type: Group + instructions: + - type: EnvironmentVariable + variableName: AXIVION_CHAINLOAD_TOOLCHAIN_FILE + variableValue: "{{.AgentWorkingDir}}/install/lib/cmake/Qt6/qt.toolchain.cmake" + - type: EnvironmentVariable + variableName: CMAKE_PREFIX_PATH + variableValue: "{{.AgentWorkingDir}}/install/lib/cmake" + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qtbase" + - type: Group + instructions: + - type: Rename + sourcePath: "{{.SourceDir}}/coin/axivion/ci_config_{{.Env.TARGET_OS_COIN}}.json" + targetPath: "{{.Env.HOME}}/axivion/ci_config.json" + userMessageOnFailure: "Moving ci_config.json failed. Make sure you have included the file in coin/axivion/ -folder" + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: ["../../../axivion/start_analysis.sh"] + maxTimeInSeconds: 28800 + maxTimeBetweenOutput: 28800 + userMessageOnFailure: "Failed to run analysis" + +build_environment_axivion: &build_environment_axivion + type: Group + instructions: + - type: ExecuteCommand + command: ["sudo", "mkdir", "-p","/data/axivion"] + maxTimeInSeconds: 100 + maxTimeBetweenOutput: 100 + userMessageOnFailure: "Create mount point for results failed" + - type: ExecuteCommand + command: ["sudo", "mount", "-t", "nfs", "-o", "rw,nfsvers=3", "10.212.0.93:/data/axivion", "/data/axivion"] + maxTimeInSeconds: 100 + maxTimeBetweenOutput: 100 + userMessageOnFailure: "Mount failed" + - type: ExecuteCommand + command: ["rm","-rf","{{.SourceDir}}"] + maxTimeInSeconds: 100 + maxTimeBetweenOutput: 100 + userMessageOnFailure: "Failed to remove source directory" + - type: MakeDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: ExecuteCommand + command: ["git", "clone", "--jobs={{.NumCPU}}", "-n","--depth=50", "git://{{.Env.QT_COIN_GIT_DAEMON}}/qt-project/qt/{{.Env.TESTED_MODULE_COIN}}","."] + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to clone repository" + - type: ExecuteCommand + command: ["git", "fetch", "--recurse-submodules", "origin", "{{.Env.TESTED_MODULE_REVISION_COIN}}"] + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to fetch sources" + - type: ExecuteCommand + command: ["git", "checkout", "--force", "{{.Env.TESTED_MODULE_REVISION_COIN}}"] + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to checkout sources" + - type: ExecuteCommand + command: ["git", "submodule", "update", "--init", "--recursive"] + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to initialize git submodules" + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml" + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qtbase" + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_qtbase_build_instructions.yaml" + enable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + equals_value: "qtbase" + +type: Group +instructions: + - !include "{{qt/qtbase}}/prepare_building_env.yaml" + - *build_environment_axivion + - *analysis_instructions_axivion +enable_if: + condition: runtime + env_var: AXIVION_ANALYSIS + equals_value: "1" + diff --git a/coin/instructions/coin_module_build_template_v2.yaml b/coin/instructions/coin_module_build_template_v2.yaml index bee930d447..e7f47328e8 100644 --- a/coin/instructions/coin_module_build_template_v2.yaml +++ b/coin/instructions/coin_module_build_template_v2.yaml @@ -3,8 +3,15 @@ instructions: - !include "{{qt/qtbase}}/prepare_building_env.yaml" - type: Group instructions: - - !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml" - - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_host.yaml" + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml" + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_host.yaml" + disable_if: + condition: runtime + env_var: QT_CI_SKIP_MODULE_BUILD + not_equals_value: null + - !include "{{qt/qtbase}}/cmake_documentation_build.yaml" enable_if: condition: and conditions: @@ -13,7 +20,37 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - not_equals_value: QEMU + not_in_values: [QEMU, WebAssembly, INTEGRITY, VxWorks] + - condition: property + property: features + not_contains_value: "TargetBuildOnly" + - condition: property + property: features + not_contains_value: "DebianPackaging" + - condition: runtime + env_var: AXIVION_ANALYSIS + not_equals_value: "1" + - type: Group + instructions: + - !include "{{qt/qtbase}}/coin_module_axivion_template_v2.yaml" + enable_if: + condition: and + conditions: + - condition: runtime + env_var: AXIVION_ANALYSIS + equals_value: "1" + - condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qtdoc" + - condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qtquickeffectmaker" + - condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qttranslations" + - condition: runtime + env_var: TESTED_MODULE_COIN + not_equals_value: "qtwebengine" - type: Group instructions: - !include "{{qt/qtbase}}/cmake_cross_compilation_module_build_instructions.yaml" @@ -21,20 +58,32 @@ instructions: instructions: - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" enable_if: - condition: and - conditions: - - condition: property - property: host.os - equals_property: target.os - - condition: property - property: target.osVersion - equals_value: QEMU - disable_if: - condition: and + condition: property + property: target.osVersion + in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] + enable_if: + condition: or conditions: - condition: property - property: host.os - equals_property: target.os - - condition: property property: target.osVersion - not_equals_value: QEMU + in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] + - condition: and + conditions: + - condition: property + property: host.compiler + equals_value: MSVC2019 + - condition: property + property: target.arch + equals_value: ARM64 + - condition: property + property: features + not_contains_value: "DebianPackaging" + - type: Group + instructions: + - type: Group + instructions: + - !include "{{qt/qtbase}}/debian/debian_build_module.yaml" + enable_if: + condition: property + property: features + contains_value: "DebianPackaging" diff --git a/coin/instructions/coin_module_test_android_start_emulator.yaml b/coin/instructions/coin_module_test_android_start_emulator.yaml index fc5f259043..eff28ff494 100644 --- a/coin/instructions/coin_module_test_android_start_emulator.yaml +++ b/coin/instructions/coin_module_test_android_start_emulator.yaml @@ -3,21 +3,10 @@ instructions: - type: Group instructions: - type: ExecuteCommand - command: ["{{.Env.ANDROID_SDK_HOME}}/tools/emulator", "@x86emulator","-no-audio","-no-window","-gpu","swiftshader_indirect","-partition-size","4000"] - maxTimeInSeconds: 1800 - maxTimeBetweenOutput: 600 - userMessageOnFailure: "Failed to run emulator, check logs." - startInBackground: True - - type: ExecuteCommand - command: ["{{.Env.ANDROID_SDK_HOME}}/platform-tools/adb","devices"] - maxTimeInSeconds: 1800 - maxTimeBetweenOutput: 600 - userMessageOnFailure: "Failed to run adb, check logs." - - type: ExecuteCommand - command: ["{{.Env.ANDROID_SDK_HOME}}/platform-tools/adb","wait-for-device"] - maxTimeInSeconds: 1800 - maxTimeBetweenOutput: 1800 - userMessageOnFailure: "Failed to run adb, check logs." + command: "{{.Env.ANDROID_EMULATOR_RUNNER}}" + maxTimeInSeconds: 600 + maxTimeBetweenOutput: 300 + userMessageOnFailure: "Failed to start emulator, check coin log and testresults log files." enable_if: condition: property property: features diff --git a/coin/instructions/coin_module_test_docs.yaml b/coin/instructions/coin_module_test_docs.yaml new file mode 100644 index 0000000000..b2ae01677e --- /dev/null +++ b/coin/instructions/coin_module_test_docs.yaml @@ -0,0 +1,41 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: QDOC_NOLINKERRORS + variableValue: 1 + - type: EnvironmentVariable + variableName: QDOC_ENABLE_WARNINGLIMIT + variableValue: 1 + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "cp -rfs /opt/qt-doctools/. {{.InstallDir}}" + userMessageOnFailure: > + Failed to create links to provisioned binaries. + + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + variableValue: "-DQT_BUILD_TESTS=OFF" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_module.yaml" + + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --target generate_docs -v" + ignoreExitCode: false + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Documentation check failed, see the log for details. +enable_if: + condition: and + conditions: + - condition: property + property: features + contains_value: "TestDocs" + - condition: property + property: host.os + equals_property: target.os diff --git a/coin/instructions/coin_module_test_qnx_start_emulator.yaml b/coin/instructions/coin_module_test_qnx_start_emulator.yaml new file mode 100644 index 0000000000..486b689847 --- /dev/null +++ b/coin/instructions/coin_module_test_qnx_start_emulator.yaml @@ -0,0 +1,80 @@ +type: Group +instructions: + - type: Group + instructions: + - type: WriteFile + fileContents: | + #!/bin/bash + RESULT=1 # 0 upon success + TIMEOUT=240 + COUNT=0 + QEMUPID=0 + QEMUIPADDR="{{.Env.QNX_QEMU_IPADDR}}" + mkqnximage --type=qemu --graphics=no --ip=${QEMUIPADDR} --build --run=-h </dev/null &>/dev/null & disown + + while [[ "QEMUPID" -eq 0 ]] + do + QEMUPID=`pidof qemu-system-x86_64` + + if [[ "QEMUPID" -eq 0 ]]; then + echo "QEMU not yet started, wait 1 sec." + COUNT=$((COUNT+1)) + sleep 1 + else + echo "QEMU running with PID: $QEMUPID" + fi + + if [[ "COUNT" -eq "TIMEOUT" ]]; then + echo "Timeout waiting QEMU to start" + exit 1 + fi + done + + while :; do + echo "Waiting QEMU SSH coming up" + status=$(ssh -o BatchMode=yes -o ConnectTimeout=1 ${QEMUIPADDR} echo ok 2>&1) + RESULT=$? + if [ $RESULT -eq 0 ]; then + echo "QEMU SSH Connected ok" + break + fi + if [ $RESULT -eq 255 ]; then + # connection refused also gets you here + if [[ $status == *"Permission denied"* ]] ; then + # permission denied indicates the ssh link is okay + echo "QEMU SSH server up" + RESULT=0 + break + fi + fi + TIMEOUT=$((TIMEOUT-1)) + if [ $TIMEOUT -eq 0 ]; then + echo "QEMU SSH timed out" + exit $RESULT + fi + sleep 1 + done + exit $RESULT + filename: "{{.Env.QNX_QEMU}}/start_qnx_qemu.sh" + fileMode: 493 + - type: ChangeDirectory + directory: "{{.Env.QNX_QEMU}}" + - type: ExecuteCommand + command: "{{.Env.QNX_QEMU}}/start_qnx_qemu.sh" + maxTimeInSeconds: 300 + maxTimeBetweenOutput: 100 + userMessageOnFailure: > + Failed to start QNX qemu, check logs. + disable_if: + condition: property + property: host.os + equals_value: Windows + enable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: QNX_710 + - condition: property + property: features + not_contains_value: DisableTests diff --git a/coin/instructions/coin_module_test_template_common.yaml b/coin/instructions/coin_module_test_template_common.yaml index bd610a2281..19c51e23c6 100644 --- a/coin/instructions/coin_module_test_template_common.yaml +++ b/coin/instructions/coin_module_test_template_common.yaml @@ -2,7 +2,7 @@ type: Group instructions: # The build env is needed on MSVC so that tst_qmake can properly build apps / libraries. - !include "{{qt/qtbase}}/prepare_building_env.yaml" - - !include "{{qt/qtbase}}/coin_module_test_android_start_emulator.yaml" + - !include "{{qt/qtbase}}/coin_module_test_qnx_start_emulator.yaml" # The test env vars are needed to pick the proper prefix.bat file. - !include "{{qt/qtbase}}/cmake_setup_running_tests_env_vars.yaml" - !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml" diff --git a/coin/instructions/coin_module_test_template_v2.yaml b/coin/instructions/coin_module_test_template_v2.yaml index 4691eff55a..423d292bf7 100644 --- a/coin/instructions/coin_module_test_template_v2.yaml +++ b/coin/instructions/coin_module_test_template_v2.yaml @@ -14,12 +14,8 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - equals_value: QEMU + in_values: [QEMU, QNX_710] disable_if: condition: property property: features contains_value: DisableTests - - - type: EnvironmentVariable - variableName: Dummy - variableValue: dummy diff --git a/coin/instructions/coin_module_test_template_v3.yaml b/coin/instructions/coin_module_test_template_v3.yaml index fa521f0d54..de870b9d45 100644 --- a/coin/instructions/coin_module_test_template_v3.yaml +++ b/coin/instructions/coin_module_test_template_v3.yaml @@ -14,7 +14,7 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - equals_value: QEMU + in_values: [QEMU, QNX_710, IOS_ANY] - condition: property property: features contains_value: AndroidTestRun @@ -22,7 +22,3 @@ instructions: condition: property property: features contains_value: DisableTests - - - type: EnvironmentVariable - variableName: Dummy - variableValue: dummy diff --git a/coin/instructions/coin_qtbase_build_template_v2.yaml b/coin/instructions/coin_qtbase_build_template_v2.yaml index 3421a51598..bcba742781 100644 --- a/coin/instructions/coin_qtbase_build_template_v2.yaml +++ b/coin/instructions/coin_qtbase_build_template_v2.yaml @@ -13,18 +13,68 @@ instructions: equals_property: target.os - condition: property property: target.osVersion - not_equals_value: QEMU + not_in_values: [QEMU, WebAssembly, INTEGRITY, VxWorks] + - condition: property + property: features + not_contains_value: "TargetBuildOnly" + - condition: property + property: features + not_contains_value: "DebianPackaging" + - condition: runtime + env_var: AXIVION_ANALYSIS + not_equals_value: "1" + - type: Group + instructions: + - !include "{{qt/qtbase}}/coin_module_axivion_template_v2.yaml" + enable_if: + condition: runtime + env_var: AXIVION_ANALYSIS + equals_value: "1" - type: Group instructions: - - !include "{{qt/qtbase}}/cmake_cross_compilation_qtbase_build_instructions.yaml" + - type: Group + instructions: + - !include "{{qt/qtbase}}/cmake_cross_compilation_qtbase_build_instructions.yaml" + disable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Android_ANY + - condition: property + property: target.arch + equals_value: Multi + - !include "{{qt/qtbase}}/prepare_android_multi_abi_env.yaml" - type: Group instructions: - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts_target.yaml" enable_if: condition: property property: target.osVersion - in_values: [Android_ANY, QEMU] + in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] enable_if: - condition: property + condition: or + conditions: + - condition: property property: target.osVersion - in_values: [IOS_ANY, Android_ANY, QEMU] + in_values: [Android_ANY, QEMU, IOS_ANY, QNX_710, WebAssembly, INTEGRITY, VxWorks] + - condition: and + conditions: + - condition: property + property: host.compiler + equals_value: MSVC2019 + - condition: property + property: target.arch + equals_value: ARM64 + - condition: property + property: features + not_contains_value: "DebianPackaging" + - type: Group + instructions: + - type: Group + instructions: + - !include "{{qt/qtbase}}/debian/debian_build_module.yaml" + enable_if: + condition: property + property: features + contains_value: "DebianPackaging" diff --git a/coin/instructions/coin_qtbase_test_docs.yaml b/coin/instructions/coin_qtbase_test_docs.yaml new file mode 100644 index 0000000000..2498f9b393 --- /dev/null +++ b/coin/instructions/coin_qtbase_test_docs.yaml @@ -0,0 +1,42 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: QDOC_NOLINKERRORS + variableValue: 1 + - type: EnvironmentVariable + variableName: QDOC_ENABLE_WARNINGLIMIT + variableValue: 1 + - type: SetBuildDirectory + directory: "{{.SourceDir}}" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - type: ExecuteCommand + command: "cp -rfs /opt/qt-doctools/. {{.InstallDir}}" + userMessageOnFailure: > + Failed to create links to provisioned binaries. + + - type: EnvironmentVariable + variableName: COIN_CMAKE_ARGS + # Use unix separators even on Windows, to avoid escaping issues in the configure script. + variableValue: "-DQT_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX:PATH={{unixPathSeparators .InstallDir}}" + - type: EnvironmentVariable + variableName: CONFIGURE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + - !include "{{qt/qtbase}}/call_configure_qtbase.yaml" + + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} cmake --build . --target generate_docs -v" + ignoreExitCode: false + maxTimeInSeconds: 1800 + maxTimeBetweenOutput: 900 + userMessageOnFailure: > + Documentation check failed, see the log for details. +enable_if: + condition: and + conditions: + - condition: property + property: features + contains_value: "TestDocs" + - condition: property + property: host.os + equals_property: target.os diff --git a/coin/instructions/debian/debian_build_module.yaml b/coin/instructions/debian/debian_build_module.yaml new file mode 100644 index 0000000000..0aa239e1c6 --- /dev/null +++ b/coin/instructions/debian/debian_build_module.yaml @@ -0,0 +1,125 @@ +type: Group +enable_if: + condition: property + property: features + contains_value: DebianPackaging +instructions: + - !include "{{qt/qtbase}}/debian/prepare_debian_env.yaml" + - type: EnvironmentVariable + variableName: GIT_SSH_COMMAND + variableValue: "ssh -o StrictHostKeyChecking=no" + - type: ChangeDirectory + directory: "{{.AgentWorkingDir}}" + - type: MakeDirectory + directory: output/debian_packages + - type: MakeDirectory + directory: debian_packages + - type: ExecuteCommand + command: "git clone git@git.qt.io:tqtc-debian/package_generator.git" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to clone package generator repo" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ExecuteCommand + command: "git clone -b 6.6 git@git.qt.io:tqtc-debian/qt6-{{.Env.TESTED_MODULE_PLAIN_COIN}}.git" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to clone debian packaging repo" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ChangeDirectory + directory: "qt6-{{.Env.TESTED_MODULE_PLAIN_COIN}}" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ExecuteCommand + command: "git checkout {{.Env.DEBIAN_RULES_REF}}" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to checkout debian rules branch" + disable_if: + condition: or + conditions: + - condition: runtime + env_var: DEBIAN_RULES_REF + equals_value: null + - condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ChangeDirectory + directory: "{{.AgentWorkingDir}}" + - type: ExecuteCommand + command: "wget -q {{.CoinDownloadURL}}/{{.Env.MODULE_SOURCES_RELATIVE_STORAGE_PATH}}" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed get sources" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ExecuteCommand + command: "mv sources_unix.tar.gz qt-{{.Env.QT_REPO_MODULE_VERSION}}-{{.Env.TESTED_MODULE_PLAIN_COIN}}-src_{{.Env.QT_REPO_MODULE_VERSION}}.orig.tar.gz" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed rename src pkg" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ChangeDirectory + directory: "{{.AgentWorkingDir}}/qt6-{{.Env.TESTED_MODULE_PLAIN_COIN}}" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + + + # rc is required currently by the script + - type: ExecuteCommand + command: "../package_generator/generate_packaging.sh --qt-version {{.Env.QT_REPO_MODULE_VERSION}} --deb-rev 1 --release tqtc-focal" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed to generate pkg" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ChangeDirectory + directory: "{{.AgentWorkingDir}}" + - type: ExecuteCommand + command: "dpkg-source -b qt6-{{.Env.TESTED_MODULE_PLAIN_COIN}}" + maxTimeInSeconds: 900 + maxTimeBetweenOutput: 900 + userMessageOnFailure: "Failed dpkg-source" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: ExecuteCommand + command: ["sbuild", + "--build-dep-resolver=apt", + "-sAd", "{{.Env.COIN_TARGET_DIST}}", + "-c", "{{.Env.COIN_SBUILD_CHROOT}}", + "--build-dir", "output/debian_packages", + "--extra-repository={{.Env.COIN_EXTRA_DEBIAN_REPO}}", + "--extra-package={{.Env.COIN_EXTRA_DEBIAN_PACKAGES}}", + "--extra-package={{.AgentWorkingDir}}/debian_packages/", + "qt-{{.Env.QT_REPO_MODULE_VERSION}}-{{.Env.TESTED_MODULE_PLAIN_COIN}}-src_{{.Env.QT_REPO_MODULE_VERSION}}-1.dsc"] + maxTimeInSeconds: 18000 + maxTimeBetweenOutput: 18000 + userMessageOnFailure: "Failed build debian packages" + disable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN + contains_value: "MISSING_DEBIAN_INST" + - type: UploadArtifact + archiveDirectory: "{{.AgentWorkingDir}}/output" + transferType: UploadModuleBuildArtifact + maxTimeInSeconds: 1200 + maxTimeBetweenOutput: 1200 diff --git a/coin/instructions/debian/prepare_debian_env.yaml b/coin/instructions/debian/prepare_debian_env.yaml new file mode 100644 index 0000000000..c51de2103c --- /dev/null +++ b/coin/instructions/debian/prepare_debian_env.yaml @@ -0,0 +1,82 @@ +type: Group +enable_if: + condition: property + property: features + contains_value: DebianPackaging +instructions: + - type: EnvironmentVariable + variableName: COIN_TARGET_DIST + variableValue: "tqtc-focal" + enable_if: + condition: runtime + env_var: COIN_TARGET_DIST + equals_value: null + - type: EnvironmentVariable + variableName: COIN_SBUILD_CHROOT + variableValue: "stable-arm64-sbuild" + enable_if: + condition: and + conditions: + - condition: runtime + env_var: COIN_SBUILD_CHROOT + equals_value: null + - condition: property + property: target.arch + equals_value: AARCH64 + - type: EnvironmentVariable + variableName: COIN_SBUILD_CHROOT + variableValue: "stable-amd64-sbuild" + enable_if: + condition: and + conditions: + - condition: runtime + env_var: COIN_SBUILD_CHROOT + equals_value: null + - condition: property + property: target.arch + equals_value: X86_64 + - type: EnvironmentVariable + variableName: COIN_SBUILD_DISTRO + variableValue: "arm64-focal" + enable_if: + condition: property + property: target.arch + equals_value: AARCH64 + - type: EnvironmentVariable + variableName: COIN_SBUILD_DISTRO + variableValue: "amd64-focal" + disable_if: + condition: property + property: target.arch + equals_value: AARCH64 + + - type: EnvironmentVariable + variableName: COIN_SKIP_DEBIAN + variableValue: "MISSING_DEBIAN_INST" + enable_if: + condition: runtime + env_var: COIN_SKIP_DEBIAN_MODULES + contains_value: "{{.Env.TESTED_MODULE_COIN}}" + + # Set version info to environment + - type: ParseEnvironmentVariableFromFile + regex: "QT_REPO_MODULE_VERSION \"(?P<QT_REPO_MODULE_VERSION>.*)\"" + filename: "{{.SourceDir}}/.cmake.conf" + maxTimeInSeconds: 300 + maxTimeBetweenOutput: 300 + userMessageOnFailure: "Failed to parse version information from .cmake.conf" + disable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + equals_value: "qt5" + - type: ParseEnvironmentVariableFromFile + regex: "QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT \"(?P<QT_REPO_MODULE_PRERELEASE_VERSION_SEGMENT>.*)\"" + filename: "{{.SourceDir}}/.cmake.conf" + maxTimeInSeconds: 300 + maxTimeBetweenOutput: 300 + userMessageOnFailure: "Failed to parse status information from .cmake.conf" + disable_if: + condition: runtime + env_var: TESTED_MODULE_COIN + equals_value: "qt5" + diff --git a/coin/instructions/prepare_android_multi_abi_env.yaml b/coin/instructions/prepare_android_multi_abi_env.yaml new file mode 100644 index 0000000000..bbd83e600f --- /dev/null +++ b/coin/instructions/prepare_android_multi_abi_env.yaml @@ -0,0 +1,29 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: INSTALL_DIR_FOR_CMAKE_TESTS + variableValue: "{{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86\"}}{{index .Env $android_artifact_path}}/install/target" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DQT_PATH_ANDROID_ABI_arm64-v8a={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-arm64-v8a\"}}{{index .Env $android_artifact_path}}/install/target" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DQT_PATH_ANDROID_ABI_armeabi-v7a={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-armeabi-v7a\"}}{{index .Env $android_artifact_path}}/install/target" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DQT_PATH_ANDROID_ABI_x86={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86\"}}{{index .Env $android_artifact_path}}/install/target" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DQT_PATH_ANDROID_ABI_x86_64={{$android_artifact_path:=index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-x86_64\"}}{{index .Env $android_artifact_path}}/install/target" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DQT_HOST_PATH={{.Env.HOST_INSTALL_DIR}}" +enable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Android_ANY + - condition: property + property: target.arch + equals_value: Multi diff --git a/coin/instructions/prepare_building_env.yaml b/coin/instructions/prepare_building_env.yaml index edba3b0ebc..a3ac5c3f0b 100644 --- a/coin/instructions/prepare_building_env.yaml +++ b/coin/instructions/prepare_building_env.yaml @@ -8,6 +8,33 @@ instructions: variableName: CMAKE_GENERATOR variableValue: Ninja + # Set path separator based on host platform. + # \ on Windows (double \\ for escaping the backslash) + # / on UNIX + - type: EnvironmentVariable + variableName: CI_PATH_SEP + variableValue: "\\" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: CI_PATH_SEP + variableValue: "/" + disable_if: + condition: property + property: host.os + equals_value: Windows + + # Enable Axivion_analysis for Qt + - type: EnvironmentVariable + variableName: AXIVION_ANALYSIS + variableValue: "1" + enable_if: + condition: property + property: features + contains_value: Axivion + # Export ICC specific env. variables - type: Group @@ -28,14 +55,14 @@ instructions: - type: Group instructions: - type: PrependToEnvironmentVariable - variableName: CONFIGURE_ARGS + variableName: COMMON_CMAKE_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 + variableName: COMMON_CMAKE_ARGS variableValue: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ " enable_if: condition: or @@ -47,19 +74,28 @@ instructions: property: host.compiler contains_value: Mingw - type: PrependToEnvironmentVariable - variableName: CONFIGURE_ARGS + variableName: COMMON_CMAKE_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 + variableName: COMMON_CMAKE_ARGS variableValue: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ " enable_if: condition: property property: host.compiler contains_value: Clang + disable_if: + condition: and + conditions: + - condition: runtime + env_var: COMMON_CMAKE_ARGS + contains_value: "-DCMAKE_C_COMPILER=" + - condition: runtime + env_var: COMMON_CMAKE_ARGS + contains_value: "-DCMAKE_CXX_COMPILER=" # Export TARGET_ARCHITECTURE and WINDOWS_SDK_VERSION for MSVC cross compilation @@ -94,6 +130,30 @@ instructions: property: host.arch equals_property: X86_64 - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: x64_arm64 + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + equals_value: ARM64 + - condition: property + property: host.arch + equals_value: X86_64 + - type: EnvironmentVariable + variableName: TARGET_ARCHITECTURE + variableValue: arm64 + enable_if: + condition: and + conditions: + - condition: property + property: target.arch + in_values: ["AARCH64", "ARM64"] + - condition: property + property: host + equals_property: target + - 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 @@ -185,6 +245,20 @@ instructions: condition: property property: host.compiler equals_value: MSVC2019 + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles%\\Microsoft Visual Studio\\2022\\Preview\\VC\\Auxiliary\\Build\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2022_PREVIEW + - type: EnvironmentVariable + variableName: VC_SCRIPT + variableValue: "%ProgramFiles%\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\Build\\vcvarsall.bat" + enable_if: + condition: property + property: host.compiler + equals_value: MSVC2022 # With MSVC we need setup the environment before every subprocess call, the group below creates a script that @@ -235,7 +309,7 @@ instructions: instructions: # Need to unset QMAKESPEC, so that the pre-installed boot2qt mkspec is not picked up. - type: WriteFile - fileContents: "#!/bin/bash\nunset LD_LIBRARY_PATH\n. {{.Env.QT_YOCTO_ENVSETUP}}\nexport PATH={{.Env.QT_CMAKE_DIR}}:$PATH;\nunset QMAKESPEC\n$*" + fileContents: "#!/bin/bash\nunset LD_LIBRARY_PATH\n. {{.Env.QT_YOCTO_ENVSETUP}}\nexport PATH={{.Env.QT_CMAKE_DIR}}:$PATH;\nunset QMAKESPEC\n\"$@\"" filename: "{{.Env.HOME}}/prefix.sh" fileMode: 493 maxTimeInSeconds: 20 @@ -250,11 +324,351 @@ instructions: enable_if: condition: property property: target.osVersion - equals_value: QEMU + in_values: [QEMU] - type: EnvironmentVariable variableName: TARGET_ENV_PREFIX variableValue: "" disable_if: condition: property property: target.osVersion + in_values: [QEMU] + # This fixes an issue where binfmts is sometimes disabled on the test VMs + - type: ExecuteCommand + command: sudo update-binfmts --enable + userMessageOnFailure: "Failed to enable binfmts" + enable_if: + condition: property + property: target.osVersion equals_value: QEMU + + # Windows on Arm, cross-compilation with MSVC + - type: Group + enable_if: + condition: and + conditions: + - condition: property + property: host.compiler + equals_value: MSVC2019 + - condition: property + property: target.arch + equals_value: ARM64 + instructions: + - type: EnvironmentVariable + variableName: TARGET_ENV_PREFIX + variableValue: "c:\\users\\qt\\prefix.bat" + + # VxWorks + - type: Group + enable_if: + condition: property + property: target.osVersion + equals_value: VxWorks + instructions: + - type: EnvironmentVariable + variableName: TARGET_ENV_PREFIX + variableValue: "{{.Env.VXWORKS_HOME}}/wrenv.linux" + + # QNX variables + - type: Group + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Linux + - condition: property + property: target.os + equals_value: QNX + instructions: + - type: EnvironmentVariable + variableName: QNX_TARGET + variableValue: "{{.Env.QNX_710}}/target/qnx7" + - type: EnvironmentVariable + variableName: QNX_CONFIGURATION_EXCLUSIVE + variableValue: "{{.Env.HOME}}/.qnx" + - type: EnvironmentVariable + variableName: QNX_CONFIGURATION + variableValue: "{{.Env.HOME}}/.qnx" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.QNX_710}}/host/linux/x86_64/usr/bin:" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.QNX_710}}/host/common/bin:" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.HOME}}/.qnx:" + - type: EnvironmentVariable + variableName: QNX_HOST + variableValue: "{{.Env.QNX_710}}/host/linux/x86_64" + - type: AppendToEnvironmentVariable + variableName: PATH + variableValue: ":{{.Env.QEMUARMV7_TOOLCHAIN_SYSROOT}}/../x86_64-pokysdk-linux/usr/bin:" + + - type: Group + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: target.os + equals_value: QNX + instructions: + - type: EnvironmentVariable + variableName: QNX_TARGET + variableValue: "{{.Env.QNX_710_CMAKE}}/target/qnx7" + - type: EnvironmentVariable + variableName: QNX_CONFIGURATION_EXCLUSIVE + variableValue: "{{.Env.HOMEPATH}}\\.qnx" + - type: EnvironmentVariable + variableName: QNX_CONFIGURATION + variableValue: "{{.Env.HOMEPATH}}\\.qnx" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.QNX_710}}\\host\\win64\\x86_64\\usr\\bin;" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.QNX_710}}\\host\\common\\bin;" + - type: PrependToEnvironmentVariable + variableName: PATH + variableValue: "{{.Env.HOMEPATH}}\\.qnx;" + - type: EnvironmentVariable + variableName: QNX_HOST + variableValue: "{{.Env.QNX_710}}\\host\\win64\\x86_64" + + # Enable warnings are errors + - type: Group + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DWARNINGS_ARE_ERRORS=ON" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DWARNINGS_ARE_ERRORS=ON" + enable_if: + condition: property + property: features + contains_value: WarningsAreErrors + + - type: Group + enable_if: + condition: property + property: features + contains_value: UseAddressSanitizer + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DFEATURE_sanitize_address=ON" + disable_if: + condition: property + property: features + contains_value: UseConfigure + - type: AppendToEnvironmentVariable + variableName: CONFIGURE_ARGS + variableValue: " -sanitize address" + enable_if: + condition: property + property: features + contains_value: UseConfigure + + - type: Group + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_NON_QTBASE_CMAKE_ARGS + variableValue: " -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_TEST_CMAKE_ARGS + variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_EXAMPLES_CMAKE_ARGS + variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_NON_QTBASE_TARGET_CMAKE_ARGS + variableValue: " -DQT_BUILD_TESTS=OFF -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_EXAMPLES_CMAKE_ARGS + variableValue: " -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_MESSAGE_LOG_LEVEL=STATUS" + + # Sccache + - type: Group + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_NON_QTBASE_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_TEST_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_EXAMPLES_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_NON_QTBASE_TARGET_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_TEST_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_EXAMPLES_CMAKE_ARGS + variableValue: " -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache" + enable_if: + condition: property + property: features + contains_value: Sccache + + # Specify a custom examples installation directory, so that the built example binaries are not + # packaged into the artifact archive together with the Qt libraries. + # Also specify that during examples deployment, only a subset of examples should be deployed, to + # save time and space. + - type: Group + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DQT_INTERNAL_EXAMPLES_INSTALL_PREFIX={{unixPathSeparators .BuildDir}}/installed_examples" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DQT_INTERNAL_EXAMPLES_INSTALL_PREFIX={{unixPathSeparators .BuildDir}}/installed_examples" + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DQT_DEPLOY_MINIMAL_EXAMPLES=ON" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DQT_DEPLOY_MINIMAL_EXAMPLES=ON" + - type: Group + instructions: + - type: AppendToEnvironmentVariable + variableName: COMMON_CMAKE_ARGS + variableValue: " -DQT_INTERNAL_CI_NO_BUILD_IN_TREE_EXAMPLES=ON" + - type: AppendToEnvironmentVariable + variableName: COMMON_TARGET_CMAKE_ARGS + variableValue: " -DQT_INTERNAL_CI_NO_BUILD_IN_TREE_EXAMPLES=ON" + enable_if: + condition: property + property: features + contains_value: StandaloneExamples + enable_if: + # Only set the custom installation dir if examples are built. + condition: or + conditions: + # qtbase host case + - condition: runtime + env_var: CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # qtbase target case + - condition: runtime + env_var: TARGET_CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # non-qtbase host case + - condition: runtime + env_var: NON_QTBASE_CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # non-qtbase target case + - condition: runtime + env_var: NON_QTBASE_TARGET_CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # Same as above, but for configurations marked with UseConfigure + # qtbase host case + - condition: runtime + env_var: CONFIGURE_ARGS + contains_value: "-make examples" + # qtbase target case + - condition: runtime + env_var: TARGET_CONFIGURE_ARGS + contains_value: "-make examples" + # non-qtbase host case + - condition: runtime + env_var: NON_QTBASE_CONFIGURE_ARGS + contains_value: "-make examples" + # non-qtbase target case + - condition: runtime + env_var: NON_QTBASE_TARGET_CONFIGURE_ARGS + contains_value: "-make examples" + + - type: SetEnvironmentFromScript + command: [C:\Utils\emsdk\emsdk_env.bat] + userMessageOnFailure: "Failed to set emscripten environment" + maxTimeInSeconds: 60 + maxTimeBetweenOutput: 60 + enable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + contains_value: WebAssembly + - condition: property + property: host.os + contains_value: Windows + + - type: EnvironmentVariable + variableName: HOST_INSTALL_DIR + variableValue: "{{$android_host_artifact_path := index .Env \"QT_CI_ARTIFACT_ID_PATH_Android-host\" }}{{index .Env $android_host_artifact_path}}/install" + enable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Android_ANY + - condition: property + property: target.arch + equals_value: Multi + + - type: EnvironmentVariable + variableName: HOST_INSTALL_DIR + variableValue: "{{.InstallDir}}" + disable_if: + condition: and + conditions: + - condition: property + property: target.osVersion + equals_value: Android_ANY + - condition: property + property: target.arch + equals_value: Multi + + - type: EnvironmentVariable + variableName: LIBEXEC_INSTALL_DIR + variableValue: "{{.Env.HOST_INSTALL_DIR}}\\bin\\" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: LIBEXEC_INSTALL_DIR + variableValue: "{{.Env.HOST_INSTALL_DIR}}/libexec/" + disable_if: + condition: property + property: host.os + equals_value: Windows + + - type: EnvironmentVariable + variableName: COIN_COMMAND_OUTPUT_TIMEOUT + variableValue: "900" + disable_if: + condition: property + property: features + contains_value: UseAddressSanitizer + - type: EnvironmentVariable + variableName: COIN_COMMAND_OUTPUT_TIMEOUT + variableValue: "10800" + enable_if: + condition: property + property: features + contains_value: UseAddressSanitizer diff --git a/coin/instructions/prepare_configure_executable.yaml b/coin/instructions/prepare_configure_executable.yaml new file mode 100644 index 0000000000..e053028237 --- /dev/null +++ b/coin/instructions/prepare_configure_executable.yaml @@ -0,0 +1,35 @@ +# Call either cmake or configure depending on whether the +# UseConfigure platform configuration feature is set. +# We should remove the cmake branch, once all platform configurations +# are ported to use configure. +type: Group +instructions: + - type: Group + enable_if: + condition: property + property: features + contains_value: UseConfigure + instructions: + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.SourceDir}}/configure" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.SourceDir}}\\configure.bat" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: Group + disable_if: + condition: property + property: features + contains_value: UseConfigure + instructions: + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "cmake" diff --git a/coin/instructions/prepare_configure_module_executable.yaml b/coin/instructions/prepare_configure_module_executable.yaml new file mode 100644 index 0000000000..a28359e3fd --- /dev/null +++ b/coin/instructions/prepare_configure_module_executable.yaml @@ -0,0 +1,46 @@ +# Call either qt-cmake or qt-configure-module depending on whether the +# UseConfigure platform configuration feature is set. +# We should remove the cmake branch, once all platform configurations +# are ported to use configure. +type: Group +instructions: + - type: Group + enable_if: + condition: property + property: features + contains_value: UseConfigure + instructions: + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.InstallDir}}{{.Env.INSTALL_DIR_SUFFIX}}{{.Env.CI_PATH_SEP}}bin{{.Env.CI_PATH_SEP}}qt-configure-module" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.InstallDir}}{{.Env.INSTALL_DIR_SUFFIX}}{{.Env.CI_PATH_SEP}}bin{{.Env.CI_PATH_SEP}}qt-configure-module.bat" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: Group + disable_if: + condition: property + property: features + contains_value: UseConfigure + instructions: + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.InstallDir}}{{.Env.INSTALL_DIR_SUFFIX}}{{.Env.CI_PATH_SEP}}libexec{{.Env.CI_PATH_SEP}}qt-cmake-private" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: CONFIGURE_EXECUTABLE + variableValue: "{{.InstallDir}}{{.Env.INSTALL_DIR_SUFFIX}}{{.Env.CI_PATH_SEP}}bin{{.Env.CI_PATH_SEP}}qt-cmake-private.bat" + enable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/prepare_install_dir_suffix_host.yaml b/coin/instructions/prepare_install_dir_suffix_host.yaml new file mode 100644 index 0000000000..30cf77a6c1 --- /dev/null +++ b/coin/instructions/prepare_install_dir_suffix_host.yaml @@ -0,0 +1,16 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: INSTALL_DIR_SUFFIX + variableValue: "/host" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: INSTALL_DIR_SUFFIX + variableValue: "\\host" + enable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/prepare_install_dir_suffix_target.yaml b/coin/instructions/prepare_install_dir_suffix_target.yaml new file mode 100644 index 0000000000..e53519430e --- /dev/null +++ b/coin/instructions/prepare_install_dir_suffix_target.yaml @@ -0,0 +1,16 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: INSTALL_DIR_SUFFIX + variableValue: "/target" + disable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: INSTALL_DIR_SUFFIX + variableValue: "\\target" + enable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/qmake/call_make.yaml b/coin/instructions/qmake/call_make.yaml new file mode 100644 index 0000000000..59babe9e0c --- /dev/null +++ b/coin/instructions/qmake/call_make.yaml @@ -0,0 +1,55 @@ +type: Group +instructions: + # Call jom when host os is Windows + MSVC + - type: Group + instructions: + # Clear the automatically set MAKEFLAGS variable + - type: EnvironmentVariable + variableName: MAKEFLAGS + variableValue: "" + # Call jom + - type: ExecuteCommand + command: "{{.Env.ENV_PREFIX}} {{.Env.CI_JOM_PATH}}\\jom.exe" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call jom. + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + not_contains_value: "Mingw" + # Call make when host os is not Windows (Linux, macOS) + - type: ExecuteCommand + command: "{{.Env.CALL_MAKE_ENV_PREFIX}} make" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call make. + enable_if: + condition: property + property: target.os + not_equals_value: Windows + # Call mingw32-make when host os is Windows + MinGW (this includes building for Android) + - type: ExecuteCommand + command: "{{.Env.CALL_MAKE_ENV_PREFIX}} mingw32-make" + executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to call mingw32-make. + enable_if: + condition: and + conditions: + - condition: property + property: host.os + equals_value: Windows + - condition: property + property: host.compiler + contains_value: "Mingw" diff --git a/coin/instructions/qmake/ensure_pro_file.cmake b/coin/instructions/qmake/ensure_pro_file.cmake new file mode 100644 index 0000000000..d879128601 --- /dev/null +++ b/coin/instructions/qmake/ensure_pro_file.cmake @@ -0,0 +1,19 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +# CMake script to ensure that a qmake project file exists. +# +# Usage: cmake -DPRO_FILE=.../project.pro -P .../ensure_pro_file.cmake +# +# This script checks for existence of ${PRO_FILE} and creates a fake one, if needed. +# + +if(NOT EXISTS "${PRO_FILE}") + get_filename_component(dir "${PRO_FILE}" DIRECTORY) + if(NOT IS_DIRECTORY "${dir}") + file(MAKE_DIRECTORY "${dir}") + endif() + + file(WRITE "${PRO_FILE}" "TEMPLATE = aux +") +endif() diff --git a/coin/instructions/qmake/get_qmake_location_host.yaml b/coin/instructions/qmake/get_qmake_location_host.yaml new file mode 100644 index 0000000000..e43602a9a2 --- /dev/null +++ b/coin/instructions/qmake/get_qmake_location_host.yaml @@ -0,0 +1,16 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: COIN_QMAKE_LOCATION + variableValue: "{{.InstallDir}}\\bin\\qmake" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: COIN_QMAKE_LOCATION + variableValue: "{{.InstallDir}}/bin/qmake" + disable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/instructions/qmake/get_qmake_location_target.yaml b/coin/instructions/qmake/get_qmake_location_target.yaml new file mode 100644 index 0000000000..13940bdad2 --- /dev/null +++ b/coin/instructions/qmake/get_qmake_location_target.yaml @@ -0,0 +1,29 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: COIN_QMAKE_LOCATION + variableValue: "{{.InstallDir}}\\target\\bin\\qmake.bat" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: Group + disable_if: + condition: property + property: host.os + equals_value: Windows + instructions: + - type: EnvironmentVariable + variableName: COIN_QMAKE_LOCATION + variableValue: "{{.InstallDir}}/target/bin/qmake" + disable_if: + condition: property + property: target.osVersion + equals_value: QEMU + - type: EnvironmentVariable + variableName: COIN_QMAKE_LOCATION + variableValue: "{{.InstallDir}}/target/bin/host-qmake" + enable_if: + condition: property + property: target.osVersion + equals_value: QEMU diff --git a/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml b/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml new file mode 100644 index 0000000000..9bb765642d --- /dev/null +++ b/coin/instructions/qmake_examples/build_qmake_examples_inner_instructions.yaml @@ -0,0 +1,71 @@ +type: Group +instructions: + - type: Group + instructions: + # Prepare directories to build examples with qmake. + - type: ChangeDirectory + directory: "{{.SourceDir}}" + - type: MakeDirectory + directory: "{{.SourceDir}}_qmake/examples" + - type: SetBuildDirectory + directory: "{{.SourceDir}}_qmake/examples" + - type: ChangeDirectory + directory: "{{.BuildDir}}" + - !include "{{qt/qtbase}}/qmake_examples/get_examples_source_location.yaml" + + # Setup qemu cross-compiled qmake to work. + - !include "{{qt/qtbase}}/coin_module_test_qemu_env_vars.yaml" + + # Set either host or target env prefix for qmake and make depending on + # tested configuration. + - type: Group + instructions: + - type: EnvironmentVariable + variableName: CALL_MAKE_ENV_PREFIX + variableValue: "{{.Env.ENV_PREFIX}}" + enable_if: + condition: runtime + env_var: COIN_CONFIG_TYPE + equals_value: "Host" + - type: EnvironmentVariable + variableName: CALL_MAKE_ENV_PREFIX + variableValue: "{{.Env.TARGET_ENV_PREFIX}}" + enable_if: + condition: runtime + env_var: COIN_CONFIG_TYPE + equals_value: "Target" + + # Ensure that we have an examples/examples.pro file. + # If it doesn't exist, write a dummy project file. + # The CMake that does this is installed to INSTALL_LIBEXEC, which defaults to "bin" on Windows. + - type: ExecuteCommand + enable_if: + condition: property + property: host.os + equals_value: Windows + command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}\\examples\\examples.pro -P {{.InstallDir}}\\bin\\ensure_pro_file.cmake" + maxTimeInSeconds: 20 + maxTimeBetweenOutput: 20 + userMessageOnFailure: > + Failed to run cmake -P ensure_pro_file.cmake + - type: ExecuteCommand + disable_if: + condition: property + property: host.os + equals_value: Windows + command: "cmake --trace-expand -DPRO_FILE={{.SourceDir}}/examples/examples.pro -P {{.InstallDir}}/libexec/ensure_pro_file.cmake" + maxTimeInSeconds: 20 + maxTimeBetweenOutput: 20 + userMessageOnFailure: > + Failed to run cmake -P ensure_pro_file.cmake + + # Run qmake to configure the examples. The env prefix is important for qemu. + - type: ExecuteCommand + command: "{{.Env.CALL_MAKE_ENV_PREFIX}} {{.Env.COIN_QMAKE_LOCATION}} {{.Env.COIN_EXAMPLES_SOURCE_LOCATION}}" + maxTimeInSeconds: 6000 + maxTimeBetweenOutput: 1200 + userMessageOnFailure: > + Failed to run qmake to build examples. + + # Run make to build the examples. + - !include "{{qt/qtbase}}/qmake/call_make.yaml" diff --git a/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml b/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml new file mode 100644 index 0000000000..bbc31f7676 --- /dev/null +++ b/coin/instructions/qmake_examples/build_qmake_examples_instructions.yaml @@ -0,0 +1,31 @@ +type: Group +instructions: + # Only enable building examples if -DQT_BUILD_EXAMPLES=ON was passed to the CMake config in some + # form. The variable to check unfortunately depends on host vs target, and qtbase vs non-qtbase. + - type: Group + instructions: + - !include "{{qt/qtbase}}/qmake_examples/build_qmake_examples_inner_instructions.yaml" + enable_if: + condition: or + conditions: + # qtbase host case + - condition: runtime + env_var: CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # qtbase target case + - condition: runtime + env_var: TARGET_CONFIGURE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # non-qtbase host case + # non-qtbase target case + - condition: runtime + env_var: COIN_CMAKE_ARGS + contains_value: "QT_BUILD_EXAMPLES=ON" + # host case + - condition: runtime + env_var: CONFIGURE_ARGS + contains_value: "-make examples" + # target case + - condition: runtime + env_var: TARGET_CONFIGURE_ARGS + contains_value: "-make examples" diff --git a/coin/instructions/qmake_examples/get_examples_source_location.yaml b/coin/instructions/qmake_examples/get_examples_source_location.yaml new file mode 100644 index 0000000000..ca360e8727 --- /dev/null +++ b/coin/instructions/qmake_examples/get_examples_source_location.yaml @@ -0,0 +1,16 @@ +type: Group +instructions: + - type: EnvironmentVariable + variableName: COIN_EXAMPLES_SOURCE_LOCATION + variableValue: "{{.SourceDir}}\\examples" + enable_if: + condition: property + property: host.os + equals_value: Windows + - type: EnvironmentVariable + variableName: COIN_EXAMPLES_SOURCE_LOCATION + variableValue: "{{.SourceDir}}/examples" + disable_if: + condition: property + property: host.os + equals_value: Windows diff --git a/coin/module_config.yaml b/coin/module_config.yaml index 6d7f067ebc..118881159b 100644 --- a/coin/module_config.yaml +++ b/coin/module_config.yaml @@ -4,9 +4,16 @@ accept_configuration: property: features not_contains_value: Disable +machine_type: + Build: + cores: 8 + Test: + cores: 4 + instructions: Build: - !include "{{qt/qtbase}}/coin_qtbase_build_template_v2.yaml" Test: - !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml" + - !include "{{qt/qtbase}}/coin_qtbase_test_docs.yaml" |