Skip to content

Commit bb6243a

Browse files
Use a python3 script to call python3 (#6960)
* Use a python3 script to call python3 It's odd, but because Windows requires a full Python3 install we must have an executable called "tools/python3/python3" to use Python3 in the toolchain. Before, we simply symlinked to /usr/bin/python3 (for Linux) or /usr/local/bin/python3 (Mac). Unfortunately, depending on the method of installation, on MacOS the Python3 executable can be in /usr/bin/python3 instead. To avoid the entire issue, unify the Mac and Linux python3 placeholders to use python3 itself to jump to the real executable. Fixes #6931 * Explicitly remove old symlink to python3 The tar extraction for the updated python3 tarball will fail on systems that already have a symlink in /tools/python3/python3 because the tar extractor attempts to open the *target of the symlink* (i.e. the actual interpreter in /usr/bin or /usr/local/bin). Add a commented hack to destroy this symlink before expanding the tarballs, if the file exists. This is safe to do since it will be overwritten by any extractions of the python3 tarball later in the process. Co-authored-by: david gauchard <[email protected]>
1 parent 0d38ea7 commit bb6243a

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

package/package_esp8266com_index.template.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -156,38 +156,38 @@
156156
},
157157
{
158158
"host": "aarch64-linux-gnu",
159-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
160-
"archiveFileName": "python3-placeholder.tar.gz",
161-
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
162-
"size": "191"
159+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz",
160+
"archiveFileName": "python3-via-env.tar.gz",
161+
"checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3",
162+
"size": "292"
163163
},
164164
{
165165
"host": "arm-linux-gnueabihf",
166-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
167-
"archiveFileName": "python3-placeholder.tar.gz",
168-
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
169-
"size": "191"
166+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz",
167+
"archiveFileName": "python3-via-env.tar.gz",
168+
"checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3",
169+
"size": "292"
170170
},
171171
{
172172
"host": "i686-pc-linux-gnu",
173-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
174-
"archiveFileName": "python3-placeholder.tar.gz",
175-
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
176-
"size": "191"
173+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz",
174+
"archiveFileName": "python3-via-env.tar.gz",
175+
"checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3",
176+
"size": "292"
177177
},
178178
{
179179
"host": "x86_64-apple-darwin",
180-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-macosx-placeholder.tar.gz",
181-
"archiveFileName": "python3-macosx-placeholder.tar.gz",
182-
"checksum": "SHA-256:5bfa0d4c2dc3edeeaa913f4eac42ef3ff0bf8c8fe9f11be112a8ca7911de2dae",
183-
"size": "198"
180+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz",
181+
"archiveFileName": "python3-via-env.tar.gz",
182+
"checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3",
183+
"size": "292"
184184
},
185185
{
186186
"host": "x86_64-pc-linux-gnu",
187-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
188-
"archiveFileName": "python3-placeholder.tar.gz",
189-
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
190-
"size": "191"
187+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz",
188+
"archiveFileName": "python3-via-env.tar.gz",
189+
"checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3",
190+
"size": "292"
191191
}
192192
]
193193
},

tools/get.py

+3
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ def main():
121121
if len(sys.argv) == 2:
122122
if sys.argv[1] == "-q":
123123
verbose = False
124+
# Remove a symlink generated in 2.6.3 which causes later issues since the tarball can't properly overwrite it
125+
if (os.path.exists('python3/python3')):
126+
os.unlink('python3/python3')
124127
print('Platform: {0}'.format(identify_platform()))
125128
tools_to_download = load_tools_list('../package/package_esp8266com_index.template.json', identify_platform())
126129
mkdir_p(dist_dir)

0 commit comments

Comments
 (0)