From 8365b3d7dbff5d042a138fc2d5ece7f52a2f9579 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:20:30 +0000 Subject: [PATCH 01/15] Clean up Windows builds and re-add RISC-V --- build.ps1 | 61 +++++++++++++-------- config/x64-win.json | 3 +- packages/windows/copy-deps.sh | 17 ++++++ packages/windows/openocd/build-openocd.sh | 11 ++-- packages/windows/picotool/build-picotool.sh | 15 ++--- packages/windows/riscv/build-riscv-gcc.sh | 16 ++++++ 6 files changed, 86 insertions(+), 37 deletions(-) create mode 100644 packages/windows/copy-deps.sh create mode 100644 packages/windows/riscv/build-riscv-gcc.sh diff --git a/build.ps1 b/build.ps1 index 49dbddc..dec8f6c 100644 --- a/build.ps1 +++ b/build.ps1 @@ -97,8 +97,8 @@ if ("" -ne $Version) { $version = (Get-Content "$PSScriptRoot\version.txt").Trim() } $config = Get-Content $ConfigFile | ConvertFrom-Json -$bitness = $config.bitness -$mingw_arch = $config.mingwArch +$env:MSYSTEM = $config.msysEnv +$msysEnv = $config.msysEnv.ToLowerInvariant() $downloads = $config.downloads mkdirp "build" @@ -223,8 +223,8 @@ function msys { # Preserve the current working directory $env:CHERE_INVOKING = 'yes' -# Start MINGW32/64 environment -$env:MSYSTEM = "MINGW$bitness" +# Use real symlinks +$env:MSYS = "winsymlinks:nativestrict" if (-not $SkipDownload) { # First run setup @@ -234,33 +234,37 @@ if (-not $SkipDownload) { # Normal update msys 'pacman --noconfirm -Suu' - msys "pacman -S --noconfirm --needed autoconf automake git libtool make pactoys pkg-config wget" + msys "pacman -S --noconfirm --needed autoconf automake base-devel expat git libtool pactoys patchutils pkg-config" # pacboy adds MINGW_PACKAGE_PREFIX to package names suffixed with :p - msys "pacboy -S --noconfirm --needed cmake:p ninja:p toolchain:p libusb:p hidapi:p" + msys "pacboy -S --noconfirm --needed cmake:p ninja:p toolchain:p libusb:p hidapi:p libslirp:p" } -if (-not (Test-Path ".\build\openocd-install\mingw$bitness")) { - msys "cd build && ../packages/windows/openocd/build-openocd.sh $bitness $mingw_arch" +if (-not (Test-Path ".\build\riscv-install\$msysEnv")) { + msys "cd build && ../packages/windows/riscv/build-riscv-gcc.sh" } -if (-not (Test-Path ".\build\picotool-install\mingw$bitness")) { - msys "cd build && ../packages/windows/picotool/build-picotool.sh $bitness $mingw_arch $version" +if (-not (Test-Path ".\build\openocd-install\$msysEnv")) { + msys "cd build && ../packages/windows/openocd/build-openocd.sh" +} + +if (-not (Test-Path ".\build\picotool-install\$msysEnv")) { + msys "cd build && ../packages/windows/picotool/build-picotool.sh $version" } if ($version.Substring(0, 1) -ge 2) { # Sign files before packaging up the installer - sign "build\openocd-install\mingw$bitness\bin\openocd.exe", - "build\pico-sdk-tools\mingw$bitness\pioasm\pioasm.exe", - "build\picotool-install\mingw$bitness\picotool\picotool.exe" + sign "build\openocd-install\$msysEnv\bin\openocd.exe", + "build\pico-sdk-tools\$msysEnv\pioasm\pioasm.exe", + "build\picotool-install\$msysEnv\picotool\picotool.exe" } else { $template = Get-Content ".\packages\windows\pico-sdk-tools\pico-sdk-tools-config-version.cmake" -Raw - $ExecutionContext.InvokeCommand.ExpandString($template) | Set-Content ".\build\pico-sdk-tools\mingw$bitness\pico-sdk-tools-config-version.cmake" + $ExecutionContext.InvokeCommand.ExpandString($template) | Set-Content ".\build\pico-sdk-tools\$msysEnv\pico-sdk-tools-config-version.cmake" # Sign files before packaging up the installer - sign "build\openocd-install\mingw$bitness\bin\openocd.exe", - "build\pico-sdk-tools\mingw$bitness\elf2uf2.exe", - "build\pico-sdk-tools\mingw$bitness\pioasm.exe", - "build\picotool-install\mingw$bitness\picotool.exe" + sign "build\openocd-install\$msysEnv\bin\openocd.exe", + "build\pico-sdk-tools\$msysEnv\elf2uf2.exe", + "build\pico-sdk-tools\$msysEnv\pioasm.exe", + "build\picotool-install\$msysEnv\picotool.exe" } # Package pico-sdk-tools separately as well @@ -270,11 +274,11 @@ $filename = 'pico-sdk-tools-{0}-{1}.zip' -f $suffix Write-Host "Saving pico-sdk-tools package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\pico-sdk-tools\mingw$bitness\" * } +exec { tar -a -cf "bin\$filename" -C "build\pico-sdk-tools\$msysEnv\" * } # Package picotool separately as well -$version = (cmd /c ".\build\picotool-install\mingw$bitness\picotool\picotool.exe" version -s '2>&1') +$version = (cmd /c ".\build\picotool-install\$msysEnv\picotool\picotool.exe" version -s '2>&1') Write-Host "Picotool version $version" $filename = 'picotool-{0}-{1}.zip' -f @@ -282,11 +286,11 @@ $filename = 'picotool-{0}-{1}.zip' -f $suffix Write-Host "Saving picotool package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\picotool-install\mingw$bitness\" * } +exec { tar -a -cf "bin\$filename" -C "build\picotool-install\$msysEnv\" * } # Package OpenOCD separately as well -$version = (cmd /c ".\build\openocd-install\mingw$bitness\bin\openocd.exe" --version '2>&1')[0] +$version = (cmd /c ".\build\openocd-install\$msysEnv\bin\openocd.exe" --version '2>&1')[0] if (-not ($version -match 'Open On-Chip Debugger (?[a-zA-Z0-9\.\-+]+) \((?[0-9\-:]+)\)')) { Write-Error 'Could not determine openocd version' } @@ -300,4 +304,15 @@ $filename = 'openocd-{0}-{1}.zip' -f exec { Remove-Item "build\openocd-install\mingw$bitness\share\openocd\scripts\target\1986*.cfg" } Write-Host "Saving OpenOCD package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\openocd-install\mingw$bitness\bin" * -C "..\share\openocd" "scripts" } +exec { tar -a -cf "bin\$filename" -C "build\openocd-install\$msysEnv\bin" * -C "..\share\openocd" "scripts" } + +# Package Risc-V separately as well + +$version = "14" + +$filename = 'riscv-toolchain-{0}-{1}.zip' -f + $version, + $suffix + +Write-Host "Saving Risc-V toolchain package to $filename" +exec { tar -a -cf "bin\$filename" -C "build\riscv-install" * } diff --git a/config/x64-win.json b/config/x64-win.json index 830ab59..0b7cfc7 100644 --- a/config/x64-win.json +++ b/config/x64-win.json @@ -1,6 +1,5 @@ { - "bitness": 64, - "mingwArch": "x86_64", + "msysEnv": "MINGW64", "downloads": [ { "name": "CMake", diff --git a/packages/windows/copy-deps.sh b/packages/windows/copy-deps.sh new file mode 100644 index 0000000..b44f498 --- /dev/null +++ b/packages/windows/copy-deps.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euo pipefail + +# Find all directories with exe files +find . -name '*.exe' -printf '%h\n' | sort -u | while read i +do + echo "Copying DLLs to $i" + pushd "$i" > /dev/null + + # We need to match just the DLL names, if they are from the MSYS2 libraries. + # (?<=...) is a positive lookbehind assertion, because we are looking for something like + # "libusb-1.0.dll => /mingw64/.../libusb-1.0.dll" + find . -maxdepth 1 -name '*.exe' -exec ldd {} ';' | (grep -Po "(?<==> )/${MSYSTEM,,}[^ ]+" || true) | sort -u | xargs -I{} cp -v {} . + + popd > /dev/null +done diff --git a/packages/windows/openocd/build-openocd.sh b/packages/windows/openocd/build-openocd.sh index e5a5018..6021bbf 100755 --- a/packages/windows/openocd/build-openocd.sh +++ b/packages/windows/openocd/build-openocd.sh @@ -2,8 +2,8 @@ set -euo pipefail -BITNESS=$1 -ARCH=$2 +BUILDDIR=$(pwd) +INSTALLDIR="openocd-install" cd openocd sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c @@ -11,6 +11,7 @@ sed -i -e 's/uint /unsigned int /g' ./src/flash/nor/rp2040.c ./configure --disable-werror make clean make -j$(nproc) -DESTDIR="$PWD/../openocd-install" make install -cp "/mingw$BITNESS/bin/libhidapi-0.dll" "$PWD/../openocd-install/mingw$BITNESS/bin" -cp "/mingw$BITNESS/bin/libusb-1.0.dll" "$PWD/../openocd-install/mingw$BITNESS/bin" +DESTDIR="$BUILDDIR/$INSTALLDIR" make install + +cd "$BUILDDIR/$INSTALLDIR/${MSYSTEM,,}/bin" +"$BUILDDIR/../packages/common/copy-deps.sh" diff --git a/packages/windows/picotool/build-picotool.sh b/packages/windows/picotool/build-picotool.sh index a0ec667..511ba99 100755 --- a/packages/windows/picotool/build-picotool.sh +++ b/packages/windows/picotool/build-picotool.sh @@ -2,9 +2,9 @@ set -euo pipefail -BITNESS=$1 -ARCH=$2 -sdkVersion=$3 +BUILDDIR=$(pwd) + +sdkVersion=$1 export PICO_SDK_PATH="$PWD/pico-sdk" export LDFLAGS="-static -static-libgcc -static-libstdc++" @@ -21,7 +21,7 @@ if [ ${sdkVersion:0:1} -ge 2 ]; then cmake --build . cd ../../../.. - INSTALLDIR="pico-sdk-tools/mingw$BITNESS" + INSTALLDIR="pico-sdk-tools/${MSYSTEM,,}" mkdir -p $INSTALLDIR cmake --install pico-sdk/tools/pioasm/build/ --prefix $INSTALLDIR touch $INSTALLDIR/.keep @@ -45,7 +45,7 @@ else cmake --build . cd ../../../.. - INSTALLDIR="pico-sdk-tools/mingw$BITNESS" + INSTALLDIR="pico-sdk-tools/${MSYSTEM,,}" mkdir -p $INSTALLDIR cp pico-sdk-$sdkVersion/tools/elf2uf2/build/elf2uf2.exe $INSTALLDIR cp pico-sdk-$sdkVersion/tools/pioasm/build/pioasm.exe $INSTALLDIR @@ -59,8 +59,9 @@ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DPICOTOOL_FLAT_INSTALL=1 cmake --build . cd ../.. -INSTALLDIR="picotool-install/mingw$BITNESS" +INSTALLDIR="picotool-install/${MSYSTEM,,}" mkdir -p $INSTALLDIR cmake --install picotool/build/ --prefix $INSTALLDIR touch $INSTALLDIR/.keep -cp "/mingw$BITNESS/bin/libusb-1.0.dll" $INSTALLDIR/picotool +cd $INSTALLDIR/picotool +"$BUILDDIR/../packages/windows/copy-deps.sh" diff --git a/packages/windows/riscv/build-riscv-gcc.sh b/packages/windows/riscv/build-riscv-gcc.sh new file mode 100644 index 0000000..b9529ae --- /dev/null +++ b/packages/windows/riscv/build-riscv-gcc.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euo pipefail + +INSTALLDIR="riscv-install/${MSYSTEM,,}" +rm -rf $INSTALLDIR +mkdir -p $INSTALLDIR + +BUILDDIR=$(pwd) + +cd riscv-gnu-toolchain +./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc +make -j$(nproc) + +cd "$BUILDDIR/$INSTALLDIR" +"$BUILDDIR/../packages/windows/copy-deps.sh" From 78d7b5c83a1d86a5139b6e9837b467527d35d96f Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:26:47 +0000 Subject: [PATCH 02/15] Use subst'ed path for Windows builds --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b435d4..f0c99cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,8 @@ permissions: contents: write env: - SKIP_RISCV: 1 + SKIP_RISCV: 0 + SKIP_OPENOCD: 0 jobs: build_windows: @@ -23,7 +24,10 @@ jobs: with: ssh-private-key: ${{ secrets.SSH_KEY }} - name: Build - run: ./build.ps1 ./config/x64-win.json -SkipSigning + run: | + subst P: . + P: + ./build.ps1 ./config/x64-win.json -SkipSigning - name: Upload Artifact uses: actions/upload-artifact@v4 with: From 62ac2b2de48772ce090d314af2f06331ea50845a Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:47:20 +0000 Subject: [PATCH 03/15] Update MSYS2; use from runner if available --- .github/workflows/build.yml | 4 +++- config/tools.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0c99cf..524035d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,11 +23,13 @@ jobs: uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.SSH_KEY }} + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 - name: Build run: | subst P: . P: - ./build.ps1 ./config/x64-win.json -SkipSigning + ./build.ps1 ./config/x64-win.json -SkipSigning -MSYS2Path (msys2 -c 'cygpath -m /').TrimEnd('\/') - name: Upload Artifact uses: actions/upload-artifact@v4 with: diff --git a/config/tools.json b/config/tools.json index 2a66dea..c8ad37c 100644 --- a/config/tools.json +++ b/config/tools.json @@ -10,7 +10,7 @@ { "name": "MSYS2", "file": "msys2.exe", - "href": "https://github.com/msys2/msys2-installer/releases/download/2023-01-27/msys2-base-x86_64-20230127.sfx.exe" + "href": "https://github.com/msys2/msys2-installer/releases/download/2024-12-08/msys2-base-x86_64-20241208.sfx.exe" } ] } From 606a7492e7631f987776adac6041c4487eb355a0 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:47:45 +0000 Subject: [PATCH 04/15] Add Windows RISC-V toolchain assets --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 524035d..92e209a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,7 @@ jobs: bin/picotool-*-x64-win.zip bin/pico-sdk-tools-*-x64-win.zip bin/openocd-*-x64-win.zip + bin/riscv-toolchain-*-x64-win.zip - name: Add Release Asset uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') @@ -46,6 +47,7 @@ jobs: bin/picotool-*-x64-win.zip bin/pico-sdk-tools-*-x64-win.zip bin/openocd-*-x64-win.zip + bin/riscv-toolchain-*-x64-win.zip build_macos: name: Build MacOS From 629882650ce1d3b51fece67474b035c5e6ac3a32 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:48:01 +0000 Subject: [PATCH 05/15] Clean up unused parameters --- build.ps1 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/build.ps1 b/build.ps1 index dec8f6c..2b84dab 100644 --- a/build.ps1 +++ b/build.ps1 @@ -24,15 +24,7 @@ param ( $SkipDownload, [switch] - $SkipSigning, - - [ValidateSet('zlib', 'bzip2', 'lzma')] - [string] - $Compression = 'lzma', - - [ValidateSet('system', 'user')] - [string] - $BuildType = 'system' + $SkipSigning ) #Requires -Version 7.2 @@ -86,7 +78,7 @@ $ProgressPreference = 'SilentlyContinue' Write-Host "Building from $ConfigFile" -$suffix = [io.path]::GetFileNameWithoutExtension($ConfigFile) + ($BuildType -eq 'user' ? '-user' : '' ) +$suffix = [io.path]::GetFileNameWithoutExtension($ConfigFile) $tools = (Get-Content '.\config\tools.json' | ConvertFrom-Json).tools $repositories = (Get-Content '.\config\repositories.json' | ConvertFrom-Json).repositories From b9d40c9b3d2d88ba1ab3b42731d5516cff5f3bd4 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 19:51:31 +0000 Subject: [PATCH 06/15] Allow skipping large Windows builds --- build.ps1 | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/build.ps1 b/build.ps1 index 2b84dab..433da45 100644 --- a/build.ps1 +++ b/build.ps1 @@ -28,26 +28,6 @@ param ( ) #Requires -Version 7.2 - -function crawl { - param ([string]$url) - - (Invoke-WebRequest $url -UseBasicParsing).Links | - Where-Object { - ($_ | Get-Member href) -and - [uri]::IsWellFormedUriString($_.href, [System.UriKind]::RelativeOrAbsolute) - } | - ForEach-Object { - $href = [System.Net.WebUtility]::HtmlDecode($_.href) - - try { - (New-Object System.Uri([uri]$url, $href)).AbsoluteUri - } - catch { - $href - } - } -} function mkdirp { param ([string] $dir, [switch] $clean) @@ -231,11 +211,11 @@ if (-not $SkipDownload) { msys "pacboy -S --noconfirm --needed cmake:p ninja:p toolchain:p libusb:p hidapi:p libslirp:p" } -if (-not (Test-Path ".\build\riscv-install\$msysEnv")) { +if (-not (Test-Path ".\build\riscv-install\$msysEnv") -and ($env:SKIP_RISCV -ne '1')) { msys "cd build && ../packages/windows/riscv/build-riscv-gcc.sh" } -if (-not (Test-Path ".\build\openocd-install\$msysEnv")) { +if (-not (Test-Path ".\build\openocd-install\$msysEnv") -and ($env:SKIP_OPENOCD -ne '1')) { msys "cd build && ../packages/windows/openocd/build-openocd.sh" } From aa6f0073276cce34f9d9c46b42e4f5b07f784e87 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 20:35:02 +0000 Subject: [PATCH 07/15] Don't mangle line endings on Windows --- build.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.ps1 b/build.ps1 index 433da45..28d0099 100644 --- a/build.ps1 +++ b/build.ps1 @@ -130,6 +130,8 @@ if (-not (Get-Command git -ErrorAction SilentlyContinue)) { $env:PATH = $env:PATH + ';' + (Resolve-Path .\build\git\cmd).Path } +exec { git config --global core.autocrlf false } + $repositories | ForEach-Object { $repodir = Join-Path 'build' ([IO.Path]::GetFileNameWithoutExtension($_.href)) $repodir = $repodir.TrimEnd("-rp2350") From 08092ee1f37f4538cf199fa867142660b93a7380 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 21:03:32 +0000 Subject: [PATCH 08/15] Fix package paths --- build.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.ps1 b/build.ps1 index 28d0099..6680846 100644 --- a/build.ps1 +++ b/build.ps1 @@ -248,7 +248,7 @@ $filename = 'pico-sdk-tools-{0}-{1}.zip' -f $suffix Write-Host "Saving pico-sdk-tools package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\pico-sdk-tools\$msysEnv\" * } +exec { tar -a -cf "bin\$filename" -C "build\pico-sdk-tools\$msysEnv" '*' } # Package picotool separately as well @@ -260,7 +260,7 @@ $filename = 'picotool-{0}-{1}.zip' -f $suffix Write-Host "Saving picotool package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\picotool-install\$msysEnv\" * } +exec { tar -a -cf "bin\$filename" -C "build\picotool-install\$msysEnv" '*' } # Package OpenOCD separately as well @@ -275,18 +275,18 @@ $filename = 'openocd-{0}-{1}.zip' -f # Removing files with special char in their names # they cause issues with some decompression libraries -exec { Remove-Item "build\openocd-install\mingw$bitness\share\openocd\scripts\target\1986*.cfg" } +Remove-Item "build\openocd-install\$msysEnv\share\openocd\scripts\target\1986*.cfg" Write-Host "Saving OpenOCD package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\openocd-install\$msysEnv\bin" * -C "..\share\openocd" "scripts" } +exec { tar -a -cf "bin\$filename" -C "build\openocd-install\$msysEnv\bin" '*' -C "..\share\openocd" "scripts" } # Package Risc-V separately as well -$version = "14" +$version = (. ".\build\riscv-install\$msysEnv\bin\riscv32-unknown-elf-gcc.exe" -dumpversion) -split '\.' $filename = 'riscv-toolchain-{0}-{1}.zip' -f - $version, + $version[0], $suffix Write-Host "Saving Risc-V toolchain package to $filename" -exec { tar -a -cf "bin\$filename" -C "build\riscv-install" * } +exec { tar -a -cf "bin\$filename" -C "build\riscv-install\$msysEnv" '*' } From aff8a658cea1446d467c44f704bc0448541c7ddb Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 21:52:02 +0000 Subject: [PATCH 09/15] Path to GCC src needs to be relative --- packages/windows/riscv/build-riscv-gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/windows/riscv/build-riscv-gcc.sh b/packages/windows/riscv/build-riscv-gcc.sh index b9529ae..9ef1484 100644 --- a/packages/windows/riscv/build-riscv-gcc.sh +++ b/packages/windows/riscv/build-riscv-gcc.sh @@ -9,7 +9,7 @@ mkdir -p $INSTALLDIR BUILDDIR=$(pwd) cd riscv-gnu-toolchain -./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=$BUILDDIR/gcc +./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=../gcc make -j$(nproc) cd "$BUILDDIR/$INSTALLDIR" From 786483a4a47c1383eb62452ee1426865f7996a99 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Fri, 13 Dec 2024 23:18:06 +0000 Subject: [PATCH 10/15] Test without custom gcc src --- packages/windows/riscv/build-riscv-gcc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/windows/riscv/build-riscv-gcc.sh b/packages/windows/riscv/build-riscv-gcc.sh index 9ef1484..cecbdfc 100644 --- a/packages/windows/riscv/build-riscv-gcc.sh +++ b/packages/windows/riscv/build-riscv-gcc.sh @@ -9,7 +9,7 @@ mkdir -p $INSTALLDIR BUILDDIR=$(pwd) cd riscv-gnu-toolchain -./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" --with-gcc-src=../gcc +./configure --prefix=$BUILDDIR/$INSTALLDIR --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--" make -j$(nproc) cd "$BUILDDIR/$INSTALLDIR" From f5b0c6c756654c52d680b40cadcca834d75ba15d Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Sat, 14 Dec 2024 08:44:02 +0000 Subject: [PATCH 11/15] Fix path to copy-deps.sh --- packages/windows/openocd/build-openocd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/windows/openocd/build-openocd.sh b/packages/windows/openocd/build-openocd.sh index 6021bbf..af8c96c 100755 --- a/packages/windows/openocd/build-openocd.sh +++ b/packages/windows/openocd/build-openocd.sh @@ -14,4 +14,4 @@ make -j$(nproc) DESTDIR="$BUILDDIR/$INSTALLDIR" make install cd "$BUILDDIR/$INSTALLDIR/${MSYSTEM,,}/bin" -"$BUILDDIR/../packages/common/copy-deps.sh" +"$BUILDDIR/../packages/windows/copy-deps.sh" From 58694a53ddeedd0fbaf2ef34130ae86648e89280 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Sat, 14 Dec 2024 08:44:49 +0000 Subject: [PATCH 12/15] Remove the other Windows RISC-V build --- packages/macos/riscv/build-riscv-gcc.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/macos/riscv/build-riscv-gcc.sh b/packages/macos/riscv/build-riscv-gcc.sh index ca4f9a0..ad10c91 100755 --- a/packages/macos/riscv/build-riscv-gcc.sh +++ b/packages/macos/riscv/build-riscv-gcc.sh @@ -22,4 +22,3 @@ cd .. SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) $SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-macos-release/21/artifact/riscv32-embecosm-macos-gcc13.3.0.zip" "x64-mac" -$SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-win64-release/24/artifact/riscv32-embecosm-win64-gcc13.2.0.zip" "x64-win" From 3f57cf2461a57d1d1d20a1b4539d51a77c572281 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Sat, 14 Dec 2024 11:57:06 +0000 Subject: [PATCH 13/15] Fix GCC version detection --- build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 6680846..652c3b1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -282,10 +282,10 @@ exec { tar -a -cf "bin\$filename" -C "build\openocd-install\$msysEnv\bin" '*' -C # Package Risc-V separately as well -$version = (. ".\build\riscv-install\$msysEnv\bin\riscv32-unknown-elf-gcc.exe" -dumpversion) -split '\.' +$version = ((. ".\build\riscv-install\$msysEnv\bin\riscv32-unknown-elf-gcc.exe" -dumpversion) -split '\.')[0] $filename = 'riscv-toolchain-{0}-{1}.zip' -f - $version[0], + $version, $suffix Write-Host "Saving Risc-V toolchain package to $filename" From 3966ff2c8427ed474560b757ccfca9e55d90d3ea Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Sun, 15 Dec 2024 09:46:53 +0000 Subject: [PATCH 14/15] Set executable mode for scripts --- packages/windows/copy-deps.sh | 0 packages/windows/riscv/build-riscv-gcc.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 packages/windows/copy-deps.sh mode change 100644 => 100755 packages/windows/riscv/build-riscv-gcc.sh diff --git a/packages/windows/copy-deps.sh b/packages/windows/copy-deps.sh old mode 100644 new mode 100755 diff --git a/packages/windows/riscv/build-riscv-gcc.sh b/packages/windows/riscv/build-riscv-gcc.sh old mode 100644 new mode 100755 From 2088d263274dd0e817bf43e93e28a8f36be40879 Mon Sep 17 00:00:00 2001 From: Nikhil Dabas Date: Wed, 18 Dec 2024 11:11:07 +0000 Subject: [PATCH 15/15] Comment out SSH auth for now --- .github/workflows/build.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92e209a..f1fdf76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,11 +18,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup SSH Auth - if: runner.environment == 'github-hosted' - uses: webfactory/ssh-agent@v0.7.0 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} + # - name: Setup SSH Auth + # if: runner.environment == 'github-hosted' + # uses: webfactory/ssh-agent@v0.7.0 + # with: + # ssh-private-key: ${{ secrets.SSH_KEY }} - name: Setup MSYS2 uses: msys2/setup-msys2@v2 - name: Build @@ -65,11 +65,11 @@ jobs: if: runner.environment == 'github-hosted' run: | NONINTERACTIVE=1 arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - - name: Setup SSH Auth - if: runner.environment == 'github-hosted' - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} + # - name: Setup SSH Auth + # if: runner.environment == 'github-hosted' + # uses: webfactory/ssh-agent@v0.9.0 + # with: + # ssh-private-key: ${{ secrets.SSH_KEY }} - name: Build run: ./build_macos.sh - name: Upload Artifact @@ -104,11 +104,11 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup SSH Auth - if: runner.environment == 'github-hosted' - uses: webfactory/ssh-agent@v0.9.0 - with: - ssh-private-key: ${{ secrets.SSH_KEY }} + # - name: Setup SSH Auth + # if: runner.environment == 'github-hosted' + # uses: webfactory/ssh-agent@v0.9.0 + # with: + # ssh-private-key: ${{ secrets.SSH_KEY }} - name: Build run: ./build_linux.sh - name: Upload Artifact