Skip to content

Commit

Permalink
Docker: fix docker builds with wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
oxpa authored and thresheek committed Sep 17, 2024
1 parent 2417826 commit dadad1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/docker/Dockerfile.wasm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN set -ex \
&& make -j $NCPU unitd \
&& install -pm755 build/sbin/unitd /usr/sbin/unitd \
&& make clean \
&& apt-get install --no-install-recommends --no-install-suggests -y libclang-dev \
&& apt-get install --no-install-recommends --no-install-suggests -y libclang-dev cmake \
&& export RUST_VERSION=1.80.1 \
&& export RUSTUP_HOME=/usr/src/unit/rustup \
&& export CARGO_HOME=/usr/src/unit/cargo \
Expand All @@ -66,13 +66,13 @@ RUN set -ex \
&& cargo --version \
&& rustc --version \
&& make -C pkg/contrib .wasmtime \
&& install -pm 755 pkg/contrib/wasmtime/target/release/libwasmtime.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
&& install -pm 755 pkg/contrib/wasmtime/artifacts/lib/libwasmtime.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/debug-modules --debug \
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/artifacts/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
&& make -j $NCPU wasm-install wasm-wasi-component-install \
&& make clean \
&& ./configure $CONFIGURE_ARGS_MODULES --cc-opt="$CC_OPT" --modulesdir=/usr/lib/unit/modules \
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
&& ./configure wasm --include-path=`pwd`/pkg/contrib/wasmtime/artifacts/include --lib-path=/usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ && ./configure wasm-wasi-component \
&& make -j $NCPU wasm-install wasm-wasi-component-install \
&& cd \
&& rm -rf /usr/src/unit \
Expand Down
6 changes: 3 additions & 3 deletions pkg/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ MODULE_PREBUILD_ruby ?= /bin/true

VERSIONS_wasm ?=
CONTAINER_wasm ?= debian:$(VARIANT)-slim
CONFIGURE_wasm ?= wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/crates/c-api/include --lib-path=/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \&\& ./configure wasm-wasi-component
CONFIGURE_wasm ?= wasm --include-path=\`pwd\`/pkg/contrib/wasmtime/artifacts/include --lib-path=/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ \&\& ./configure wasm-wasi-component
INSTALL_wasm ?= wasm-install wasm-wasi-component-install
RUN_wasm ?= /bin/true
define MODULE_PREBUILD_wasm
apt-get install --no-install-recommends --no-install-suggests -y libclang-dev \\\n \
apt-get install --no-install-recommends --no-install-suggests -y libclang-dev cmake \\\n \
\ \ \ \&\& export RUST_VERSION=1.80.1 \\\n \
\ \ \ \&\& export RUSTUP_HOME=/usr/src/unit/rustup \\\n \
\ \ \ \&\& export CARGO_HOME=/usr/src/unit/cargo \\\n \
Expand All @@ -105,7 +105,7 @@ apt-get install --no-install-recommends --no-install-suggests -y libclang-dev \\
\ \ \ \&\& cargo --version \\\n \
\ \ \ \&\& rustc --version \\\n \
\ \ \ \&\& make -C pkg/contrib .wasmtime \\\n \
\ \ \ \&\& install -pm 755 pkg/contrib/wasmtime/target/release/libwasmtime.so /usr/lib/\$$\(dpkg-architecture -q DEB_HOST_MULTIARCH\)/
\ \ \ \&\& install -pm 755 pkg/contrib/wasmtime/artifacts/lib/libwasmtime.so /usr/lib/\$$\(dpkg-architecture -q DEB_HOST_MULTIARCH\)/
endef
default:
Expand Down

0 comments on commit dadad1f

Please sign in to comment.