Skip to content

Commit 6372179

Browse files
committed
fix cirrus ci yml
1 parent 02cc539 commit 6372179

File tree

2 files changed

+17
-40
lines changed

2 files changed

+17
-40
lines changed

.cirrus.yml

+12-11
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@ task:
66
DEBIAN_FRONTEND: noninteractive
77
install_script: apt update && apt install --fix-missing -y git libgmp-dev libmpfr-dev libmpc-dev g++ cmake make wget valgrind && apt autoremove -y && apt autoclean -y
88
compile_script:
9-
- export CI=true; sh build.sh
9+
- export CI=true; export NPROC=2; sh build.sh
1010
tests_script: ${HOME}/.feral/bin/feral testdir tests && ${HOME}/.feral/bin/feral testdir tests --valgrind
1111

12-
task:
13-
name: FreeBSD
14-
freebsd_instance:
15-
image_family: freebsd-13-0
16-
install_script: pkg install -y git gmp mpfr mpc cmake wget valgrind
17-
compile_script:
18-
- export CI=true; sh build.sh
19-
# valgrind causes invalid KERN_PROC_PATHNAME to be set therefore manually FERAL_PATHS is set
20-
tests_script: ${HOME}/.feral/bin/feral testdir tests
12+
# FreeBSD-13 uses Clang 11 -_- ; Too old!
13+
# task:
14+
# name: FreeBSD
15+
# freebsd_instance:
16+
# image_family: freebsd-13-0
17+
# install_script: pkg install -y git gmp mpfr mpc cmake wget valgrind
18+
# compile_script:
19+
# - export CI=true; export NPROC=2; sh build.sh
20+
# # valgrind causes invalid KERN_PROC_PATHNAME to be set therefore manually FERAL_PATHS is set
21+
# tests_script: ${HOME}/.feral/bin/feral testdir tests
2122

2223
task:
2324
name: macOS Monterey Apple LLVM 13.0.0
2425
macos_instance:
2526
image: ghcr.io/cirruslabs/macos-ventura-base:latest
2627
install_script: brew install git gmp mpfr libmpc cmake make
2728
compile_script:
28-
- export CI=true; sh build.sh
29+
- export CI=true; export NPROC=$(sysctl -n hw.ncpu); sh build.sh
2930
tests_script: ${HOME}/.feral/bin/feral testdir tests

build.sh

+5-29
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env sh
22
echo '[INFO] Feral Installer - (c) Copyright 2020 Maximilian Götz (https://www.maxbits.net/)'
3-
echo '[INFO] Please make sure that Sudo, Git, CMake, LibGMP and LibMPFR are installed!'
4-
echo '[INFO] Installation started. Fetching system cores...'
3+
echo '[INFO] Please make sure that Git, CMake, LibGMP and LibMPFR are installed!'
54

65
# Get current working directory
76
CWD="$(pwd)"
@@ -29,23 +28,8 @@ if [ "$SYSNAME" = "Darwin" ]; then
2928
export CXXFLAGS="$CXXFLAGS -I$BREWGMP/include -I$BREWMPFR/include -I$BREWMPC/include"
3029
export LDFLAGS="$LDFLAGS -L$BREWGMP/lib -L$BREWMPFR/lib -L$BREWMPC/lib"
3130
fi
32-
CORES=1
33-
# Get system cores for faster build
34-
if [ "$SYSNAME" = "Linux" ]; then
35-
CORES=$(nproc)
36-
else # for BSD and macOS
37-
CORES=$(sysctl -n hw.ncpu)
38-
fi
39-
echo "[INFO] Using $CORES cores"
4031

41-
echo '[INFO] Checking for Git, Sudo and CMake...'
42-
# No sudo on macOS since /usr/local is not usually root owned (as long as homebrew is installed)
43-
SUDO="sudo"
44-
if [ "$SYSNAME" = "Darwin" ] && hash brew 2>/dev/null || [ "$(id -u)" = "0" ]; then
45-
SUDO=""
46-
else
47-
echo '[INFO] Using sudo.'
48-
fi
32+
echo '[INFO] Checking for Git and CMake...'
4933

5034
# Check for Git
5135
if hash git 2>/dev/null; then
@@ -55,16 +39,6 @@ else
5539
exit
5640
fi
5741

58-
# Check for sudo
59-
if [ "$SUDO" = "sudo" ]; then
60-
if hash sudo 2>/dev/null; then
61-
echo '[INFO] sudo found.'
62-
else
63-
echo '[FATAL] sudo not available! Install it to continue! Aborting...'
64-
exit
65-
fi
66-
fi
67-
6842
# Check for CMake
6943
if hash cmake 2>/dev/null; then
7044
echo '[INFO] CMake found.'
@@ -79,12 +53,14 @@ trap exit_handler INT
7953

8054
build() {
8155
mkdir build && cd build
56+
CORES=""
8257
if [ -n "$CI" ]; then
8358
export DISABLE_MARCH_NATIVE="true"
59+
CORES="$NPROC"
8460
fi
8561
cmake .. -DCMAKE_BUILD_TYPE=Release
8662
if [ "$?" -ne 0 ]; then exit 1; fi
87-
make -j$CORES install
63+
make -j$NPROC install
8864
if [ "$?" -ne 0 ]; then exit 1; fi
8965
cd ..
9066
}

0 commit comments

Comments
 (0)