Skip to content

Commit cdb0e19

Browse files
committed
ci: Fix all the targets
- Fix Linux aarch64 - Fix macOS x86_64 by patching GMP to disable assembly optimizations. - Fix macOS arm64 by setting 4 cores instead of all of them (GH hiccup) - Cosmetic changes for the CI Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
1 parent 67d84c2 commit cdb0e19

File tree

3 files changed

+46
-33
lines changed

3 files changed

+46
-33
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.x'
1618
- name: Install dependencies
1719
run: |
1820
sudo apt-get update
@@ -22,7 +24,7 @@ jobs:
2224
run: |
2325
git config --global user.email "builds@travis-ci.com"
2426
git config --global user.name "Travis CI"
25-
mkdir build
27+
mkdir -p build
2628
cd build
2729
cmake ..
2830
make -j$(nproc) tarball
@@ -37,6 +39,8 @@ jobs:
3739
steps:
3840
- uses: actions/checkout@v4
3941
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.x'
4044
- name: Install dependencies
4145
run: |
4246
sudo apt-get update
@@ -46,7 +50,7 @@ jobs:
4650
run: |
4751
git config --global user.email "builds@travis-ci.com"
4852
git config --global user.name "Travis CI"
49-
mkdir build
53+
mkdir -p build
5054
cd build
5155
cmake ..
5256
make -j$(nproc) tarball
@@ -57,39 +61,43 @@ jobs:
5761
name: vitasdk-linux-arm64
5862
path: build/*.tar.bz2
5963
build-macos:
60-
runs-on: macos-12
64+
runs-on: macos-15-intel
6165
steps:
6266
- uses: actions/checkout@v4
6367
- uses: actions/setup-python@v5
68+
with:
69+
python-version: '3.x'
6470
- name: Build
6571
run: |
6672
git config --global user.email "builds@travis-ci.com"
6773
git config --global user.name "Travis CI"
68-
brew install autoconf automake libtool
69-
mkdir build
74+
brew install autoconf automake libtool texinfo
75+
mkdir -p build
7076
cd build
7177
cmake ..
72-
make -j$(nproc) tarball
78+
make -j4 tarball
7379
- name: Upload artifacts
7480
if: ${{ success() }}
7581
uses: actions/upload-artifact@v4
7682
with:
7783
name: vitasdk-macos
7884
path: build/*.tar.bz2
7985
build-macos-arm64:
80-
runs-on: macos-14
86+
runs-on: macos-15
8187
steps:
8288
- uses: actions/checkout@v4
8389
- uses: actions/setup-python@v5
90+
with:
91+
python-version: '3.x'
8492
- name: Build
8593
run: |
8694
git config --global user.email "builds@travis-ci.com"
8795
git config --global user.name "Travis CI"
88-
brew install autoconf automake libtool texinfo pkg-config
89-
mkdir build
96+
brew install autoconf automake libtool texinfo
97+
mkdir -p build
9098
cd build
9199
cmake ..
92-
make -j$(nproc) tarball
100+
make -j4 tarball
93101
- name: Upload artifacts
94102
if: ${{ success() }}
95103
uses: actions/upload-artifact@v4
@@ -104,6 +112,8 @@ jobs:
104112
steps:
105113
- uses: actions/checkout@v4
106114
- uses: actions/setup-python@v5
115+
with:
116+
python-version: '3.x'
107117
- name: Install dependencies
108118
run: |
109119
sudo apt-get update
@@ -115,7 +125,7 @@ jobs:
115125
git config --global user.name "Travis CI"
116126
unset CXX
117127
unset CC
118-
mkdir build
128+
mkdir -p build
119129
cd build
120130
cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain-x86_64-w64-mingw32.cmake
121131
make -j$(nproc) tarball

CMakeLists.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
199199
)
200200

201201
ExternalProject_add(libyaml${suffix}
202-
URL http://pyyaml.org/download/libyaml/yaml-${LIBYAML_VERSION}.tar.gz
202+
URL https://pyyaml.org/download/libyaml/yaml-${LIBYAML_VERSION}.tar.gz
203203
URL_HASH ${LIBYAML_HASH}
204204
DOWNLOAD_DIR ${DOWNLOAD_DIR}
205205
PATCH_COMMAND sh ${PROJECT_SOURCE_DIR}/cmake/update_config_files.sh <SOURCE_DIR>/config
@@ -213,19 +213,21 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
213213
"CFLAGS=-DYAML_DECLARE_STATIC"
214214
)
215215

216-
# GMP assembly doesn't work on ARM64 macOS - need to disable it
217-
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "arm64")
216+
# GMP assembly causes issues on macOS - need to disable it and use PIC
217+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
218218
set(gmp_asm_flag --disable-assembly)
219+
set(gmp_env_command ${CMAKE_COMMAND} -E env "CFLAGS=-fPIC -fexceptions" "CXXFLAGS=-fPIC")
219220
else()
220221
set(gmp_asm_flag "")
222+
set(gmp_env_command ${CMAKE_COMMAND} -E env "CPPFLAGS=-fexceptions")
221223
endif()
222224

223225
ExternalProject_add(gmp${suffix}
224-
URL http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2
226+
URL https://ftpmirror.gnu.org/gnu/gmp/gmp-${GMP_VERSION}.tar.bz2
225227
URL_HASH ${GMP_HASH}
226228
DOWNLOAD_DIR ${DOWNLOAD_DIR}
227229
PATCH_COMMAND sh ${PROJECT_SOURCE_DIR}/cmake/update_config_files.sh <SOURCE_DIR>
228-
CONFIGURE_COMMAND CPPFLAGS=-fexceptions ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
230+
CONFIGURE_COMMAND ${gmp_env_command} ${compiler_flags} ${wrapper_command} <SOURCE_DIR>/configure
229231
--build=${build_native}
230232
--host=${toolchain_host}
231233
--prefix=${toolchain_deps_dir}
@@ -238,7 +240,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
238240

239241
ExternalProject_add(mpfr${suffix}
240242
DEPENDS gmp${suffix}
241-
URL http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.bz2
243+
URL https://ftpmirror.gnu.org/gnu/mpfr/mpfr-${MPFR_VERSION}.tar.bz2
242244
URL_HASH ${MPFR_HASH}
243245
DOWNLOAD_DIR ${DOWNLOAD_DIR}
244246
PATCH_COMMAND sh ${PROJECT_SOURCE_DIR}/cmake/update_config_files.sh <SOURCE_DIR>
@@ -253,7 +255,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
253255

254256
ExternalProject_add(mpc${suffix}
255257
DEPENDS gmp${suffix} mpfr${suffix}
256-
URL https://ftp.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
258+
URL https://ftpmirror.gnu.org/gnu/mpc/mpc-${MPC_VERSION}.tar.gz
257259
URL_HASH ${MPC_HASH}
258260
DOWNLOAD_DIR ${DOWNLOAD_DIR}
259261
PATCH_COMMAND sh ${PROJECT_SOURCE_DIR}/cmake/update_config_files.sh <SOURCE_DIR>
@@ -312,7 +314,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
312314
)
313315

314316
ExternalProject_Add(binutils${suffix}
315-
URL https://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz
317+
URL https://ftpmirror.gnu.org/gnu/binutils/binutils-${BINUTILS_VERSION}.tar.xz
316318
URL_HASH ${BINUTILS_HASH}
317319
DOWNLOAD_DIR ${DOWNLOAD_DIR}
318320
PATCH_COMMAND
@@ -339,7 +341,7 @@ function(toolchain_deps toolchain_deps_dir toolchain_install_dir toolchain_suffi
339341
)
340342

341343
ExternalProject_Add(gdb${suffix}
342-
URL https://ftp.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz
344+
URL https://ftpmirror.gnu.org/gnu/gdb/gdb-${GDB_VERSION}.tar.xz
343345
URL_HASH ${GDB_HASH}
344346
DOWNLOAD_DIR ${DOWNLOAD_DIR}
345347
PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gdb.patch
@@ -482,7 +484,7 @@ endif()
482484
# Build a basic gcc compiler, needed to compile newlib
483485
ExternalProject_add(gcc-base
484486
DEPENDS gmp_${build_suffix} mpfr_${build_suffix} mpc_${build_suffix} isl_${build_suffix} libelf_${build_suffix}
485-
URL http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
487+
URL https://ftpmirror.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
486488
URL_HASH ${GCC_HASH}
487489
DOWNLOAD_DIR ${DOWNLOAD_DIR}
488490
PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch
@@ -582,7 +584,7 @@ ExternalProject_Add(newlib
582584
if(CMAKE_TOOLCHAIN_FILE)
583585
ExternalProject_add(gcc-complete
584586
DEPENDS newlib gmp_${build_suffix} mpfr_${build_suffix} mpc_${build_suffix} isl_${build_suffix} libelf_${build_suffix}
585-
URL http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
587+
URL https://ftpmirror.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
586588
URL_HASH ${GCC_HASH}
587589
DOWNLOAD_DIR ${DOWNLOAD_DIR}
588590
PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch
@@ -640,7 +642,7 @@ ExternalProject_Add(pthread-embedded
640642
ExternalProject_add(gcc-final
641643
DEPENDS gmp_${target_suffix} mpfr_${target_suffix} mpc_${target_suffix} isl_${target_suffix} libelf_${target_suffix}
642644
DEPENDS newlib ${GCC_DEPENDS} pthread-embedded
643-
URL http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
645+
URL https://ftpmirror.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/gcc-${GCC_VERSION}.tar.xz
644646
URL_HASH ${GCC_HASH}
645647
DOWNLOAD_DIR ${DOWNLOAD_DIR}
646648
PATCH_COMMAND patch -d <SOURCE_DIR> -p1 -t -N < ${PROJECT_SOURCE_DIR}/patches/gcc/0001-gcc-10.patch

cmake/update_config_files.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,32 @@ if [ -z "$SOURCE_DIR" ]; then
88
exit 1
99
fi
1010

11-
# Only update on ARM64 macOS - other platforms work fine with existing config files
11+
# Update on ARM64 platforms (macOS and Linux) - old config files don't recognize aarch64
1212
ARCH=$(uname -m)
1313
OS=$(uname -s)
1414

15-
if [ "$OS" != "Darwin" ] || [ "$ARCH" != "arm64" ]; then
16-
echo "Skipping config files update (not ARM64 Mac)"
15+
# Check if we're on ARM64 (macOS uses "arm64", Linux uses "aarch64")
16+
if [ "$ARCH" != "arm64" ] && [ "$ARCH" != "aarch64" ]; then
17+
echo "Skipping config files update (not ARM64 platform: $ARCH)"
1718
exit 0
1819
fi
1920

20-
echo "Updating config.sub and config.guess in $SOURCE_DIR for ARM64 Mac support"
21+
echo "Updating config.sub and config.guess in $SOURCE_DIR for ARM64 support ($OS $ARCH)"
2122

2223
# Remove old files if they exist and are read-only
2324
[ -f "$SOURCE_DIR/config.sub" ] && chmod +w "$SOURCE_DIR/config.sub" 2>/dev/null
2425
[ -f "$SOURCE_DIR/config.guess" ] && chmod +w "$SOURCE_DIR/config.guess" 2>/dev/null
2526

2627
# Try to download latest config.sub
27-
if ! curl -L -o "$SOURCE_DIR/config.sub" \
28-
'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'; then
29-
echo "Warning: Failed to download config.sub, build might fail on ARM64 Mac"
28+
if ! curl -f -L -o "$SOURCE_DIR/config.sub" \
29+
'https://git.savannah.gnu.org/cgit/config.git/plain/config.sub'; then
30+
echo "Warning: Failed to download config.sub, build might fail on ARM64"
3031
fi
3132

3233
# Try to download latest config.guess
33-
if ! curl -L -o "$SOURCE_DIR/config.guess" \
34-
'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'; then
35-
echo "Warning: Failed to download config.guess, build might fail on ARM64 Mac"
34+
if ! curl -f -L -o "$SOURCE_DIR/config.guess" \
35+
'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess'; then
36+
echo "Warning: Failed to download config.guess, build might fail on ARM64"
3637
fi
3738

3839
# Make them executable if they exist

0 commit comments

Comments
 (0)