Merge branch 'fz-dev' into dev

This commit is contained in:
MX 2022-09-24 21:56:17 +03:00
commit 038d098c85
No known key found for this signature in database
GPG key ID: 6C4C311DFD4B4AB5
6 changed files with 38 additions and 4 deletions

View file

@ -166,4 +166,4 @@ Games:
- `site_scons` - Build helpers - `site_scons` - Build helpers
- `scripts` - Supplementary scripts and python libraries home - `scripts` - Supplementary scripts and python libraries home
Also pay attention to `ReadMe.md` files inside of those directories. Also pay attention to `ReadMe.md` files inside those directories.

View file

@ -14,4 +14,4 @@ def resolve_port(logger, portname: str = "auto"):
logger.error("Failed to find connected Flipper") logger.error("Failed to find connected Flipper")
elif len(flippers) > 1: elif len(flippers) > 1:
logger.error("More than one Flipper is attached") logger.error("More than one Flipper is attached")
logger.error("Failed to guess which port to use. Specify --port") logger.error("Failed to guess which port to use")

View file

@ -1,13 +1,25 @@
import logging import logging
import subprocess import subprocess
from flipper.utils.cdc import resolve_port from flipper.utils.cdc import resolve_port
import os
import sys
def main(): def main():
logger = logging.getLogger() logger = logging.getLogger()
if not (port := resolve_port(logger, "auto")): if not (port := resolve_port(logger, "auto")):
logger.error("Is Flipper connected over USB and isn't in DFU mode?")
return 1 return 1
subprocess.call(["python3", "-m", "serial.tools.miniterm", "--raw", port, "230400"]) subprocess.call(
[
os.path.basename(sys.executable),
"-m",
"serial.tools.miniterm",
"--raw",
port,
"230400",
]
)
if __name__ == "__main__": if __name__ == "__main__":

View file

@ -32,6 +32,7 @@ if not "%REAL_TOOLCHAIN_VERSION%" == "%FLIPPER_TOOLCHAIN_VERSION%" (
set "HOME=%USERPROFILE%" set "HOME=%USERPROFILE%"
set "PYTHONHOME=%FBT_TOOLCHAIN_ROOT%\python" set "PYTHONHOME=%FBT_TOOLCHAIN_ROOT%\python"
set "PYTHONPATH=" set "PYTHONPATH="
set "PYTHONNOUSERSITE=1"
set "PATH=%FBT_TOOLCHAIN_ROOT%\python;%FBT_TOOLCHAIN_ROOT%\bin;%FBT_TOOLCHAIN_ROOT%\protoc\bin;%FBT_TOOLCHAIN_ROOT%\openocd\bin;%PATH%" set "PATH=%FBT_TOOLCHAIN_ROOT%\python;%FBT_TOOLCHAIN_ROOT%\bin;%FBT_TOOLCHAIN_ROOT%\protoc\bin;%FBT_TOOLCHAIN_ROOT%\openocd\bin;%PATH%"
set "PROMPT=(fbt) %PROMPT%" set "PROMPT=(fbt) %PROMPT%"

View file

@ -40,6 +40,13 @@ fbtenv_restore_env()
elif [ -n "${PROMPT:-""}" ]; then elif [ -n "${PROMPT:-""}" ]; then
PROMPT="$(echo "$PROMPT" | sed 's/\[fbt\]//g')"; PROMPT="$(echo "$PROMPT" | sed 's/\[fbt\]//g')";
fi fi
PYTHONNOUSERSITE="$SAVED_PYTHONNOUSERSITE";
PYTHONPATH="$SAVED_PYTHONPATH";
unset SAVED_PYTHONNOUSERSITE;
unset SAVED_PYTHONPATH;
unset SCRIPT_PATH; unset SCRIPT_PATH;
unset FBT_TOOLCHAIN_VERSION; unset FBT_TOOLCHAIN_VERSION;
unset FBT_TOOLCHAIN_PATH; unset FBT_TOOLCHAIN_PATH;
@ -286,6 +293,12 @@ fbtenv_main()
PATH="$TOOLCHAIN_ARCH_DIR/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/bin:$PATH";
PATH="$TOOLCHAIN_ARCH_DIR/protobuf/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/protobuf/bin:$PATH";
PATH="$TOOLCHAIN_ARCH_DIR/openocd/bin:$PATH"; PATH="$TOOLCHAIN_ARCH_DIR/openocd/bin:$PATH";
SAVED_PYTHONNOUSERSITE="${PYTHONNOUSERSITE:-""}";
SAVED_PYTHONPATH="${PYTHONPATH:-""}";
PYTHONNOUSERSITE=1;
PYTHONPATH=;
} }
fbtenv_main "${1:-""}"; fbtenv_main "${1:-""}";

View file

@ -12,7 +12,15 @@ forward_os_env = {
"PATH": os.environ["PATH"], "PATH": os.environ["PATH"],
} }
# Proxying CI environment to child processes & scripts # Proxying CI environment to child processes & scripts
for env_value_name in ("WORKFLOW_BRANCH_OR_TAG", "DIST_SUFFIX", "CUSTOM_FLIPPER_NAME", "HOME", "APPDATA"): for env_value_name in (
"WORKFLOW_BRANCH_OR_TAG",
"DIST_SUFFIX",
"CUSTOM_FLIPPER_NAME",
"HOME",
"APPDATA",
"PYTHONHOME",
"PYTHONNOUSERSITE",
):
if environ_value := os.environ.get(env_value_name, None): if environ_value := os.environ.get(env_value_name, None):
forward_os_env[env_value_name] = environ_value forward_os_env[env_value_name] = environ_value