Commit Graph

30 Commits

Author SHA1 Message Date
Rémi Verschelde 39facb35a0 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.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

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.
2022-09-26 16:31:46 +02:00
Rémi Verschelde ef28da8006 CI: Bump various GitHub actions to latest versions
actions/cache@v3
actions/checkout@v3
actions/upload-artifact@v3
actions/setup-dotnet@v2
actions/setup-java@v3
actions/setup-python@v4
mymindstorm/setup-emsdk@v11

Also reset cache keys as we're going to cleanup all caches.
2022-08-25 13:44:22 +02:00
Aaron Franke 27b0f18275 Unify bits, arch, and android_arch into env["arch"]
Fully removes the `bits` option and adapts the code that relied on it.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-08-25 11:19:20 +02:00
Rémi Verschelde da14b19bbf CI: Link MoltenVK statically on macOS
Same as done for official builds.

Also make artifacts executable before zipping.
2022-07-29 14:32:57 +02:00
bruvzg 8823eae328
Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
bruvzg b2462cfd8a
[macOS] Use statically linked MoltenVK by default, automatically detect MoltenVK SDK install (only in the default location). 2022-07-03 17:11:18 +03:00
Jan Haller d38d76d039 Fix exit code of --help and --version, and test them in CI
Corrects prior regression which caused ERROR output and exit code of 1.
2022-07-02 01:17:35 +02:00
Rémi Verschelde 992794e44a
CI: Force invalidate macOS cache
I *hate* having to commit this kind of noise to our
commit history. Especially on a Friday at 10 pm.
2022-02-04 22:26:16 +01:00
Rémi Verschelde 56838ca009
CI: Rename macOS cache key to force a rebuild
The cache got corrupted and until https://github.com/actions/cache/issues/2
is prioritized we're forced to fix it up with such hacks...
2022-01-11 20:59:06 +01:00
Rémi Verschelde c4fa301b6b
CI: Build test binaries with debug symbols, then strip
This allows having good stacktraces when the tests crash.
2021-09-22 09:31:44 +02:00
Fabio Alessandrelli 3dbf008411 [CI] Refactor CI actions, use sub-actions, matrices. 2021-09-14 12:46:16 +02:00
Max Hilbrunner 5139a19877 Fix CI after concurrency 2021-08-25 15:04:05 +02:00
Max Hilbrunner 40bb1ded7e CI: Cancel previous builds if new commit is pushed 2021-08-25 14:54:48 +02:00
Gordon MacPherson 27da2e364e Fix github actions cache server being down failing builds 2021-08-18 21:58:54 +01:00
Rémi Verschelde caea551d41 CI: Build without debug symbols to reduce cache size
We often hit "Too Many Requests" errors when uploading the cache with
`actions/cache` because there's a limit of 10 GB every 5 minutes, and we can
easily go over it when we amend or merge several PRs in a short timespan.

This will make the CI artifacts less useful for debugging crashes but there's
no real way around this.
2021-02-22 11:51:55 +01:00
Rémi Verschelde 456acda57a
CI: Force building TextServer fallback
It's normally opt-in as the advanced one (CTL support) is the default,
but we need to build it to catch potential build issues.
2020-12-29 12:14:16 +01:00
Rémi Verschelde 5af5c86ebc
CI: Build with warnings=extra to catch 'em all
... on all platforms but MSVC, as it still has a number of unsolved warnings
in its `/Wall` level. Some of it might be valid, others might be overkill,
this needs further assessment and fixes. (We could also change the `extra`
level to `/W4` on MSVC if that's more meaningful.)
2020-11-09 15:01:43 +01:00
Rémi Verschelde e18a9a2224
CI: Set debug_symbols=no for template builds
This keeps their size small and allows to compare size changes on templates
in PRs, as the template size is what is most relevant to users.

For editor builds we keep debug symbols so they can be used to debug crashes.
2020-10-22 13:03:27 +02:00
Andrii Doroshenko (Xrayez) 2946535a6f CI: Refactor build workflows to use `SCONSFLAGS` 2020-10-16 14:41:30 +02:00
umarcor b8855ed732 CI: upload artifacts
Set retention-days of all artifacts to 14.
2020-10-15 20:32:16 +02:00
Rémi Verschelde 69e958b48d
CI: List contents of bin/ after build
This can be used to compare impacts on the generated files
and especially their size in PRs.
2020-10-15 19:50:49 +02:00
Hugo Locurcio 82b30f36cb
GitHub Actions: Prepend emoji to platform names for easy visual grepping 2020-08-23 15:13:36 +02:00
Andrii Doroshenko (Xrayez) ceb338d672 CI: Show `tests=yes` for builds which run tests 2020-07-30 14:00:45 +03:00
Rémi Verschelde bf257adbf5 CI: Add iOS build on GitHub Actions 2020-07-25 21:55:49 +02:00
Andrii Doroshenko (Xrayez) f6465f46b4 SCons: Add `tests` option to enable or disable unit tests 2020-07-25 18:44:18 +03:00
RevoluPowered 579342810f t Add unit testing to Godot using DocTest and added to GitHub Actions CI
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
2020-07-24 13:05:33 +01:00
Rémi Verschelde 2cf5ad9ea9 CI: Fix cache key and include base branch
The base branch is hardcoded as an env variable as I couldn't find a simple
way to just get either `3.2` or `master`. But it's easy to change when we
branch off from `master` to a new stable branch, which doesn't happen often.

(There's `{{github.base_ref}}` but it's probably more verbose like
`ref/heads/master`, and only valid for PRs.)
2020-07-24 08:28:43 +02:00
Gordon MacPherson afdce1e30c Improve the cache keys to prevent clashes for the wrong type of build 2020-07-24 00:15:23 +01:00
Gordon MacPherson 3c07d0ff32 Clamp scons cache to 4096 MB 2020-07-24 00:14:03 +01:00
Aaron Franke e5df1362df
Split CI builds into workflows for each OS 2020-07-21 15:12:16 -04:00