Skip to content

Commit

Permalink
[Tizen] Strip unit test executables to save CI storage (#34810)
Browse files Browse the repository at this point in the history
* Add support stripping all symbols from executables

* Compile Tizen with -fPIC and -pie

* Re-enable Tizen QEMU workflow
  • Loading branch information
arkq authored Aug 7, 2024
1 parent 82579f1 commit d7ad095
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/qemu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ concurrency:

env:
CHIP_NO_LOG_TIMESTAMPS: true

jobs:

qemu-esp32:
Expand Down Expand Up @@ -75,12 +75,7 @@ jobs:
name: Tizen

runs-on: ubuntu-latest
# NOTE: job temporarely disabled as it seems flaky. The flake does not result in usable
# logs so the current theory is that we run out of space. This is unusual as
# larger docker images succeed at bootstrap, however it needs more investigation
# to detect an exact/real root cause.
if: false
# if: github.actor != 'restyled-io[bot]'
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build-tizen-qemu:54
Expand Down
6 changes: 5 additions & 1 deletion build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ config("warnings_third_party") {
}

config("symbols_default") {
cflags = [ "-g${symbol_level}" ]
if (strip_symbols) {
cflags = [ "-s" ]
} else {
cflags = [ "-g${symbol_level}" ]
}
}

config("std_default") {
Expand Down
9 changes: 6 additions & 3 deletions build/config/compiler/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ declare_args() {
symbol_level = 2

# Enable position independent code (-fPIC).
enable_pic =
current_os == "linux" || current_os == "mac" || current_os == "android"
enable_pic = current_os == "linux" || current_os == "mac" ||
current_os == "android" || current_os == "tizen"

# Enable position independent executables (-pie).
enable_pie = current_os == "linux"
enable_pie = current_os == "linux" || current_os == "tizen"

# Remove unwind tables from the binary to save space.
exclude_unwind_tables = current_os != "android"
Expand All @@ -48,6 +48,9 @@ declare_args() {
# enable libfuzzer
is_libfuzzer = false

# Remove all symbol table and relocation information from the binary.
strip_symbols = false

# Generate code coverage analysis artifacts when enabled.
use_coverage = false

Expand Down
4 changes: 4 additions & 0 deletions scripts/build/builders/tizen.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def __init__(self,

if app == TizenApp.TESTS:
self.extra_gn_options.append('chip_build_tests=true')
# Tizen test driver creates ISO image with all unit test files. So,
# it uses twice as much space as regular build. Due to CI storage
# limitations, we need to strip debug symbols from executables.
self.extra_gn_options.append('strip_symbols=true')
self.build_command = 'check'

if not enable_ble:
Expand Down
2 changes: 1 addition & 1 deletion third_party/tizen/tizen_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ template("tizen_qemu_mkisofs") {
"mkisofs",
"-input-charset=default",
"-VCHIP", # Volume ID = CHIP
"-JRU", # Joliet + Rock Ridge with untranslated filenames
"-JrU", # Joliet + Rock Ridge with untranslated filenames
]

# Exclude files from the ISO image which might otherwise be included
Expand Down

0 comments on commit d7ad095

Please sign in to comment.