Skip to content

Commit

Permalink
ci: use shebang with better portability in shell scripts, format shel…
Browse files Browse the repository at this point in the history
…l scripts (#21605)
  • Loading branch information
ttytm authored May 30, 2024
1 parent a4afcba commit 5f83a4d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/build_vinix_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ echo "Clone current mlibc"

cd $BUILD
echo "Patch mlibc for Vinix"
cd mlibc
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
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"
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"
cd vinix/kernel
make PROD=true CFLAGS="-D__vinix__ -O2 -g -pipe -I../../mlibc-headers/include"
make clean

rm -rf $BUILD
8 changes: 4 additions & 4 deletions .github/workflows/compile_shaders_in_examples.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#!/usr/bin/env bash

for f in examples/sokol/*/ ; do
echo "compiling shaders for $f ...";
time ./v shader $f;
for f in examples/sokol/*/ ; do
echo "compiling shaders for $f ...";
time ./v shader $f;
echo "done";
done;
6 changes: 3 additions & 3 deletions .github/workflows/compile_v_with_vtcc.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
#!/usr/bin/env bash

set -ex

function show() {
printf "\u001b[35m$1\u001b[0m\n"
printf "\u001b[35m$1\u001b[0m\n"
}

show "Prepare"
Expand All @@ -23,7 +23,7 @@ show "Generate the C file, for the current V version"
ls -la vlang.c

show "Compile the C file with vtcc"
export tcclib=thirdparty/tcc/lib/tcc
export tcclib=thirdparty/tcc/lib/tcc
export tccinc=$tcclib/include
./vtcc/xx -o v_compiled_with_vtcc vlang.c -L$tcclib -I$tccinc -lc -ldl -pthread -ltcc1 $tcclib/bt-log.o
ls -la v_compiled_with_vtcc
Expand Down

0 comments on commit 5f83a4d

Please sign in to comment.