Skip to content

Commit d7ad095

Browse files
authored
[Tizen] Strip unit test executables to save CI storage (#34810)
* Add support stripping all symbols from executables * Compile Tizen with -fPIC and -pie * Re-enable Tizen QEMU workflow
1 parent 82579f1 commit d7ad095

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.github/workflows/qemu.yaml

+2-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ concurrency:
2727

2828
env:
2929
CHIP_NO_LOG_TIMESTAMPS: true
30-
30+
3131
jobs:
3232

3333
qemu-esp32:
@@ -75,12 +75,7 @@ jobs:
7575
name: Tizen
7676

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

8580
container:
8681
image: ghcr.io/project-chip/chip-build-tizen-qemu:54

build/config/compiler/BUILD.gn

+5-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,11 @@ config("warnings_third_party") {
334334
}
335335

336336
config("symbols_default") {
337-
cflags = [ "-g${symbol_level}" ]
337+
if (strip_symbols) {
338+
cflags = [ "-s" ]
339+
} else {
340+
cflags = [ "-g${symbol_level}" ]
341+
}
338342
}
339343

340344
config("std_default") {

build/config/compiler/compiler.gni

+6-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ declare_args() {
3030
symbol_level = 2
3131

3232
# Enable position independent code (-fPIC).
33-
enable_pic =
34-
current_os == "linux" || current_os == "mac" || current_os == "android"
33+
enable_pic = current_os == "linux" || current_os == "mac" ||
34+
current_os == "android" || current_os == "tizen"
3535

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

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

51+
# Remove all symbol table and relocation information from the binary.
52+
strip_symbols = false
53+
5154
# Generate code coverage analysis artifacts when enabled.
5255
use_coverage = false
5356

scripts/build/builders/tizen.py

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def __init__(self,
117117

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

122126
if not enable_ble:

third_party/tizen/tizen_sdk.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ template("tizen_qemu_mkisofs") {
189189
"mkisofs",
190190
"-input-charset=default",
191191
"-VCHIP", # Volume ID = CHIP
192-
"-JRU", # Joliet + Rock Ridge with untranslated filenames
192+
"-JrU", # Joliet + Rock Ridge with untranslated filenames
193193
]
194194

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

0 commit comments

Comments
 (0)