Skip to content

Commit 4b596d8

Browse files
earlephilhowerdevyte
authored andcommitted
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
1 parent 0f4c9f7 commit 4b596d8

File tree

3 files changed

+55
-15
lines changed

3 files changed

+55
-15
lines changed

package/build_boards_manager_package.sh

+5
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ fi
7474
# handles tool paths differently when package is installed in hardware folder
7575
cat $srcdir/platform.txt | \
7676
$SED 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \
77+
$SED 's/runtime.tools.python.path=.*//g' | \
7778
$SED 's/runtime.tools.esptool.path={runtime.platform.path}\/tools\/esptool//g' | \
7879
$SED 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' | \
80+
$SED 's/^tools.esptool.cmd=.*//g' | \
81+
$SED 's/^tools.esptool.network_cmd=.*//g' | \
82+
$SED 's/^#tools.esptool.cmd=/tools.esptool.cmd=/g' | \
83+
$SED 's/^#tools.esptool.network_cmd=/tools.esptool.network_cmd=/g' | \
7984
$SED 's/tools.mkspiffs.path={runtime.platform.path}\/tools\/mkspiffs/tools.mkspiffs.path=\{runtime.tools.mkspiffs.path\}/g' |\
8085
$SED 's/recipe.hooks.core.prebuild.2.pattern.*//g' |\
8186
$SED "s/version=.*/version=$ver/g" |\

package/package_esp8266com_index.template.json

+36-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,41 @@
148148
"archiveFileName": "python-3.7.2.post1-embed-win32v2.zip",
149149
"checksum": "SHA-256:26665d2925ee75118bb7d8620e9ee988adc2ca3e660a9f4c06a09a06c94c0c29",
150150
"size": "6431781"
151+
},
152+
{
153+
"host": "aarch64-linux-gnu",
154+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
155+
"archiveFileName": "python-placeholder.tar.gz",
156+
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
157+
"size": "193"
158+
},
159+
{
160+
"host": "arm-linux-gnueabihf",
161+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
162+
"archiveFileName": "python-placeholder.tar.gz",
163+
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
164+
"size": "193"
165+
},
166+
{
167+
"host": "i686-pc-linux-gnu",
168+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
169+
"archiveFileName": "python-placeholder.tar.gz",
170+
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
171+
"size": "193"
172+
},
173+
{
174+
"host": "x86_64-apple-darwin",
175+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
176+
"archiveFileName": "python-placeholder.tar.gz",
177+
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
178+
"size": "193"
179+
},
180+
{
181+
"host": "x86_64-pc-linux-gnu",
182+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/python-placeholder.tar.gz",
183+
"archiveFileName": "python-placeholder.tar.gz",
184+
"checksum": "SHA-256:3b32fdb0905abf97e923ff968b6a0da8ce85d632b27845d7e2fc759778778785",
185+
"size": "193"
151186
}
152187
]
153188
},
@@ -264,4 +299,4 @@
264299
]
265300
}
266301
]
267-
}
302+
}

platform.txt

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
name=ESP8266 Boards (2.6.0-dev)
99
version=2.6.0-dev
1010

11+
# These will be removed by the packager script when doing a JSON release
1112
runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf
13+
runtime.tools.python.path={runtime.platform.path}/tools/python
14+
1215
runtime.tools.esptool.path={runtime.platform.path}/tools/esptool
1316
runtime.tools.signing={runtime.platform.path}/tools/signing.py
1417
runtime.tools.elf2bin={runtime.platform.path}/tools/elf2bin.py
1518
runtime.tools.makecorever={runtime.platform.path}/tools/makecorever.py
1619
runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf
17-
runtime.tools.python=python
18-
runtime.tools.python.windows={runtime.platform.path}/tools/python/python.exe
1920

2021
compiler.warning_flags=-w
2122
compiler.warning_flags.none=-w
@@ -66,9 +67,6 @@ compiler.elf2hex.flags=
6667

6768
compiler.size.cmd=xtensa-lx106-elf-size
6869

69-
compiler.esptool.cmd=esptool
70-
compiler.esptool.cmd.windows=esptool.exe
71-
7270
# This can be overriden in boards.txt
7371
build.extra_flags=-DESP8266
7472

@@ -83,8 +81,8 @@ compiler.elf2hex.extra_flags=
8381

8482
## generate file with git version number
8583
## needs bash, git, and echo
86-
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"
87-
recipe.hooks.core.prebuild.2.pattern="{runtime.tools.python}" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}"
84+
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"
85+
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}"
8886

8987
## Build the app.ld linker file
9088
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_
108106
recipe.objcopy.eep.pattern=
109107

110108
## Create hex
111-
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"
112-
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"
109+
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"
110+
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"
113111

114112
## Save hex
115113
recipe.output.tmp_file={build.project_name}.bin
@@ -123,12 +121,14 @@ recipe.size.regex.data=^(?:\.data|\.rodata|\.bss)\s+([0-9]+).*
123121

124122
# ------------------------------
125123

126-
# Need to duplicate the python path because Arduino does not replace properly in this stage
127-
tools.esptool.cmd=python
128-
tools.esptool.cmd.windows={runtime.platform.path}/tools/python/python.exe
129124
tools.esptool.path=
130-
tools.esptool.network_cmd=python
131-
tools.esptool.network_cmd.windows={runtime.platform.path}/tools/python/python.exe
125+
# Because the variable expansion doesn't allow one tool to find another, the following lines
126+
# will point to "{runtime.platform.path}/tools/python/python" in GIT and
127+
# "{runtime.tools.python.path}/python" for JSON board manager releases.
128+
#tools.esptool.cmd={runtime.tools.python.path}/python
129+
#tools.esptool.network_cmd={runtime.tools.python.path}/python
130+
tools.esptool.cmd={runtime.platform.path}/tools/python/python
131+
tools.esptool.network_cmd={runtime.platform.path}/tools/python/python
132132

133133
tools.esptool.upload.protocol=esp
134134
tools.esptool.upload.params.verbose=--trace

0 commit comments

Comments
 (0)