aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-08-15 19:09:44 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-08-15 19:09:44 +0200
commit435107ce4faeab84678fcd1d7c44837025c6ae68 (patch)
treedf1a522dfc3b33525959986441efe2b395f099d7
parent325778cb5f4b169ef7e197e179cfb889808d10c2 (diff)
downloadnissy-core-435107ce4faeab84678fcd1d7c44837025c6ae68.tar.gz
nissy-core-435107ce4faeab84678fcd1d7c44837025c6ae68.zip
Updates to container runner and removed simd from wasm build
-rwxr-xr-xbuild.sh5
-rwxr-xr-xutils/container-run.sh60
2 files changed, 42 insertions, 23 deletions
diff --git a/build.sh b/build.sh
index 7cd38e3..502dbcf 100755
--- a/build.sh
+++ b/build.sh
@@ -148,11 +148,10 @@ CPPFLAGS="-std=c++20 $(maybe_pthread)"
148# The options below have to be adjusted when native WASM_SIMD is implemented. 148# The options below have to be adjusted when native WASM_SIMD is implemented.
149 149
150# Build flags for emscripten (WASM target) 150# Build flags for emscripten (WASM target)
151WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread) 151WASMCFLAGS="-std=c11 -fPIC -D_POSIX_C_SOURCE=199309L $(maybe_pthread)"
152 -mfpu=neon -mrelaxed-simd"
153WASMCPPFLAGS="-std=c++20 $(maybe_pthread)" 152WASMCPPFLAGS="-std=c++20 $(maybe_pthread)"
154WASMDBGFLAGS="-sASSERTIONS" 153WASMDBGFLAGS="-sASSERTIONS"
155WASMMFLAGS="-DTHREADS=$THREADS -DNEON" 154WASMMFLAGS="-DTHREADS=$THREADS -DPORTABLE"
156WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE 155WASMLINKFLAGS="--no-entry -sEXPORT_NAME='Nissy' -sMODULARIZE
157 -sEXPORTED_RUNTIME_METHODS=addFunction,UTF8ToString 156 -sEXPORTED_RUNTIME_METHODS=addFunction,UTF8ToString
158 -sALLOW_TABLE_GROWTH 157 -sALLOW_TABLE_GROWTH
diff --git a/utils/container-run.sh b/utils/container-run.sh
index 6090e1c..df17b74 100755
--- a/utils/container-run.sh
+++ b/utils/container-run.sh
@@ -24,8 +24,9 @@ usage() {
24 echo "If COMMAND is unspecified, an interactive shell will be opened." 24 echo "If COMMAND is unspecified, an interactive shell will be opened."
25 echo "" 25 echo ""
26 echo "Available platforms:" 26 echo "Available platforms:"
27 echo "x86 (equivalent to: x86_64, amd64)" 27 echo "x86 (equivalent to: x86_64, amd64)"
28 echo "arm (equivalent to: arm64)" 28 echo "arm (equivalent to: arm64)"
29 echo "emscripten"
29 echo "" 30 echo ""
30 echo "Examples:" 31 echo "Examples:"
31 echo "$0 ram ./build.sh test # Run unit tests in arm container" 32 echo "$0 ram ./build.sh test # Run unit tests in arm container"
@@ -36,13 +37,48 @@ if [ -z "$1" ]; then
36 usage "No platform given." 37 usage "No platform given."
37fi 38fi
38 39
40config_standard() {
41 image="localhost/nissy/alpine-$1"
42 platform="--platform=linux/$1"
43 mount="--mount type=bind,src=./,dst=/nissy-core"
44 flags="--rm --privileged"
45
46 dockerfile="$(mktemp)"
47 cat > "$dockerfile" << EOF
48 FROM alpine:3.22
49 RUN apk update
50 RUN apk add gcc g++ clang python3 python3-dev
51 RUN mkdir /nissy-core
52 WORKDIR /nissy-core
53 USER 1000:1000
54EOF
55}
56
57config_emscripten() {
58 image="localhost/nissy/emscripten"
59 platform="--platform=linux/amd64"
60 mount="--mount type=bind,src=./,dst=/nissy-core"
61 flags="--rm --privileged"
62
63 dockerfile="$(mktemp)"
64 cat > "$dockerfile" << EOF
65 FROM emscripten/emsdk
66 WORKDIR /nissy-core
67 USER 1000:1000
68EOF
69}
70
39case "$1" in 71case "$1" in
40x86|x86_64|amd64) 72x86|x86_64|amd64)
41 p=amd64 73 config_standard amd64
42 shift 74 shift
43 ;; 75 ;;
44arm|arm64) 76arm|arm64)
45 p=arm64 77 config_standard arm64
78 shift
79 ;;
80emscripten)
81 config_emscripten
46 shift 82 shift
47 ;; 83 ;;
48*) 84*)
@@ -50,22 +86,6 @@ arm|arm64)
50 ;; 86 ;;
51esac 87esac
52 88
53image="localhost/nissy/alpine-$p"
54platform="--platform=linux/$p"
55mount="--mount type=bind,src=./,dst=/nissy-core"
56flags="--rm --privileged"
57
58dockerfile="$(mktemp)"
59cat > "$dockerfile" << EOF
60FROM alpine:3.22.1
61RUN apk update
62RUN apk add gcc g++ clang python3 python3-dev
63#COPY . ./nissy-core
64RUN mkdir /nissy-core
65WORKDIR /nissy-core
66USER 1000:1000
67EOF
68
69docker build "$platform" -f "$dockerfile" -t "$image" . 89docker build "$platform" -f "$dockerfile" -t "$image" .
70rm "$dockerfile" 90rm "$dockerfile"
71 91

Generated with cgit - Back to sebastiano.tronto.net