1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 20:59:50 +04:00

fbt: Deterministic STARTUP order & additional checks (#4179)

* unit_tests: clear startup order

* fam: ensure unique STARTUP order

* fbt: warn on same .order values within a group leading to non-determinitic builds

* fbt: better formatting for app order warning

---------

Co-authored-by: hedger <hedger@nanode.su>
This commit is contained in:
Anna Antonenko
2025-04-07 16:45:09 +04:00
committed by GitHub
parent eb0f5ef8c0
commit 3d02063bce
14 changed files with 28 additions and 16 deletions

View File

@@ -7,6 +7,7 @@ App(
requires=["system_settings", "cli_subghz"],
provides=["delay_test"],
resources="resources",
order=30,
)
App(
@@ -17,7 +18,7 @@ App(
entry_point="delay_test_app",
stack_size=1 * 1024,
requires=["unit_tests"],
order=110,
order=30,
)
App(

View File

@@ -7,5 +7,5 @@ App(
requires=["gui"],
stack_size=4 * 1024,
icon="A_FileManager_14",
order=0,
order=10,
)

View File

@@ -21,5 +21,5 @@ App(
appid="bt_start",
apptype=FlipperAppType.STARTUP,
entry_point="bt_on_system_start",
order=70,
order=40,
)

View File

@@ -21,7 +21,7 @@ App(
apptype=FlipperAppType.SERVICE,
entry_point="cli_vcp_srv",
stack_size=1024,
order=40,
order=10,
sdk_headers=["cli_vcp.h"],
sources=["cli_vcp.c"],
)

View File

@@ -2,5 +2,5 @@ App(
appid="crypto_start",
apptype=FlipperAppType.STARTUP,
entry_point="crypto_on_system_start",
order=10,
order=20,
)

View File

@@ -8,5 +8,5 @@ App(
],
requires=["rpc_start"],
provides=["expansion_settings"],
order=150,
order=100,
)

View File

@@ -19,5 +19,5 @@ App(
apptype=FlipperAppType.STARTUP,
entry_point="loader_on_system_start",
requires=["loader"],
order=90,
order=80,
)

View File

@@ -4,6 +4,6 @@ App(
apptype=FlipperAppType.STARTUP,
entry_point="locale_on_system_start",
cdefines=["SRV_LOCALE"],
order=90,
order=70,
sdk_headers=["locale.h"],
)

View File

@@ -22,5 +22,5 @@ App(
apptype=FlipperAppType.STARTUP,
entry_point="power_on_system_start",
requires=["power"],
order=80,
order=50,
)

View File

@@ -6,5 +6,5 @@ App(
entry_point="region_on_system_start",
cdefines=["SRV_REGION"],
requires=["storage"],
order=170,
order=120,
)

View File

@@ -16,5 +16,5 @@ App(
apptype=FlipperAppType.STARTUP,
entry_point="storage_on_system_start",
requires=["storage"],
order=90,
order=60,
)

View File

@@ -5,7 +5,7 @@ App(
entry_point="js_app",
stack_size=2 * 1024,
resources="examples",
order=0,
order=10,
provides=["js_app_start"],
sources=[
"js_app.c",
@@ -23,7 +23,7 @@ App(
appid="js_app_start",
apptype=FlipperAppType.STARTUP,
entry_point="js_app_on_system_start",
order=160,
order=110,
sources=["js_app.c"],
)

View File

@@ -27,7 +27,7 @@ App(
provides=["updater_start"],
entry_point="updater_srv",
stack_size=2 * 1024,
order=10,
order=20,
)
App(
@@ -35,5 +35,5 @@ App(
apptype=FlipperAppType.STARTUP,
entry_point="updater_on_system_start",
requires=["updater_app"],
order=110,
order=90,
)

View File

@@ -150,11 +150,22 @@ def DumpApplicationConfig(target, source, env):
print(fg.boldgreen("Firmware modules configuration:"))
for apptype in FlipperAppType:
app_sublist = env["APPBUILD"].get_apps_of_type(apptype)
if app_sublist:
# Print a warning if any apps in the list have same .order value
unique_order_values = set(app.order for app in app_sublist)
if len(app_sublist) != len(unique_order_values) and max(unique_order_values):
print(
fg.red(f"{apptype.value}: ")
+ fg.yellow(
"Duplicate .order values in group:\n\t"
+ ", ".join(f"{app.appid} ({app.order})" for app in app_sublist)
)
)
elif app_sublist:
print(
fg.green(f"{apptype.value}:\n\t"),
", ".join(app.appid for app in app_sublist),
)
if incompatible_ext_apps := env["APPBUILD"].get_incompatible_ext_apps():
print(
fg.blue("Incompatible apps (skipped):\n\t"),