From 063aba910d6287c062528102523e0ae1965d39a3 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 27 Jul 2020 16:59:51 +0200 Subject: [PATCH] core: rename emulator to trezor-emu-core --- ci/build.yml | 10 +++++----- ci/deploy.yml | 2 +- ci/test.yml | 6 +++--- core/Makefile | 8 ++++---- core/SConscript.unix | 2 +- core/emu.py | 2 +- core/emu.sh | 2 +- core/tests/run_tests.sh | 2 +- core/tests/run_tests_click_emu.sh | 2 +- tests/emulators.py | 2 +- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ci/build.yml b/ci/build.yml index 04249bad3d..0fee26b95e 100644 --- a/ci/build.yml +++ b/ci/build.yml @@ -67,7 +67,7 @@ core unix regular build: artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - - core/build/unix/micropython + - core/build/unix/trezor-emu-core - core/src/trezor/res/resources.py expire_in: 1 week @@ -78,7 +78,7 @@ core unix frozen regular build: artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - - core/build/unix/micropython + - core/build/unix/trezor-emu-core expire_in: 1 week core unix frozen btconly debug build: @@ -88,11 +88,11 @@ core unix frozen btconly debug build: BITCOIN_ONLY: "1" script: - nix-shell --run "pipenv run make -C core build_unix_frozen" - - mv core/build/unix/micropython core/build/unix/micropython-bitcoinonly + - mv core/build/unix/trezor-emu-core core/build/unix/trezor-emu-core-bitcoinonly artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" paths: - - core/build/unix/micropython-bitcoinonly + - core/build/unix/trezor-emu-core-bitcoinonly expire_in: 1 week core unix frozen debug build: @@ -114,7 +114,7 @@ core unix frozen regular darwin: script: - nix-shell --run "pipenv run make -C core build_unix_frozen" - mkdir -p TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/{MacOS,libs} - - cp -v core/build/unix/micropython TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA + - cp -v core/build/unix/trezor-emu-core TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA - dylibbundler -of -b -i /usr/lib/system -d TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/libs -x TrezorEmu-$CI_COMMIT_SHORT_SHA.app/Contents/MacOS/TrezorEmu-$CI_COMMIT_SHORT_SHA - mv TrezorEmu-$CI_COMMIT_SHORT_SHA.app trezor-emu-regular-macos-$CORE_VERSION-$CI_COMMIT_SHORT_SHA.app allow_failure: true diff --git a/ci/deploy.yml b/ci/deploy.yml index b790a4b12c..629a8d53fb 100644 --- a/ci/deploy.yml +++ b/ci/deploy.yml @@ -227,7 +227,7 @@ upgrade tests core deploy: - "[[ $TAG == '' ]] && echo 'Tag is not core/*: exiting.' && exit 1" - DEST=${DEPLOY_PATH}/trezor-emu-$TAG - echo "Deploying to $DEST" - - rsync --delete -va core/build/unix/micropython "$DEST" + - rsync --delete -va core/build/unix/trezor-emu-core "$DEST" only: - /^core\// except: diff --git a/ci/test.yml b/ci/test.yml index b910560319..43f9b04823 100644 --- a/ci/test.yml +++ b/ci/test.yml @@ -56,7 +56,7 @@ core btconly device test: dependencies: - core unix frozen btconly debug build variables: - MICROPYTHON: "build/unix/micropython-bitcoinonly" + MICROPYTHON: "build/unix/trezor-emu-core-bitcoinonly" TREZOR_PYTEST_SKIP_ALTCOINS: 1 script: - nix-shell --run "pipenv run make -C core test_emu" @@ -112,9 +112,9 @@ core fido2 test: variables: TREZOR_PROFILING: 1 script: - - pgrep micropython || true + - pgrep trezor-emu-core || true - nix-shell --run "pipenv run make -C core test_emu_fido2" - - pgrep micropython || true + - pgrep trezor-emu-core || true - mv core/src/.coverage core/.coverage.test_emu_fido2 artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_SHORT_SHA" diff --git a/core/Makefile b/core/Makefile index 580c5b3934..e8cebf71c0 100644 --- a/core/Makefile +++ b/core/Makefile @@ -67,7 +67,7 @@ res: templates ## update resources ## emulator commands: run: ## run unix port - cd src ; ../$(UNIX_BUILD_DIR)/micropython + cd src ; ../$(UNIX_BUILD_DIR)/trezor-emu-core emu: ## run emulator $(EMU) @@ -139,13 +139,13 @@ build_firmware: res build_cross ## build firmware with frozen modules $(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" RDI="$(RDI)" $(FIRMWARE_BUILD_DIR)/firmware.bin build_unix: res ## build unix port - $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) BITCOIN_ONLY="$(BITCOIN_ONLY)" + $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) BITCOIN_ONLY="$(BITCOIN_ONLY)" build_unix_frozen: res build_cross ## build unix port with frozen modules - $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_FROZEN=1 + $(SCONS) CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) PYOPT="$(PYOPT)" BITCOIN_ONLY="$(BITCOIN_ONLY)" TREZOR_EMULATOR_FROZEN=1 build_unix_debug: res ## build unix port - $(SCONS) --max-drift=1 CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/micropython $(UNIX_PORT_OPTS) TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1 + $(SCONS) --max-drift=1 CFLAGS="$(CFLAGS)" $(UNIX_BUILD_DIR)/trezor-emu-core $(UNIX_PORT_OPTS) TREZOR_EMULATOR_ASAN=1 TREZOR_EMULATOR_DEBUGGABLE=1 build_cross: ## build mpy-cross port $(MAKE) -C vendor/micropython/mpy-cross $(CROSS_PORT_OPTS) diff --git a/core/SConscript.unix b/core/SConscript.unix index e06dd8ca81..31ff20c54e 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -565,6 +565,6 @@ if EVERYTHING: env.Depends(obj_program, secp256k1_zkp_ecmult_static_context) program = env.Command( - target='micropython', + target='trezor-emu-core', source=obj_program, action='$CC -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $LINKFLAGS', ) diff --git a/core/emu.py b/core/emu.py index 542c9edfd8..6863aa5f42 100755 --- a/core/emu.py +++ b/core/emu.py @@ -22,7 +22,7 @@ except Exception: HERE = Path(__file__).parent.resolve() -MICROPYTHON = HERE / "build" / "unix" / "micropython" +MICROPYTHON = HERE / "build" / "unix" / "trezor-emu-core" SRC_DIR = HERE / "src" PROFILING_WRAPPER = HERE / "prof" / "prof.py" diff --git a/core/emu.sh b/core/emu.sh index d71c8cf8b0..257be963aa 100755 --- a/core/emu.sh +++ b/core/emu.sh @@ -13,4 +13,4 @@ else cd "src${TREZOR_MODEL}" fi -../build/unix/micropython -O$PYOPT -X heapsize=20M +../build/unix/trezor-emu-core -O$PYOPT -X heapsize=20M diff --git a/core/tests/run_tests.sh b/core/tests/run_tests.sh index 204eae110e..7c3cefe77c 100755 --- a/core/tests/run_tests.sh +++ b/core/tests/run_tests.sh @@ -3,7 +3,7 @@ declare -a results declare -i passed=0 failed=0 exit_code=0 declare COLOR_GREEN='\e[32m' COLOR_RED='\e[91m' COLOR_RESET='\e[39m' -MICROPYTHON="${MICROPYTHON:-../build/unix/micropython -X heapsize=1M}" +MICROPYTHON="${MICROPYTHON:-../build/unix/trezor-emu-core -X heapsize=1M}" print_summary() { echo diff --git a/core/tests/run_tests_click_emu.sh b/core/tests/run_tests_click_emu.sh index 15137eac40..12d3111f45 100755 --- a/core/tests/run_tests_click_emu.sh +++ b/core/tests/run_tests_click_emu.sh @@ -3,7 +3,7 @@ : "${RUN_TEST_EMU:=1}" CORE_DIR="$(SHELL_SESSION_FILE='' && cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" -MICROPYTHON="${MICROPYTHON:-$CORE_DIR/build/unix/micropython}" +MICROPYTHON="${MICROPYTHON:-$CORE_DIR/build/unix/trezor-emu-core}" TREZOR_SRC="${CORE_DIR}/src" DISABLE_ANIMATION=1 diff --git a/tests/emulators.py b/tests/emulators.py index d46bdd6eef..cf07170270 100644 --- a/tests/emulators.py +++ b/tests/emulators.py @@ -24,7 +24,7 @@ ROOT = Path(__file__).parent.parent.resolve() BINDIR = ROOT / "tests" / "emulators" LOCAL_BUILD_PATHS = { - "core": ROOT / "core" / "build" / "unix" / "micropython", + "core": ROOT / "core" / "build" / "unix" / "trezor-emu-core", "legacy": ROOT / "legacy" / "firmware" / "trezor.elf", }