From a1a0d5f5e2745cd1838500f1a7179d2ecaf06f66 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 29 Dec 2019 08:33:55 -0800 Subject: [PATCH 1/2] 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 --- .../package_esp8266com_index.template.json | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index eb6dca7312..94d53d987e 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -156,38 +156,38 @@ }, { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", - "archiveFileName": "python3-placeholder.tar.gz", - "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", - "size": "191" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz", + "archiveFileName": "python3-via-env.tar.gz", + "checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3", + "size": "292" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", - "archiveFileName": "python3-placeholder.tar.gz", - "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", - "size": "191" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz", + "archiveFileName": "python3-via-env.tar.gz", + "checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3", + "size": "292" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", - "archiveFileName": "python3-placeholder.tar.gz", - "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", - "size": "191" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz", + "archiveFileName": "python3-via-env.tar.gz", + "checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3", + "size": "292" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-macosx-placeholder.tar.gz", - "archiveFileName": "python3-macosx-placeholder.tar.gz", - "checksum": "SHA-256:5bfa0d4c2dc3edeeaa913f4eac42ef3ff0bf8c8fe9f11be112a8ca7911de2dae", - "size": "198" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz", + "archiveFileName": "python3-via-env.tar.gz", + "checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3", + "size": "292" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz", - "archiveFileName": "python3-placeholder.tar.gz", - "checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850", - "size": "191" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-via-env.tar.gz", + "archiveFileName": "python3-via-env.tar.gz", + "checksum": "SHA-256:c9237bfe0f62842d7187a39495baa4a7e3ab8b87c0b433614294b023cf0bc0f3", + "size": "292" } ] }, @@ -352,4 +352,4 @@ ] } ] -} \ No newline at end of file +} From ecf2f82d3194df02402c4b30c2bd21c037760d1b Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 29 Dec 2019 12:31:06 -0800 Subject: [PATCH 2/2] 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. --- tools/get.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/get.py b/tools/get.py index 74b6b510d9..af39a10f31 100755 --- a/tools/get.py +++ b/tools/get.py @@ -121,6 +121,9 @@ def main(): if len(sys.argv) == 2: if sys.argv[1] == "-q": verbose = False + # Remove a symlink generated in 2.6.3 which causes later issues since the tarball can't properly overwrite it + if (os.path.exists('python3/python3')): + os.unlink('python3/python3') print('Platform: {0}'.format(identify_platform())) tools_to_download = load_tools_list('../package/package_esp8266com_index.template.json', identify_platform()) mkdir_p(dist_dir)