1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ci: fix the vinix-build job

This commit is contained in:
Delyan Angelov
2021-07-26 08:49:03 +03:00
parent b44f81528f
commit b666482d84
3 changed files with 61 additions and 3 deletions

56
.github/workflows/build_vinix_locally.sh vendored Executable file
View File

@@ -0,0 +1,56 @@
#!/bin/bash
set -e
V=$PWD/v
if [[ -x "$V" ]]
then
echo "The v executable exists."
else
echo "This script should be run from the top level folder of a V repository"
echo "i.e. the folder where your V executable is."
exit 1
fi
BUILD=$PWD/vinix_build
echo "Creating $BUILD folder..."
rm -rf $BUILD
mkdir -p $BUILD
cd $BUILD
echo "Clone current Vinix"
git clone https://github.com/vlang/vinix.git --depth=1
cd $BUILD
echo "Clone current mlibc"
git clone https://github.com/managarm/mlibc.git --depth=1
cd $BUILD
echo "Patch mlibc for Vinix"
cd mlibc
patch -p3 < ../vinix/patches/mlibc/mlibc.patch
cd $BUILD
echo "Install mlibc headers"
mkdir mlibc-build
cd mlibc-build
meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc
ninja
mkdir ../mlibc-headers
DESTDIR=`realpath ../mlibc-headers` ninja install
cd $BUILD
echo "Attempt to build the Vinix kernel (debug)"
cd vinix/kernel
make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include"
make clean
cd $BUILD
echo "Attempt to build the Vinix kernel (prod)"
cd vinix/kernel
make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include"
make clean
rm -rf $BUILD

View File

@@ -7,7 +7,7 @@ on:
- master
jobs:
build:
vinix-build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
@@ -24,6 +24,6 @@ jobs:
- name: Install mlibc headers
run: mkdir mlibc-build && cd mlibc-build && meson --cross-file ../vinix/cross_file.txt --prefix=/ -Dheaders_only=true ../mlibc && ninja && mkdir ../mlibc-headers && DESTDIR=`realpath ../mlibc-headers` ninja install
- name: Attempt to build the Vinix kernel (debug)
run: cd vinix/kernel && make PROD=false CFLAGS="-O2 -g -pipe -I../mlibc-headers/include" V="../../v" && make clean
run: cd vinix/kernel && make PROD=false CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" V="../../v" && make clean
- name: Attempt to build the Vinix kernel (prod)
run: cd vinix/kernel && make PROD=true CFLAGS="-O2 -g -pipe -I../mlibc-headers/include" V="../../v" && make clean
run: cd vinix/kernel && make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include" V="../../v" && make clean