Skip to content

Commit a309186

Browse files
Merge branch 'main' of github.com:Lind-Project/lind-wasm
2 parents 51daafd + 31008a3 commit a309186

64 files changed

Lines changed: 1649 additions & 378 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
# - securesystemslab/lind-wasm-dev:latest
2424
- name: Docker meta
2525
id: meta
26-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
26+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
2727
with:
2828
images: |
2929
securesystemslab/lind-wasm-dev

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
echo "----------------------------------"
9797
9898
- name: Upload HTML report artifact to report
99-
uses: actions/upload-artifact@v4
99+
uses: actions/upload-artifact@v5
100100
with:
101101
name: wasm-e2e-report
102102
path: ${{ env.REPORT_LOCAL_DIR }}/${{ env.REPORT_LOCAL_FILE }}

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
-A clippy::not_unsafe_ptr_arg_deref \
5050
-A clippy::absurd_extreme_comparisons
5151
- name: Install Zizmor via Cargo
52-
run: cargo install zizmor
52+
run: cargo install zizmor --version 1.15.2
5353

5454
- name: Run Zizmor
5555
env:

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
# - securesystemslab/lind-wasm:latest
3232
- name: Docker meta
3333
id: meta
34-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
34+
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
3535
with:
3636
images: |
3737
securesystemslab/lind-wasm

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ clang+llvm-*
88

99
#Ignore Build artifacts
1010
src/glibc/build/
11-
src/RawPOSIX/tmp/
11+
src/tmp/

Docker/Dockerfile.dev

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends -qq \
2727
bison \
2828
build-essential \
2929
ca-certificates \
30+
wabt \
31+
strace \
3032
curl \
3133
gawk \
3234
git \
@@ -94,6 +96,17 @@ ENV PATH="/usr/local/bin:/home/${USERNAME}/.cargo/bin:/home/${USERNAME}/go/bin:$
9496
ENV CLANG="/home/${USERNAME}/lind-wasm/${CLANG_PACKAGE}"
9597

9698
# --- Prebuild ---
97-
RUN make sysroot && make wasmtime
99+
ENV WASMTIME_PROFILE=debug
100+
RUN make sysroot && make wasmtime-debug
101+
102+
# --- Make lind_* available from anywhere in the dev container ---
103+
# Tell scripts where the repo is (they are installed to /usr/local/bin)
104+
ENV LIND_WASM_ROOT=/home/${USERNAME}/lind-wasm
105+
USER root
106+
RUN install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/lind_compile /usr/local/bin/lind_compile \
107+
&& install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/lind_run /usr/local/bin/lind_run \
108+
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
109+
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm
110+
USER ${USERNAME}
98111

99112
CMD ["/bin/bash"]

Docker/Dockerfile.e2e

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ RUN apt-get update && \
4040
bison \
4141
build-essential \
4242
ca-certificates \
43+
wabt \
44+
strace \
4345
curl \
4446
gawk \
4547
libc6-dev-i386-cross \
@@ -100,10 +102,18 @@ COPY --from=build-wasmtime --parents src/wasmtime/target .
100102
COPY --from=build-glibc --parents src/glibc/sysroot .
101103
COPY --parents scripts tests tools skip_test_cases.txt .
102104

105+
ENV LIND_WASM_ROOT=/
106+
RUN install -D -m 0755 /scripts/lind_compile /usr/local/bin/lind_compile \
107+
&& install -D -m 0755 /scripts/lind_run /usr/local/bin/lind_run \
108+
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
109+
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm
110+
103111

104112
# Run all tests, print results, and exit with 1, if any test fails; 0 otherwise
105113
FROM base AS test
106114
COPY --parents scripts tests tools skip_test_cases.txt Makefile .
115+
# Create symlink so hardcoded paths in wasmtime match Docker environment
116+
RUN mkdir -p /home/lind && ln -sf / /home/lind/lind-wasm
107117
# NOTE: Build artifacts from prior stages are only mounted, to save COPY time
108118
# and cache layers. This means they are not preserved in the resulting image.
109119
RUN --mount=from=build-wasmtime,source=src/wasmtime/target,destination=src/wasmtime/target \

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
LIND_ROOT ?= src/tmp
12

23
.PHONY: build
34
build: sysroot wasmtime
45
@echo "Build complete"
56

7+
.PHONY: prepare-lind-root
8+
prepare-lind-root:
9+
mkdir -p $(LIND_ROOT)/dev
10+
touch $(LIND_ROOT)/dev/null
11+
612
.PHONY: all
713
all: build
814

@@ -15,10 +21,15 @@ wasmtime:
1521
# Build wasmtime with `--release` flag for faster runtime (e.g. for tests)
1622
cargo build --manifest-path src/wasmtime/Cargo.toml --release
1723

24+
.PHONY: wasmtime-debug
25+
wasmtime-debug:
26+
# Build wasmtime in debug mode for faster iteration in devcontainer
27+
cargo build --manifest-path src/wasmtime/Cargo.toml
28+
1829
.PHONY: test
19-
test:
30+
test: prepare-lind-root
2031
# NOTE: `grep` workaround required for lack of meaningful exit code in wasmtestreport.py
21-
LIND_WASM_BASE=. LIND_FS_ROOT=src/RawPOSIX/tmp \
32+
LIND_WASM_BASE=. LIND_ROOT=$(LIND_ROOT) \
2233
./scripts/wasmtestreport.py && \
2334
cat results.json; \
2435
if grep -q '"number_of_failures": [^0]' results.json; then \
@@ -85,5 +96,5 @@ clean:
8596
distclean: clean
8697
@echo "removing test outputs & temp files"
8798
$(RM) -f results.json report.html
88-
$(RM) -r src/RawPOSIX/tmp/testfiles || true
99+
$(RM) -r $(LIND_ROOT)/testfiles || true
89100
find tests -type f \( -name '*.wasm' -o -name '*.cwasm' -o -name '*.o' \) -delete

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In Old Norse, Old High German and Old English a “lind” is a shield construct
1414
## Getting started
1515

1616
Check out the [Getting started](https://lind-project.github.io/lind-wasm/getting-started/)
17-
guide and [docs on our website](https://lind-project.github.io/lind-wasm/)
17+
guide for a Hello World! example and [our docs](https://lind-project.github.io/lind-wasm/)
1818
to learn more about Lind!
1919

2020

@@ -28,7 +28,10 @@ This monorepo combines various subprojects and dependencies that work together t
2828
| Component | Location | Description |
2929
|---------------|-------------------|-----------------------------------------------------------------------------|
3030
| `fdtables` | `src/fdtables` | Provides file descriptor table management, used to emulate POSIX semantics |
31-
| `RawPOSIX` | `src/RawPOSIX` | Implementation of raw POSIX syscall wrappers used internally by Lind |
31+
| `rawposix` | `src/rawposix` | Implementation of raw POSIX syscall wrappers used internally by Lind |
32+
| `threei` | `src/threei` | System call mediation layer for policy deployment |
33+
| `typemap` | `src/typemap` | Defines custom data structures and type conversion functions used across Lind |
34+
| `cage` | `src/cage` | Implements the custom `Cage` structure and its subsystems, including `vmmap` (virtual memory mapping) and `signal` handling |
3235
| `sysdefs` | `src/sysdefs` | Shared system call definitions and constants for cross-platform support |
3336

3437
### Third-Party Projects (Source)

docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ EOF
3939
Use lind scripts to compile and run your program in the Lind Sandbox.
4040

4141
```bash
42-
./scripts/lind_compile hello.c
43-
./scripts/lind_run hello.cwasm
42+
lind-clang hello.c
43+
lind-wasm hello.cwasm
4444
```
4545

4646
*Here is what happens under the hood:*

0 commit comments

Comments
 (0)