From 4b596d8fb163d340df94251b87d00567666e7cd0 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Wed, 10 Apr 2019 14:32:50 +0300 Subject: [PATCH] Fix boards-manager install issues on Linux and Windows (#5898) * Fix packaged python paths for Windows Fixes #5881 The path to python.exe on Windows needs to change depending on whether it is installed via the boards manager or GIT (similar to the compiler paths). Adjust accordingly. * Add python-placeholder to make boardsmanager happy An empty "python" directory will be created by the boards-manager installer. Required because all archs need all tools defined. * Make the placeholder include a symlink for "python" * Fix esptool windows python path Fixes a typo in the python path for Windows for upload. * Fix esptool windows python path Fixes a typo in the python path for Windows for upload. * Fix tools path when in GIT mode for upload --- package/build_boards_manager_package.sh | 5 +++ .../package_esp8266com_index.template.json | 37 ++++++++++++++++++- platform.txt | 28 +++++++------- 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/package/build_boards_manager_package.sh b/package/build_boards_manager_package.sh index f7c84e2bc..80592b3fd 100755 --- a/package/build_boards_manager_package.sh +++ b/package/build_boards_manager_package.sh @@ -74,8 +74,13 @@ fi # handles tool paths differently when package is installed in hardware folder cat $srcdir/platform.txt | \ $SED 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \ +$SED 's/runtime.tools.python.path=.*//g' | \ $SED 's/runtime.tools.esptool.path={runtime.platform.path}\/tools\/esptool//g' | \ $SED 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' | \ +$SED 's/^tools.esptool.cmd=.*//g' | \ +$SED 's/^tools.esptool.network_cmd=.*//g' | \ +$SED 's/^#tools.esptool.cmd=/tools.esptool.cmd=/g' | \ +$SED 's/^#tools.esptool.network_cmd=/tools.esptool.network_cmd=/g' | \ $SED 's/tools.mkspiffs.path={runtime.platform.path}\/tools\/mkspiffs/tools.mkspiffs.path=\{runtime.tools.mkspiffs.path\}/g' |\ $SED 's/recipe.hooks.core.prebuild.2.pattern.*//g' |\ $SED "s/version=.*/version=$ver/g" |\ diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index 78d4288be..387f636c1 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -148,6 +148,41 @@ "archiveFileName": "python-3.7.2.post1-embed-win32v2.zip", "checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29", "size": "6431781" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", + "archiveFileName": "python-placeholder.tar.gz", + "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", + "size": "193" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", + "archiveFileName": "python-placeholder.tar.gz", + "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", + "size": "193" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", + "archiveFileName": "python-placeholder.tar.gz", + "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", + "size": "193" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", + "archiveFileName": "python-placeholder.tar.gz", + "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", + "size": "193" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz", + "archiveFileName": "python-placeholder.tar.gz", + "checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785", + "size": "193" } ] }, @@ -264,4 +299,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/platform.txt b/platform.txt index 2a62afde1..706d5b9c8 100644 --- a/platform.txt +++ b/platform.txt @@ -8,14 +8,15 @@ name=ESP8266 Boards (2.6.0-dev) version=2.6.0-dev +# These will be removed by the packager script when doing a JSON release runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf +runtime.tools.python.path={runtime.platform.path}/tools/python + runtime.tools.esptool.path={runtime.platform.path}/tools/esptool runtime.tools.signing={runtime.platform.path}/tools/signing.py runtime.tools.elf2bin={runtime.platform.path}/tools/elf2bin.py runtime.tools.makecorever={runtime.platform.path}/tools/makecorever.py runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf -runtime.tools.python=python -runtime.tools.python.windows={runtime.platform.path}/tools/python/python.exe compiler.warning_flags=-w compiler.warning_flags.none=-w @@ -66,9 +67,6 @@ compiler.elf2hex.flags= compiler.size.cmd=xtensa-lx106-elf-size -compiler.esptool.cmd=esptool -compiler.esptool.cmd.windows=esptool.exe - # This can be overriden in boards.txt build.extra_flags=-DESP8266 @@ -83,8 +81,8 @@ compiler.elf2hex.extra_flags= ## generate file with git version number ## needs bash, git, and echo -recipe.hooks.core.prebuild.1.pattern="{runtime.tools.python}" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" -recipe.hooks.core.prebuild.2.pattern="{runtime.tools.python}" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +recipe.hooks.core.prebuild.1.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" +recipe.hooks.core.prebuild.2.pattern="{runtime.tools.python.path}/python" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" @@ -108,8 +106,8 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_ recipe.objcopy.eep.pattern= ## Create hex -recipe.objcopy.hex.1.pattern="{runtime.tools.python}" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin" -recipe.objcopy.hex.2.pattern="{runtime.tools.python}" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" +recipe.objcopy.hex.1.pattern="{runtime.tools.python.path}/python" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin" +recipe.objcopy.hex.2.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" ## Save hex recipe.output.tmp_file={build.project_name}.bin @@ -123,12 +121,14 @@ recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).* # ------------------------------ -# Need to duplicate the python path because Arduino does not replace properly in this stage -tools.esptool.cmd=python -tools.esptool.cmd.windows={runtime.platform.path}/tools/python/python.exe tools.esptool.path= -tools.esptool.network_cmd=python -tools.esptool.network_cmd.windows={runtime.platform.path}/tools/python/python.exe +# Because the variable expansion doesn't allow one tool to find another, the following lines +# will point to "{runtime.platform.path}/tools/python/python" in GIT and +# "{runtime.tools.python.path}/python" for JSON board manager releases. +#tools.esptool.cmd={runtime.tools.python.path}/python +#tools.esptool.network_cmd={runtime.tools.python.path}/python +tools.esptool.cmd={runtime.platform.path}/tools/python/python +tools.esptool.network_cmd={runtime.platform.path}/tools/python/python tools.esptool.upload.protocol=esp tools.esptool.upload.params.verbose=--trace