Skip to content

Commit 85c77a9

Browse files
authored
Fix CI Builds for Linux (#3313)
1 parent c8e3f0c commit 85c77a9

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

.github/scripts/install-arduino-core-esp32.sh

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
1818
fi
1919

2020
cd esp32 && \
21-
echo "Updating submodules..." && \
21+
echo "Updating Submodules..." && \
2222
git submodule update --init --recursive > /dev/null 2>&1
2323
if [ $? -ne 0 ]; then echo "ERROR: Submodule update failed"; exit 1; fi
2424

@@ -32,8 +32,8 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
3232
if [ $? -ne 0 ]; then echo "ERROR: Install failed"; exit 1; fi
3333
fi
3434

35-
echo "Downloading the tools and the toolchain..."
36-
cd tools && python get.py > /dev/null
35+
echo "Installing Platform Tools..."
36+
cd tools && python get.py
3737
if [ $? -ne 0 ]; then echo "ERROR: Download failed"; exit 1; fi
3838
cd $script_init_path
3939

tools/get.py

+8-13
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def report_progress(count, blockSize, totalSize):
6060

6161
def unpack(filename, destination):
6262
dirname = ''
63-
print('Extracting {0}'.format(os.path.basename(filename)))
63+
print('Extracting {0} ...'.format(os.path.basename(filename)))
6464
sys.stdout.flush()
6565
if filename.endswith('tar.gz'):
6666
tfile = tarfile.open(filename, 'r:gz')
@@ -76,7 +76,7 @@ def unpack(filename, destination):
7676
# a little trick to rename tool directories so they don't contain version number
7777
rename_to = re.match(r'^([a-z][^\-]*\-*)+', dirname).group(0).strip('-')
7878
if rename_to != dirname:
79-
print('Renaming {0} to {1}'.format(dirname, rename_to))
79+
print('Renaming {0} to {1} ...'.format(dirname, rename_to))
8080
if os.path.isdir(rename_to):
8181
shutil.rmtree(rename_to)
8282
shutil.move(dirname, rename_to)
@@ -106,9 +106,8 @@ def get_tool(tool):
106106
archive_name = tool['archiveFileName']
107107
local_path = dist_dir + archive_name
108108
url = tool['url']
109-
#real_hash = tool['checksum'].split(':')[1]
110109
if not os.path.isfile(local_path):
111-
print('Downloading ' + archive_name)
110+
print('Downloading ' + archive_name + ' ...')
112111
sys.stdout.flush()
113112
if 'CYGWIN_NT' in sys_name:
114113
import ssl
@@ -127,15 +126,11 @@ def get_tool(tool):
127126
download_file(url, local_path)
128127
else:
129128
urlretrieve(url, local_path, report_progress)
130-
sys.stdout.write("\rDone\n")
131-
sys.stdout.flush()
129+
sys.stdout.write("\rDone\n")
130+
sys.stdout.flush()
132131
else:
133132
print('Tool {0} already downloaded'.format(archive_name))
134133
sys.stdout.flush()
135-
#local_hash = sha256sum(local_path)
136-
#if local_hash != real_hash:
137-
# print('Hash mismatch for {0}, delete the file and try again'.format(local_path))
138-
# raise RuntimeError()
139134
unpack(local_path, '.')
140135

141136
def load_tools_list(filename, platform):
@@ -158,11 +153,11 @@ def identify_platform():
158153
bits = 64
159154
sys_name = platform.system()
160155
sys_platform = platform.platform()
161-
print('System: %s, Info: %s' % (sys_name, sys_platform))
162-
if 'Linux' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('aarch64')):
156+
if 'Linux' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('aarch64') > 0):
163157
sys_name = 'LinuxARM'
164158
if 'CYGWIN_NT' in sys_name:
165159
sys_name = 'Windows'
160+
print('System: %s, Bits: %d, Info: %s' % (sys_name, bits, sys_platform))
166161
return arduino_platform_names[sys_name][bits]
167162

168163
if __name__ == '__main__':
@@ -172,4 +167,4 @@ def identify_platform():
172167
mkdir_p(dist_dir)
173168
for tool in tools_to_download:
174169
get_tool(tool)
175-
print('Done')
170+
print('Platform Tools Installed')

0 commit comments

Comments
 (0)