fbt: reproducible manifest builds & improvements (#1801)
* fbt: reproducible manifest builds, less rebuild on small updates; scripts: assets: using timestamp from commandline af available * fbt: added app import validation for launch_app & single app build targets * fbt: COMSTR for app imports validation * docs: minor fixes * docs: markdown fix * vscode: comments for RTOS startup Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -86,12 +86,13 @@ if appenv["FORCE"]:
|
||||
Alias(appenv["FIRMWARE_BUILD_CFG"] + "_extapps", extapps["compact"].values())
|
||||
|
||||
if appsrc := appenv.subst("$APPSRC"):
|
||||
app_manifest, fap_file = appenv.GetExtAppFromPath(appsrc)
|
||||
app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc)
|
||||
appenv.PhonyTarget(
|
||||
"launch_app",
|
||||
'${PYTHON3} scripts/runfap.py ${SOURCE} --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
|
||||
source=fap_file,
|
||||
FAP_CATEGORY=app_manifest.fap_category,
|
||||
)
|
||||
appenv.Alias("launch_app", app_validator)
|
||||
|
||||
Return("extapps")
|
||||
|
@@ -38,7 +38,7 @@ class FlipperApplication:
|
||||
sdk_headers: List[str] = field(default_factory=list)
|
||||
# .fap-specific
|
||||
sources: List[str] = field(default_factory=lambda: ["*.c*"])
|
||||
fap_version: Tuple[int] = field(default_factory=lambda: (0, 0))
|
||||
fap_version: Tuple[int] = field(default_factory=lambda: (0, 1))
|
||||
fap_icon: Optional[str] = None
|
||||
fap_libs: List[str] = field(default_factory=list)
|
||||
fap_category: str = ""
|
||||
|
@@ -3,6 +3,11 @@ import datetime
|
||||
from functools import cache
|
||||
|
||||
|
||||
@cache
|
||||
def get_git_commit_unix_timestamp():
|
||||
return int(subprocess.check_output(["git", "show", "-s", "--format=%ct"]))
|
||||
|
||||
|
||||
@cache
|
||||
def get_fast_git_version_id():
|
||||
try:
|
||||
|
@@ -37,7 +37,15 @@ def BuildAppElf(env, app):
|
||||
APP=app,
|
||||
)
|
||||
|
||||
env.Depends(app_elf_augmented, [env["SDK_DEFINITION"], env.Value(app)])
|
||||
manifest_vals = vars(app)
|
||||
manifest_vals = {
|
||||
k: v for k, v in manifest_vals.items() if k not in ("_appdir", "_apppath")
|
||||
}
|
||||
|
||||
env.Depends(
|
||||
app_elf_augmented,
|
||||
[env["SDK_DEFINITION"], env.Value(manifest_vals)],
|
||||
)
|
||||
if app.fap_icon:
|
||||
env.Depends(
|
||||
app_elf_augmented,
|
||||
@@ -47,6 +55,7 @@ def BuildAppElf(env, app):
|
||||
|
||||
app_elf_import_validator = env.ValidateAppImports(app_elf_augmented)
|
||||
env.AlwaysBuild(app_elf_import_validator)
|
||||
env.Alias(app_alias, app_elf_import_validator)
|
||||
return (app_elf_augmented, app_elf_raw, app_elf_import_validator)
|
||||
|
||||
|
||||
@@ -100,9 +109,13 @@ def GetExtAppFromPath(env, app_dir):
|
||||
|
||||
app_elf = env["_extapps"]["compact"].get(app.appid, None)
|
||||
if not app_elf:
|
||||
raise UserError(f"No external app found for {app.appid}")
|
||||
raise UserError(
|
||||
f"Application {app.appid} is not configured for building as external"
|
||||
)
|
||||
|
||||
return (app, app_elf[0])
|
||||
app_validator = env["_extapps"]["validators"].get(app.appid, None)
|
||||
|
||||
return (app, app_elf[0], app_validator[0])
|
||||
|
||||
|
||||
def generate(env, **kw):
|
||||
@@ -138,7 +151,7 @@ def generate(env, **kw):
|
||||
),
|
||||
Action(
|
||||
validate_app_imports,
|
||||
None, # "$APPCHECK_COMSTR",
|
||||
"$APPCHECK_COMSTR",
|
||||
),
|
||||
],
|
||||
suffix=".impsyms",
|
||||
|
Reference in New Issue
Block a user