From 39facb35a021f9301f742732fbbd3c6a5a548893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 22 Sep 2022 08:28:55 +0200 Subject: SCons: Unify tools/target build type configuration Implements https://github.com/godotengine/godot-proposals/issues/3371. New `target` presets ==================== The `tools` option is removed and `target` changes to use three new presets, which match the builds users are familiar with. These targets control the default optimization level and enable editor-specific and debugging code: - `editor`: Replaces `tools=yes target=release_debug`. * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2` - `template_debug`: Replaces `tools=no target=release_debug`. * Defines: `DEBUG_ENABLED`, `-O2`/`/O2` - `template_release`: Replaces `tools=no target=release`. * Defines: `-O3`/`/O2` New `dev_build` option ====================== The previous `target=debug` is now replaced by a separate `dev_build=yes` option, which can be used in combination with either of the three targets, and changes the following: - `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`), enables generating debug symbols, does not define `NDEBUG` so `assert()` works in thirdparty libraries, adds a `.dev` suffix to the binary name. Note: Unlike previously, `dev_build` defaults to off so that users who compile Godot from source get an optimized and small build by default. Engine contributors should now set `dev_build=yes` in their build scripts or IDE configuration manually. Changed binary names ==================== The name of generated binaries and object files are changed too, to follow this format: `godot..[.dev][.double].[.][.]` For example: - `godot.linuxbsd.editor.dev.arm64` - `godot.windows.template_release.double.x86_64.mono.exe` Be sure to update your links/scripts/IDE config accordingly. More flexible `optimize` and `debug_symbols` options ==================================================== The optimization level and whether to generate debug symbols can be further specified with the `optimize` and `debug_symbols` options. So the default values listed above for the various `target` and `dev_build` combinations are indicative and can be replaced when compiling, e.g.: `scons p=linuxbsd target=template_debug dev_build=yes optimize=debug` will make a "debug" export template with dev-only code enabled, `-Og` optimization level for GCC/Clang, and debug symbols. Perfect for debugging complex crashes at runtime in an exported project. --- .github/workflows/linux_builds.yml | 42 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 24 deletions(-) (limited to '.github/workflows/linux_builds.yml') diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 2e8bd101e5..b0ed71a7b5 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -7,7 +7,7 @@ env: GODOT_BASE_BRANCH: master SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes DOTNET_NOLOGO: true - DOTNET_CLI_TELEMETRY_OPTOUT: false + DOTNET_CLI_TELEMETRY_OPTOUT: true concurrency: group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-linux @@ -21,57 +21,52 @@ jobs: fail-fast: false matrix: include: - - name: Editor w Mono (target=release_debug, tools=yes, tests=yes) + - name: Editor w/ Mono (target=editor) cache-name: linux-editor-mono - target: release_debug - tools: true + target: editor tests: false # Disabled due freeze caused by mix Mono build and CI sconsflags: module_mono_enabled=yes doc-test: true - bin: "./bin/godot.linuxbsd.opt.tools.x86_64.mono" + bin: "./bin/godot.linuxbsd.editor.x86_64.mono" build-mono: true proj-conv: true artifact: true - - name: Editor with doubles and GCC sanitizers (target=debug, tools=yes, float=64, tests=yes, use_asan=yes, use_ubsan=yes, linker=gold) + - name: Editor with doubles and GCC sanitizers (target=editor, tests=yes, dev_build=yes, float=64, use_asan=yes, use_ubsan=yes, linker=gold) cache-name: linux-editor-double-sanitizers - target: debug - tools: true + target: editor tests: true - sconsflags: float=64 use_asan=yes use_ubsan=yes linker=gold + sconsflags: dev_build=yes float=64 use_asan=yes use_ubsan=yes linker=gold proj-test: true # Can be turned off for PRs that intentionally break compat with godot-cpp, # until both the upstream PR and the matching godot-cpp changes are merged. godot-cpp-test: true - bin: "./bin/godot.linuxbsd.double.tools.x86_64.san" + bin: "./bin/godot.linuxbsd.editor.dev.double.x86_64.san" build-mono: false # Skip 2GiB artifact speeding up action. artifact: false - - name: Editor with clang sanitizers (target=debug, tools=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld) + - name: Editor with clang sanitizers (target=editor, tests=yes, dev_build=yes, use_asan=yes, use_ubsan=yes, use_llvm=yes, linker=lld) cache-name: linux-editor-llvm-sanitizers - target: debug - tools: true + target: editor tests: true - sconsflags: use_asan=yes use_ubsan=yes use_llvm=yes linker=lld - bin: "./bin/godot.linuxbsd.tools.x86_64.llvm.san" + sconsflags: dev_build=yes use_asan=yes use_ubsan=yes use_llvm=yes linker=lld + bin: "./bin/godot.linuxbsd.editor.dev.x86_64.llvm.san" build-mono: false # Skip 2GiB artifact speeding up action. artifact: false - - name: Template w/ Mono (target=release, tools=no) + - name: Template w/ Mono (target=template_release) cache-name: linux-template-mono - target: release - tools: false + target: template_release tests: false - sconsflags: module_mono_enabled=yes debug_symbols=no + sconsflags: module_mono_enabled=yes build-mono: false artifact: true - - name: Minimal Template (target=release, tools=no, everything disabled) + - name: Minimal template (target=template_release, everything disabled) cache-name: linux-template-minimal - target: release - tools: false + target: template_release tests: false sconsflags: modules_enabled_by_default=no disable_3d=yes disable_advanced_gui=yes deprecated=no minizip=no artifact: true @@ -113,7 +108,6 @@ jobs: sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }} platform: linuxbsd target: ${{ matrix.target }} - tools: ${{ matrix.tools }} tests: ${{ matrix.tests }} - name: Generate C# glue @@ -221,7 +215,7 @@ jobs: if: ${{ matrix.godot-cpp-test }} run: | cd godot-cpp/test - scons target=${{ matrix.target }} + scons target=debug cd ../.. - name: Prepare artifact -- cgit v1.2.3