Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ RUN make lind-debug
# Tell scripts where the repo is (they are installed to /usr/local/bin)
ENV LIND_WASM_ROOT=/home/${USERNAME}/lind-wasm
USER root
RUN install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/lind_compile /usr/local/bin/lind_compile \
&& install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
RUN install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/bin/lind_compile /usr/local/bin/lind_compile \
&& install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/bin/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /home/${USERNAME}/lind-wasm/scripts/bin/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm \
&& ln -sf /usr/local/bin/cargo-lind_compile /usr/local/bin/lind-cargo-build
# Replace copied helper scripts with symlinks so local edits are reflected.
RUN rm -f /usr/local/bin/lind_compile /usr/local/bin/lind_run \
&& ln -sf /home/${USERNAME}/lind-wasm/scripts/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /home/${USERNAME}/lind-wasm/scripts/lind_run /usr/local/bin/lind_run
&& ln -sf /home/${USERNAME}/lind-wasm/scripts/bin/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /home/${USERNAME}/lind-wasm/scripts/bin/lind_run /usr/local/bin/lind_run
USER ${USERNAME}

CMD ["/bin/bash"]
20 changes: 10 additions & 10 deletions Docker/Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ COPY --parents scripts tests tools skip_test_cases.txt .

ENV LIND_WASM_ROOT=/

RUN chmod 0755 /scripts/lind_compile /scripts/lind_run /scripts/cargo-lind_compile \
&& ln -sf /scripts/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /scripts/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /scripts/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
RUN chmod 0755 /scripts/bin/lind_compile /scripts/bin/lind_run /scripts/bin/cargo-lind_compile \
&& ln -sf /scripts/bin/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /scripts/bin/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /scripts/bin/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm \
&& ln -sf /usr/local/bin/cargo-lind_compile /usr/local/bin/lind-cargo-build
Expand All @@ -161,12 +161,12 @@ RUN chmod 0755 /scripts/lind_compile /scripts/lind_run /scripts/cargo-lind_compi
FROM base AS test
ENV LIND_WASM_ROOT=/
COPY --parents scripts tests tools skip_test_cases.txt Makefile artifacts .
RUN chmod 0755 /scripts/test_runner.py /scripts/lind_compile /scripts/lind_compile_cpp /scripts/lind_run \
&& chmod 0755 /scripts/cargo-lind_compile \
&& ln -sf /scripts/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /scripts/lind_compile_cpp /usr/local/bin/lind_compile_cpp \
&& ln -sf /scripts/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /scripts/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
RUN chmod 0755 /scripts/test/test_runner.py /scripts/bin/lind_compile /scripts/bin/lind_compile_cpp /scripts/bin/lind_run \
&& chmod 0755 /scripts/bin/cargo-lind_compile \
&& ln -sf /scripts/bin/lind_compile /usr/local/bin/lind_compile \
&& ln -sf /scripts/bin/lind_compile_cpp /usr/local/bin/lind_compile_cpp \
&& ln -sf /scripts/bin/lind_run /usr/local/bin/lind_run \
&& install -D -m 0755 /scripts/bin/cargo-lind_compile /usr/local/bin/cargo-lind_compile \
&& ln -sf /usr/local/bin/lind_compile /usr/local/bin/lind-clang \
&& ln -sf /usr/local/bin/lind_run /usr/local/bin/lind-wasm \
&& ln -sf /usr/local/bin/cargo-lind_compile /usr/local/bin/lind-cargo-build
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fpcast:

.PHONY: sysroot
sysroot: build-dir
./scripts/make_glibc_and_sysroot.sh $(if $(WITH_FPCAST),--with-fpcast)
./scripts/build/make_glibc_and_sysroot.sh $(if $(WITH_FPCAST),--with-fpcast)
$(MAKE) sync-sysroot

# fdtables backend selector. One of: dashmaparray (default), dashmapvec,
Expand Down Expand Up @@ -74,9 +74,9 @@ lindfs:
mkdir -p $(LINDFS_ROOT)/$$d; \
done
touch $(LINDFS_ROOT)/dev/null
cp -rT scripts/lindfs-conf/etc $(LINDFS_ROOT)/etc
cp -rT scripts/lindfs-conf/usr/lib/locale $(LINDFS_ROOT)/usr/lib/locale
cp -rT scripts/lindfs-conf/usr/share/zoneinfo $(LINDFS_ROOT)/usr/share/zoneinfo
cp -rT scripts/config/lindfs-conf/etc $(LINDFS_ROOT)/etc
cp -rT scripts/config/lindfs-conf/usr/lib/locale $(LINDFS_ROOT)/usr/lib/locale
cp -rT scripts/config/lindfs-conf/usr/share/zoneinfo $(LINDFS_ROOT)/usr/share/zoneinfo
@if [ -d /usr/share/zoneinfo ]; then \
cp -r /usr/share/zoneinfo/* $(LINDFS_ROOT)/usr/share/zoneinfo/; \
fi
Expand All @@ -102,7 +102,7 @@ build_glibc:
# build sysroot passing -DLIND_DEBUG if LIND_DEBUG is set
if [ "$(LIND_DEBUG)" = "1" ]; then \
echo "Building glibc with LIND_DEBUG enabled"; \
./scripts/make_glibc_and_sysroot.sh; \
./scripts/build/make_glibc_and_sysroot.sh; \
$(MAKE) sync-sysroot; \
fi

Expand Down Expand Up @@ -159,12 +159,12 @@ test: lindfs
cp -a "$$prebuilt_lindfs_root/lib/." "$(LINDFS_ROOT)/lib/"; \
fi; \
if LIND_WASM_BASE=. LINDFS_ROOT=$(LINDFS_ROOT) \
python3 ./scripts/test_runner.py --export-report report.html && \
python3 ./scripts/test/test_runner.py --export-report report.html && \
find reports -maxdepth 1 -name '*.json' -print -exec cat {} \; && \
if [ "$(LIND_DEBUG)" = "1" ]; then \
python3 ./scripts/check_reports.py --debug; \
python3 ./scripts/test/check_reports.py --debug; \
else \
python3 ./scripts/check_reports.py; \
python3 ./scripts/test/check_reports.py; \
fi; then \
echo "E2E_STATUS=pass" > e2e_status; \
else \
Expand Down Expand Up @@ -216,7 +216,7 @@ test-grate:
echo "GRATE and GRATE_PREFIX are mutually exclusive"; exit 1; \
fi
LIND_WASM_BASE=. LINDFS_ROOT=$(LINDFS_ROOT) \
python3 ./scripts/harnesses/wasmtestreport.py \
python3 ./scripts/test/harnesses/wasmtestreport.py \
--allow-pre-compiled \
$(if $(GRATE),--grate grates/$(GRATE).cwasm) \
$(if $(GRATE_ARGS),--grate-args "$(GRATE_ARGS)") \
Expand All @@ -231,7 +231,7 @@ REPORT ?= report.html

md_generation:
python3 -m pip install --quiet jinja2
REPORT_PATH=$(REPORT) OUT_DIR=$(OUT) python3 scripts/render_e2e_templates.py
REPORT_PATH=$(REPORT) OUT_DIR=$(OUT) python3 scripts/generate/render_e2e_templates.py
@echo "Wrote $(OUT)/e2e_comment.md"


Expand Down
8 changes: 4 additions & 4 deletions docs/contribute/compile-with-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To compile Rust programs against **`lind-glibc`**:

- Ensure that the `scripts/cargo-lind_compile` script exists in `PATH`
- Ensure that the `scripts/bin/cargo-lind_compile` script exists in `PATH`
- Run `cargo lind_compile` at the root of your Rust crate.

`cargo-lind-compile` is a drop-in replace for `cargo build`. It supports the same flags (such as --release) and is intended to be used in same contexts.
Expand All @@ -17,7 +17,7 @@ Alternatively, you can use `lind-cargo-build` at the root of your Rust crate to
## 1. Cargo Configuration (`.cargo/config.toml`)

Create or modify `.cargo/config.toml` as follows (based on
`scripts/rust/config.toml.template`):
`scripts/config/rust/config.toml.template`):

```toml
[build]
Expand All @@ -26,7 +26,7 @@ target = "wasm32-wasip1"

[target.wasm32-wasip1]
# Use lind’s custom clang wrapper for glibc-based WASI linking
linker = "/home/lind-wasm/scripts/wasip1-clang.sh"
linker = "/home/lind-wasm/scripts/bin/wasip1-clang.sh"

rustflags = [
# Do not use Rust’s built-in self-contained WASI linker
Expand Down Expand Up @@ -63,7 +63,7 @@ rustflags = [

---

## 2. Custom Linker Wrapper (`scripts/wasip1-clang.sh`)
## 2. Custom Linker Wrapper (`scripts/bin/wasip1-clang.sh`)

The following script replaces Cargo’s default linker and ensures that:

Expand Down
4 changes: 2 additions & 2 deletions docs/contribute/e2e-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Multi-stage **.e2e** flow for lind-wasm **end-to-end testing and image creation*

### make sysroot

Runs `scripts/make_glibc_and_sysroot.sh` to:
Runs `scripts/build/make_glibc_and_sysroot.sh` to:

- Configure & build glibc (WASM/WASI target) and compile additional NPTL/syscall bits and tiny ASM stubs.

Expand All @@ -82,7 +82,7 @@ Runs `scripts/make_glibc_and_sysroot.sh` to:

### make test

Runs `scripts/wasmtestreport.py` which:
Runs `scripts/test/harnesses/wasmtestreport.py` which:

- Discovers tests from the repository’s test trees and honors `skip_test_cases.txt`.

Expand Down
6 changes: 3 additions & 3 deletions docs/contribute/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ make lind-boot sysroot
```
6. Run the test suite
```
./scripts/wasmtestreport.py
./scripts/test/harnesses/wasmtestreport.py
```
Run `scripts/wasmtestreport.py --help` to list available usage options.
Run `scripts/test/harnesses/wasmtestreport.py --help` to list available usage options.

## Directory Structure

Expand Down Expand Up @@ -98,7 +98,7 @@ lind-wasm outputs are compared to the native gcc output.
### Example Combined Usage

```
./scripts/wasmtestreport.py \
./scripts/test/harnesses/wasmtestreport.py \
--generate-html \
--skip config_tests file_tests \
--timeout 10 \
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ lind-wasm hello.cwasm

*Here is what happens under the hood:*

1. `lind-clang`(aka `scripts/lind_compile`) compiles `hello.c` into a WebAssembly (WASM)
1. `lind-clang`(aka `scripts/bin/lind_compile`) compiles `hello.c` into a WebAssembly (WASM)
binary that is linked against *lind-glibc*, and put into lind file system root(`lind-wasm/lindfs`).
1. `lind-wasm`(aka `scripts/lind_run`) runs the compiled wasm using *lind-wasm* runtime
1. `lind-wasm`(aka `scripts/bin/lind_run`) runs the compiled wasm using *lind-wasm* runtime
and the *lind-posix* microvisor.

---
Expand Down
16 changes: 8 additions & 8 deletions docs/internal/libcpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ int main(int argc, char **argv) {
note: main function parameter list signature is very rigid as omiting it causes compiler warnings (not fatal); a simple stdout is used for easier test report generation.

### Side note
Compiling .wasm binary involves setting some pretty length and boring flags for clang++ command, the lind-wasm repo already provides a pretty convenient compile script in ``scripts/lind_compile`` which basically bundles up those flags for you. Here are a couple caveats:
Compiling .wasm binary involves setting some pretty length and boring flags for clang++ command, the lind-wasm repo already provides a pretty convenient compile script in ``scripts/bin/lind_compile`` which basically bundles up those flags for you. Here are a couple caveats:
The script can only be used inside docker container
The script call signature is iffy, you must call it as: ``./scripts/lind_compile main.cpp`` and cannot assume its global availability: ``./lind_compile main.cpp`` **will not do what you want**.
The script call signature is iffy, you must call it as: ``./scripts/bin/lind_compile main.cpp`` and cannot assume its global availability: ``./lind_compile main.cpp`` **will not do what you want**.
The script is intended to be used on .c files only. I have made a spin-off ``lind_compile_cpp`` script based on it. A future improvevement would be to look at all flags allowed by that script and verify their functionalities.


So, the necessary steps here are: creating and stepping into a docker container, creating the dummy sort.cpp file (you can do this before stepping into the docker container step; it really doesn't matter), and attempt to compile with the script and just watch it fail.

```bash
lind@e9a40a72b750:~/lind-wasm$ scripts/lind_compile sort.cpp
lind@e9a40a72b750:~/lind-wasm$ scripts/bin/lind_compile sort.cpp
/home/lind/lind-wasm/sort.cpp:1:10: fatal error: 'algorithm' file not found
1 | #include <algorithm>
| ^~~~~~~~~~~
Expand Down Expand Up @@ -75,7 +75,7 @@ Creating a dummy ``sort.cpp``, and try to compile
This step is pretty self-explanatory. Just remember that we want to compile while assuming everything requires absolute path, so:

```bash
/home/lind/lind-wasm/scripts/lind_compile /home/lind/lind-wasm/sort.cpp
/home/lind/lind-wasm/scripts/bin/lind_compile /home/lind/lind-wasm/sort.cpp
```
Then you will quickly see the error described in issue [#740](https://github.com/Lind-Project/lind-wasm/issues/740#issuecomment-3910086697).

Expand Down Expand Up @@ -129,10 +129,10 @@ cp /home/lind/lind-wasm/libcxx-wasi-install/lib/libc++.a \
We are missing a libunwind.a archive; it is, for native cpp binary, needed to handle throw-except syntax. I tried to modify our CMake script and the build script to have this archive generated and then linked against the compilation process, and discovered that for .wasm binary, libunwind is not the correct dependency used to provide that syntax support. Currently I have no solution to it.

## Last step: test compile and it should work now
At this point, we have all we need to make the .wasm compilation work. Manually setting the correct clang++ flags is too much work, and luckily we have a scripts/lind_compile script which, originally designed for .c compilation, is almost entirely reusable directly for our .cpp compilation. Again, Alice already made the necessary changes to it in her commit to repurpose it for .cpp compilation only, and so we only need to use it. One more thing: remember we cannot support throw-exception? We do need some manual flag-setting to suppress that part. Luckily our simple dummy program does not need the throw-except syntax anyways. now make sure your are in lind-wasm dir (or just use absolute path for bash script below if you are not – by this point you should be really familiar with the project file hierarchy already.)
At this point, we have all we need to make the .wasm compilation work. Manually setting the correct clang++ flags is too much work, and luckily we have a scripts/bin/lind_compile script which, originally designed for .c compilation, is almost entirely reusable directly for our .cpp compilation. Again, Alice already made the necessary changes to it in her commit to repurpose it for .cpp compilation only, and so we only need to use it. One more thing: remember we cannot support throw-exception? We do need some manual flag-setting to suppress that part. Luckily our simple dummy program does not need the throw-except syntax anyways. now make sure your are in lind-wasm dir (or just use absolute path for bash script below if you are not – by this point you should be really familiar with the project file hierarchy already.)

```bash
scripts/lind_compile_cpp tests/unit-tests/cpp/sort.cpp
scripts/bin/lind_compile_cpp tests/unit-tests/cpp/sort.cpp
```
note that, I have added ``-fno-exceptions`` flag in that script. The throw-exception syntax is not supported at the moment, and that would be a **major area of improvement in the future**
note you can also additionally add -fno-rtti flag to save memory and speed up the compilation a bit more, but the compilation is quite slow regardless (takes ~1 minute)
Expand All @@ -146,7 +146,7 @@ tests/unit-tests/cpp/sort.cpp.wasm
exact fail message without ``-fno-exceptions`` flag:

```bash
lind@e9a40a72b750:~/lind-wasm$ scripts/lind_compile sort.cpp # deprecated
lind@e9a40a72b750:~/lind-wasm$ scripts/bin/lind_compile sort.cpp # deprecated
wasm-ld: warning: function signature mismatch: main
>>> defined as (i32, i32, i32) -> i32 in /home/lind/lind-wasm/build/sysroot/lib/wasm32-wasi/crt1.o
>>> defined as (i32, i32) -> i32 in /tmp/sort-d53fbc.o
Expand Down Expand Up @@ -183,7 +183,7 @@ Short path to validate the integrated libc++ smoke check (including native-vs-wa
make sysroot

# 2) Run only wasm harness (this also runs libc++ integration)
python3 scripts/test_runner.py --harness wasmtestreport
python3 scripts/test/test_runner.py --harness wasmtestreport
```

Expected result in `reports/wasm.json`:
Expand Down
12 changes: 6 additions & 6 deletions docs/internal/setjmp.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ themselves would have an undefined `__c_longjmp` at link time.
that has a dummy `_setjmp` call site; the pass emits a weak `__c_longjmp` tag
definition into it, which `wasm-ld` uses to satisfy all imports. This object must
be compiled **without `-fPIE`** (`EXTRA_FLAGS_NO_PIE` in
`scripts/make_glibc_and_sysroot.sh`), and is excluded from the `libc.so` shared
`scripts/build/make_glibc_and_sysroot.sh`), and is excluded from the `libc.so` shared
link since the dynamic build uses host-provided tag imports instead.

---
Expand Down Expand Up @@ -233,7 +233,7 @@ standard exnref format. The gap is bridged by Binaryen's `--translate-to-exnref`
pass, which `lind-wasm-opt` runs after asyncify:

```bash
# from scripts/lind-wasm-opt
# from scripts/bin/lind-wasm-opt
# Convert clang 18 legacy EH to standard EH after asyncify.
# Asyncify handles legacy EH natively; Cranelift only supports standard EH.
# --enable-reference-types is required because --translate-to-exnref emits
Expand Down Expand Up @@ -307,7 +307,7 @@ would make the common case O(1).
| `src/lind-boot/src/lind_wasmtime/execute.rs` | Host-provided `__c_longjmp` tag for dynamic builds |
| `src/wasmtime/crates/wasmtime/src/runtime/linker.rs` | `new_child_linker`: per-child `__c_longjmp` tag for forked cages |
| `src/wasmtime/crates/lind-multi-process/src/signal.rs` | `signal_handler` returns `wasmtime::Result` to propagate `ThrownException` through epoch callback |
| `scripts/make_glibc_and_sysroot.sh` | Compiles EH setjmp objects; strips `-fPIE` for tag anchor |
| `scripts/make_shared_glibc.sh` | Excludes `wasm_eh_c_longjmp_tag.o` from `libc.so` link |
| `scripts/lind_compile` | Adds `-fwasm-exceptions -mllvm -wasm-enable-sjlj` when `LIND_ASYNCIFY_SETJMP` unset |
| `scripts/lind-wasm-opt` | Runs `--translate-to-exnref` when `LIND_ASYNCIFY_SETJMP` unset |
| `scripts/build/make_glibc_and_sysroot.sh` | Compiles EH setjmp objects; strips `-fPIE` for tag anchor |
| `scripts/build/make_shared_glibc.sh` | Excludes `wasm_eh_c_longjmp_tag.o` from `libc.so` link |
| `scripts/bin/lind_compile` | Adds `-fwasm-exceptions -mllvm -wasm-enable-sjlj` when `LIND_ASYNCIFY_SETJMP` unset |
| `scripts/bin/lind-wasm-opt` | Runs `--translate-to-exnref` when `LIND_ASYNCIFY_SETJMP` unset |
4 changes: 2 additions & 2 deletions scripts/cargo-lind_compile → scripts/bin/cargo-lind_compile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ while [ "$#" -gt 0 ]; do
done

# Set linker (allow override via environment variable)
LINKER="${LIND_WASM_LINKER:-$HOME/lind-wasm/scripts/wasip1-clang.sh}"
LINKER="${LIND_WASM_LINKER:-$HOME/lind-wasm/scripts/bin/wasip1-clang.sh}"
export CARGO_TARGET_WASM32_WASIP1_LINKER="$LINKER"

# Set rustflags for wasm32-wasip1 target
Expand Down Expand Up @@ -57,7 +57,7 @@ if [ -z "$LIND_COMPILE_BIN" ]; then
if command -v lind_compile >/dev/null 2>&1; then
LIND_COMPILE_BIN="$(command -v lind_compile)"
else
LIND_COMPILE_BIN="$HOME/lind-wasm/scripts/lind_compile"
LIND_COMPILE_BIN="$HOME/lind-wasm/scripts/bin/lind_compile"
fi
fi

Expand Down
4 changes: 2 additions & 2 deletions scripts/lind-wasm-opt → scripts/bin/lind-wasm-opt
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ if [[ -n "${LIND_WASM_ROOT:-}" && -d "${LIND_WASM_ROOT}" ]]; then
REPO_ROOT="${LIND_WASM_ROOT}"
else
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "${SCRIPT_DIR}/../Makefile" ]]; then
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)"
if [[ -f "${SCRIPT_DIR}/../../Makefile" ]]; then
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
elif command -v git >/dev/null 2>&1; then
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
else
Expand Down
6 changes: 3 additions & 3 deletions scripts/lind_compile → scripts/bin/lind_compile
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ if [[ -n "${LIND_WASM_ROOT:-}" && -d "${LIND_WASM_ROOT}" ]]; then
REPO_ROOT="${LIND_WASM_ROOT}"
else
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "${SCRIPT_DIR}/../Makefile" ]]; then
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)"
if [[ -f "${SCRIPT_DIR}/../../Makefile" ]]; then
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
else
if command -v git >/dev/null 2>&1; then
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)"
Expand Down Expand Up @@ -268,7 +268,7 @@ esac

# --- tool paths & quick checks (anchored to repo) ---
CLANG_BIN="clang" # must be on PATH
LIND_WASM_OPT_BIN="${REPO_ROOT}/scripts/lind-wasm-opt"
LIND_WASM_OPT_BIN="${REPO_ROOT}/scripts/bin/lind-wasm-opt"
LINDBOOT_BIN="${REPO_ROOT}/build/lind-boot"
LINDFS_ROOT="${REPO_ROOT}/lindfs/"
if [[ -n "${TARGET_DIR}" ]]; then
Expand Down
Loading