Skip to content

Commit

Permalink
Fix boards-manager install issues on Linux and Windows (#5898)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
earlephilhower authored and devyte committed Apr 10, 2019
1 parent 0f4c9f7 commit 4b596d8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 15 deletions.
5 changes: 5 additions & 0 deletions package/build_boards_manager_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" |\
Expand Down
37 changes: 36 additions & 1 deletion package/package_esp8266com_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
},
Expand Down Expand Up @@ -264,4 +299,4 @@
]
}
]
}
}
28 changes: 14 additions & 14 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4b596d8

Please sign in to comment.