@@ -1026,14 +1026,46 @@ jobs:
1026
1026
- name : Set up build environment (Linux)
1027
1027
if : ${{ runner.os == 'Linux' }}
1028
1028
run : |
1029
+ # Create workspace directory
1030
+ WORKSPACE="${RUNNER_TEMP}/workspace"
1031
+ mkdir -p ${WORKSPACE}
1032
+
1033
+ # Install dependencies for cross compilation
1034
+ if [ "${{ matrix.host.name }}" == "windows-x86_64" ]; then
1035
+ # Install MinGW-w64 toolchain
1036
+ apt-get install -y \
1037
+ binutils-mingw-w64 \
1038
+ gcc-mingw-w64 \
1039
+ g++-mingw-w64 \
1040
+ mingw-w64-tools
1041
+
1042
+ # Install extra MinGW-w64 libraries requried for QEMU build
1043
+ gpg --keyserver keyserver.ubuntu.com --recv-keys E08C21D5677450AD
1044
+ gpg --export --armor E08C21D5677450AD | apt-key add -
1045
+ echo "deb https://qemu.weilnetz.de/debian/ testing contrib" > /etc/apt/sources.list.d/cygwin.list
1046
+ apt-get update
1047
+
1048
+ apt-get install -y \
1049
+ mingw64-x86-64-glib2.0 \
1050
+ mingw64-x86-64-pixman
1051
+ fi
1052
+
1029
1053
# Set environment variables
1030
1054
echo "TAR=tar" >> $GITHUB_ENV
1055
+ echo "WORKSPACE=${WORKSPACE}" >> $GITHUB_ENV
1031
1056
1032
1057
- name : Set up build environment (macOS)
1033
1058
if : ${{ runner.os == 'macOS' }}
1034
1059
run : |
1060
+ # Create case-sensitive workspace volume for macOS
1061
+ WORKSPACE="/Volumes/Workspace"
1062
+ hdiutil create ${RUNNER_TEMP}/Workspace.sparseimage \
1063
+ -volname Workspace -type SPARSE -size 150g -fs HFSX
1064
+ hdiutil mount ${RUNNER_TEMP}/Workspace.sparseimage -mountpoint ${WORKSPACE}
1065
+
1035
1066
# Set environment variables
1036
1067
echo "TAR=gtar" >> $GITHUB_ENV
1068
+ echo "WORKSPACE=${WORKSPACE}" >> $GITHUB_ENV
1037
1069
1038
1070
- name : Check out source code
1039
1071
if : ${{ github.event_name != 'pull_request_target' }}
@@ -1082,7 +1114,7 @@ jobs:
1082
1114
echo "SRC_CACHE_URI=${SRC_CACHE_URI}" >> $GITHUB_ENV
1083
1115
echo "POKY_DOWNLOADS=${POKY_DOWNLOADS}" >> $GITHUB_ENV
1084
1116
1085
- - name : Build Linux host tools
1117
+ - name : Build host tools (Linux)
1086
1118
if : startsWith(matrix.host.name, 'linux-')
1087
1119
run : |
1088
1120
POKY_BASE=${GITHUB_WORKSPACE}/meta-zephyr-sdk
@@ -1115,6 +1147,47 @@ jobs:
1115
1147
md5sum ${ARCHIVE_FILE} > md5.sum
1116
1148
sha256sum ${ARCHIVE_FILE} > sha256.sum
1117
1149
1150
+ - name : Build host tools (non-Linux)
1151
+ if : " !startsWith(matrix.host.name, 'linux-')"
1152
+ run : |
1153
+ # Create output directory
1154
+ mkdir -p ${WORKSPACE}/hosttools
1155
+
1156
+ # Build QEMU
1157
+ QEMU_BUILD="${WORKSPACE}/build/qemu"
1158
+ QEMU_SOURCE="${GITHUB_WORKSPACE}/qemu"
1159
+ QEMU_PREFIX="${WORKSPACE}/hosttools/qemu"
1160
+
1161
+ mkdir -p ${QEMU_BUILD}
1162
+ pushd ${QEMU_BUILD}
1163
+ ${GITHUB_WORKSPACE}/scripts/build_qemu.sh \
1164
+ ${{ matrix.host.name }} \
1165
+ ${GITHUB_WORKSPACE}/qemu \
1166
+ ${QEMU_PREFIX}
1167
+ popd
1168
+
1169
+ # TODO: Build ARC QEMU
1170
+ # TODO: Build Xilinx QEMU
1171
+ # TODO: Build OpenOCD
1172
+
1173
+ # Create archive
1174
+ ARCHIVE_NAME=hosttools_${{ matrix.host.name }}
1175
+ ARCHIVE_FILE=hosttools_${{ matrix.host.name }}.tar.xz
1176
+
1177
+ if [ "${{ matrix.host.archive }}" == "tar.xz" ]; then
1178
+ XZ_OPT="-T0" \
1179
+ ${TAR} -Jcvf ${ARCHIVE_FILE} \
1180
+ --owner=0 --group=0 -C ${WORKSPACE} hosttools
1181
+ elif [ "${{ matrix.host.archive }}" == "7z" ]; then
1182
+ pushd ${WORKSPACE}
1183
+ 7z a -t7z -l ${GITHUB_WORKSPACE}/${ARCHIVE_FILE} hosttools
1184
+ popd
1185
+ fi
1186
+
1187
+ # Compute checksum
1188
+ md5sum ${ARCHIVE_FILE} > md5.sum
1189
+ sha256sum ${ARCHIVE_FILE} > sha256.sum
1190
+
1118
1191
- name : Setup debug session
1119
1192
if : always() && needs.setup.outputs.debug == 'hosttools'
1120
1193
uses : mxschmitt/action-tmate@v3
@@ -1132,7 +1205,6 @@ jobs:
1132
1205
popd
1133
1206
1134
1207
- name : Upload toolchain build artifact
1135
- if : startsWith(matrix.host.name, 'linux-') # FIXME: Do for all
1136
1208
uses : actions/upload-artifact@v4
1137
1209
with :
1138
1210
name : hosttools_${{ matrix.host.name }}
@@ -1141,9 +1213,6 @@ jobs:
1141
1213
md5.sum
1142
1214
sha256.sum
1143
1215
1144
- # TODO: Add host tool build process for macOS hosts.
1145
- # TODO: Add host tool build process for Windows hosts.
1146
-
1147
1216
# Build CMake package
1148
1217
build-cmake-pkg :
1149
1218
name : CMake Package (${{ matrix.host.name }})
0 commit comments