@@ -99,6 +99,7 @@ RUN wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3
9999RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
100100 sh -s -- -y --profile minimal
101101ENV PATH="/root/.cargo/bin:${PATH}"
102+ RUN rustup component add rust-src --toolchain nightly-2026-02-11-x86_64-unknown-linux-gnu
102103
103104
104105# Build lind-boot
@@ -124,12 +125,14 @@ RUN make lind-boot
124125FROM base AS build-glibc
125126# NOTE: Using 'make' risks cache invalidation on unrelated Makefile changes
126127COPY scripts ./scripts
128+ COPY tools ./tools
127129COPY --parents src/glibc Makefile .
128- RUN make sysroot
130+ COPY --from=build-lind-boot --parents build/lind-boot .
131+ RUN make sysroot \
132+ && test -f lindfs/lib/libc.cwasm \
133+ && test -f lindfs/lib/libm.cwasm
129134
130135
131- # Build Docker image that includes the full lind-wasm toolchain
132- # NOTE: Lind-wasm source code is not included
133136# Build Docker image that includes the full lind-wasm toolchain
134137# NOTE: Lind-wasm source code is not included
135138FROM base AS release
@@ -139,33 +142,45 @@ COPY --from=build-lind-boot --parents build/lind-boot .
139142RUN chmod 0755 /build/lind-boot
140143COPY --from=build-glibc --parents src/glibc/sysroot .
141144COPY --from=build-glibc --parents build/sysroot .
145+ COPY --from=build-glibc --parents lindfs .
142146COPY --parents scripts tests tools skip_test_cases.txt .
143147
144148ENV LIND_WASM_ROOT=/
145149
146- RUN install -D -m 0755 /scripts/lind_compile /usr/local/bin/lind_compile \
147- && install -D -m 0755 /scripts/lind_run /usr/local/bin/lind_run \
150+ RUN chmod 0755 /scripts/lind_compile /scripts/lind_run /scripts/cargo-lind_compile \
151+ && ln -sf /scripts/lind_compile /usr/local/bin/lind_compile \
152+ && ln -sf /scripts/lind_run /usr/local/bin/lind_run \
153+ && install -D -m 0755 /scripts/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
148154 && ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
149- && ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm
155+ && ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm \
156+ && ln -sf /usr/local/bin/cargo-lind_compile /usr/local/bin/lind-cargo-build
150157
151158
152159# Run all tests, print results, and exit with 1, if any test fails; 0 otherwise
153160FROM base AS test
154161ENV LIND_WASM_ROOT=/
155162COPY --parents scripts tests tools skip_test_cases.txt Makefile .
156163RUN chmod 0755 /scripts/test_runner.py /scripts/lind_compile /scripts/lind_run \
157- && install -D -m 0755 /scripts/lind_compile /usr/local/bin/lind_compile \
158- && install -D -m 0755 /scripts/lind_run /usr/local/bin/lind_run \
164+ && chmod 0755 /scripts/cargo-lind_compile \
165+ && ln -sf /scripts/lind_compile /usr/local/bin/lind_compile \
166+ && ln -sf /scripts/lind_run /usr/local/bin/lind_run \
167+ && install -D -m 0755 /scripts/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
159168 && ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
160- && ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm
169+ && ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm \
170+ && ln -sf /usr/local/bin/cargo-lind_compile /usr/local/bin/lind-cargo-build
171+ # NOTE: Precompiled lindfs runtime libraries are mounted and copied into the
172+ # writable test lindfs so runtime preloads like /lib/libc.cwasm are available.
161173# Create symlink so hardcoded paths in wasmtime match Docker environment
162174RUN mkdir -p /home/lind && ln -sf / /home/lind/lind-wasm
163175# NOTE: Build artifacts from prior stages are only mounted, to save COPY time
164176# and cache layers. This means they are not preserved in the resulting image.
165177RUN --mount=from=build-lind-boot,source=src/lind-boot/target,destination=src/lind-boot/target \
166178 --mount=from=build-lind-boot,source=build/lind-boot,destination=/build/lind-boot \
179+ --mount=from=build-glibc,source=lindfs,destination=/prebuilt-lindfs,readonly \
167180 --mount=from=build-glibc,source=src/glibc/sysroot,destination=src/glibc/sysroot \
168- make test && \
181+ make PREBUILT_LINDFS_ROOT=/prebuilt-lindfs \
182+ LIND_RUNTIME_LINDFS_ALIAS=/home/lind/lind-wasm/lindfs \
183+ test && \
169184 make md_generation OUT=/ REPORT=/report.html
170185
171186
0 commit comments