fbt fixes pt4 (#1899)

* fbt: fixed py scripts for gdb
* fbt: removed compiled dolphin assets from tracked files; resolved cached dependency issues by globally disabling deps cache; changed dependency tracking for dolphin assets
* fbt: fix for "resources" node lookup
* toolchain: bump to v.16 with scons + x64 win binaries
* fbt: using scons from toolchain
* vscode: fixed paths for 64-bit Windows toolchain
* fbt: added colors!
* fbt: moved import validator to ansi lib coloring
* fbt: moved COMSTR vars to tools
* fbt: custom action for fap dist
* fbt: added OPENOCD_ADAPTER_SERIAL configuration var for openocd operations
* fbt: added get_stlink target
* docs: details on libs for faps
* vscode: added DAP config for using Flipper as a debugger for a 2nd Flipper
* fbt: blind deps fix for sdk_origin
* fbt: sdk: moved deployment actions to pure python
* Github: disable disableLicenseExpirationCheck option for pvs

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
hedger
2022-10-26 02:15:02 +04:00
committed by GitHub
parent 984d89c6d0
commit 0adad32418
243 changed files with 302 additions and 740 deletions

View File

@@ -171,6 +171,11 @@ vars.AddVariables(
"Blackmagic probe location",
"auto",
),
(
"OPENOCD_ADAPTER_SERIAL",
"OpenOCD adapter serial number",
"auto",
),
(
"UPDATE_SPLASH",
"Directory name with slideshow frames to render after installing update package",

View File

@@ -35,6 +35,7 @@ for env_value_name in variables_to_forward:
coreenv = VAR_ENV.Clone(
tools=[
"fbt_tweaks",
(
"crosscc",
{
@@ -80,8 +81,9 @@ if not coreenv["VERBOSE"]:
# Default value for commandline options
SetOption("num_jobs", multiprocessing.cpu_count())
## NB - disabled both caches since they seem to do more harm then good in our case
# Avoiding re-scan of all sources on every startup
SetOption("implicit_cache", True)
# SetOption("implicit_cache", True)
# SetOption("implicit_deps_unchanged", True)
# More aggressive caching
SetOption("max_drift", 1)

View File

@@ -65,6 +65,7 @@ extapps = appenv["_extapps"] = {
"debug": {},
"validators": {},
"dist": {},
"resources_dist": None,
}
@@ -108,6 +109,8 @@ appenv.PhonyTarget("firmware_extapps", appenv.Action(legacy_app_build_stub, None
Alias("faps", extapps["compact"].values())
Alias("faps", extapps["validators"].values())
extapps["resources_dist"] = appenv.FapDist(appenv.Dir("#/assets/resources/apps"), [])
if appsrc := appenv.subst("$APPSRC"):
app_manifest, fap_file, app_validator = appenv.GetExtAppFromPath(appsrc)
appenv.PhonyTarget(

View File

@@ -1,10 +1,11 @@
from fbt.util import link_dir
from ansi.color import fg
def link_elf_dir_as_latest(env, elf_node):
elf_dir = elf_node.Dir(".")
latest_dir = env.Dir("#build/latest")
print(f"Setting {elf_dir} as latest built dir (./build/latest/)")
print(fg.green(f"Linking {elf_dir} as latest built dir (./build/latest/)"))
return link_dir(latest_dir.abspath, elf_dir.abspath, env["PLATFORM"] == "win32")
@@ -12,7 +13,7 @@ def should_gen_cdb_and_link_dir(env, requested_targets):
explicitly_building_updater = False
# Hacky way to check if updater-related targets were requested
for build_target in requested_targets:
if "updater" in str(build_target):
if "updater" in str(build_target) and "package" not in str(build_target):
explicitly_building_updater = True
is_updater = not env["IS_BASE_FIRMWARE"]

View File

@@ -3,6 +3,7 @@ from SCons.Script import GetBuildFailures
import sys
import os
import atexit
from ansi.color import fg, fx
sys.path.insert(0, os.path.join(os.getcwd(), "scripts"))
sys.path.insert(0, os.path.join(os.getcwd(), "lib/cxxheaderparser"))
@@ -16,12 +17,12 @@ def bf_to_str(bf):
if bf is None: # unknown targets product None in list
return "(unknown tgt)"
elif isinstance(bf, SCons.Errors.StopError):
return str(bf)
return fg.yellow(str(bf))
elif bf.node:
return str(bf.node) + ": " + bf.errstr
return fg.yellow(str(bf.node)) + ": " + bf.errstr
elif bf.filename:
return bf.filename + ": " + bf.errstr
return "unknown failure: " + bf.errstr
return fg.yellow(bf.filename) + ": " + bf.errstr
return fg.yellow("unknown failure: ") + bf.errstr
def display_build_status():
@@ -31,10 +32,9 @@ def display_build_status():
if bf:
# bf is normally a list of build failures; if an element is None,
# it's because of a target that scons doesn't know anything about.
failures_message = "\n".join(
["Failed building %s" % bf_to_str(x) for x in bf if x is not None]
)
print("*" * 10, "ERRORS", "*" * 10)
failures_message = "\n".join([bf_to_str(x) for x in bf if x is not None])
print()
print(fg.brightred(fx.bold("*" * 10 + " FBT ERRORS " + "*" * 10)))
print(failures_message)