Skip to content

Commit ba22113

Browse files
Fix Windows CI build (esp8266#6927)
Remove chocolatey (Win package manager) usage because it seems to often have issues. Use the main sources for Python3 and sed, instead. Fix size printouts to use a simpler script which should work under Windows and all UNIX-like OSes.
1 parent 1d0bc5e commit ba22113

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

tests/common.sh

+18-20
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,11 @@ function print_size_info()
3434
elf_name=$(basename $elf_file)
3535
sketch_name="${elf_name%.*}"
3636
# echo $sketch_name
37+
xtensa-lx106-elf-size --format=sysv $elf_file | sed s/irom0.text/irom0text/g > size.txt
3738
declare -A segments
38-
while read -a tokens; do
39-
seg=${tokens[0]}
40-
seg=${seg//./}
41-
size=${tokens[1]}
42-
addr=${tokens[2]}
43-
if [ "$addr" -eq "$addr" -a "$addr" -ne "0" ] 2>/dev/null; then
44-
segments[$seg]=$size
45-
fi
46-
47-
done < <(xtensa-lx106-elf-size --format=sysv $elf_file | sed 's/\r//g' )
39+
for seg in data rodata bss text irom0text; do
40+
segments[$seg]=$(grep ^.$seg size.txt | awk '{sum += $2} END {print sum}')
41+
done
4842

4943
total_ram=$((${segments[data]} + ${segments[rodata]} + ${segments[bss]}))
5044
total_flash=$((${segments[data]} + ${segments[rodata]} + ${segments[text]} + ${segments[irom0text]}))
@@ -165,16 +159,20 @@ function install_ide()
165159
local core_path=$2
166160
local debug=$3
167161
if [ "$WINDOWS" = "1" ]; then
168-
# Acquire needed packages from Windows package manager
169-
choco install --no-progress python3 >& pylog.txt
170-
# Parse the python instrall dir from the output log. Sorry, can't set it via choco on the free version
171-
PYDIR=$(cat pylog.txt | grep "^Installed to:" | cut -f2 -d"'" | sed 's/C:\\/\/c\//')
172-
echo "Detected python3 install dir: $PYDIR"
173-
export PATH="$PYDIR:$PATH" # Ensure it's live from now on...
174-
cp "$PYDIR/python.exe" "$PYDIR/python3.exe"
175-
choco install --no-progress unzip
176-
choco install --no-progress sed
177-
#choco install --no-progress golang
162+
mkdir /c/mybin
163+
pushd /c/mybin
164+
# Use Python.org to install python3 and make sure it is in path
165+
wget -nv https://www.python.org/ftp/python/3.8.1/python-3.8.1-embed-win32.zip
166+
unzip -q python-3.8.1-embed-win32.zip
167+
cp "python.exe" "python3.exe"
168+
wget -nv -O sed.exe https://github.com/mbuilov/sed-windows/raw/master/sed-4.7-x64.exe
169+
#wget -nv https://fossies.org/windows/misc/unz600xn.exe
170+
#unzip -q ./unz600xn.exe
171+
popd
172+
export PATH="c:\\mybin:$PATH" # Ensure it's live from now on...
173+
python3 --version
174+
sed --version
175+
awk --version
178176
test -r arduino-windows.zip || wget -nv -O arduino-windows.zip "${ideurl}-windows.zip"
179177
unzip -q arduino-windows.zip
180178
mv arduino-${idever} arduino-distrib

0 commit comments

Comments
 (0)