You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`lde install` / `lde run` populate `target/` with symlinks (or copies for packages with a build script). Each dep is installed at `target/<alias>`.
65
66
66
67
`package.path` is set to:
68
+
67
69
```
68
70
target/?.lua
69
71
target/?/init.lua
@@ -73,6 +75,7 @@ target/?.so (or .dll / .dylib)
73
75
So `require("json")` → `target/json/init.lua` → symlink to `packages/json/src/init.lua`.
74
76
75
77
During `lde test`, `tests/` is also exposed as `target/tests`, so test files can do:
78
+
76
79
```lua
77
80
localhelper=require("tests.lib.something") -- resolves to tests/lib/something.lua
78
81
```
@@ -88,6 +91,7 @@ local helper = require("tests.lib.something") -- resolves to tests/lib/somethin
88
91
## Package API (`lde-core`)
89
92
90
93
`require("lde-core")` returns a table with:
94
+
91
95
-`lde.Package` — the Package class
92
96
-`lde.Lockfile` — the Lockfile class
93
97
-`lde.global` — global state/cache helpers
@@ -325,6 +329,19 @@ This outputs `packages/lde/lde` (or `lde.exe` on Windows). To install it globall
325
329
326
330
**Important:** Tests in `packages/lde/tests/` run the actual `lde` CLI binary via `env.execPath()`. If those tests fail after source changes, recompile and replace the binary first.
327
331
332
+
## Profiling `lde` code
333
+
334
+
You can profile an lde package with `lde run --profile` with `--flamegraph` to additionally generate a flamegraph.
335
+
336
+
To profile the entire test suite running this:
337
+
338
+
```sh
339
+
cd packages/lde
340
+
lde run --profile --flamegraph -- -C ../.. test
341
+
```
342
+
343
+
This profiles the `lde` package entrypoint itself, not just an individual test file, and runs `lde test` as if it had been started from the repo root.
344
+
328
345
## Managing Dependencies
329
346
330
347
Always use `lde add` / `lde remove` instead of manually editing `lde.json`. Manual edits leave `lde.lock` out of sync and can break installs.
@@ -382,9 +399,9 @@ The project was previously named `lpm`. You may see `lpm.json` or `lpm-test` ref
382
399
383
400
**Windows:** The system GCC on `windows-latest` targets msvcrt, but lj-dist's `libluajit` is built against UCRT. This causes linker errors (`undefined reference to __imp_fseeko64` etc). CI downloads [llvm-mingw](https://github.com/mstorsjo/llvm-mingw) (a Clang/LLD MinGW-w64 toolchain targeting UCRT) and sets `SEA_CC`:
384
401
385
-
| Runner |`SEA_CC`|
386
-
|---|---|
387
-
|`windows-latest`|`x86_64-w64-mingw32-clang`|
402
+
| Runner |`SEA_CC`|
403
+
|---------------- |--------------------------- |
404
+
|`windows-latest`|`x86_64-w64-mingw32-clang`|
388
405
|`windows-11-arm`|`aarch64-w64-mingw32-clang`|
389
406
390
-
**Android:** Android uses Bionic rather than glibc. The binary is compiled on the host using the Android NDK's clang (`aarch64-linux-android21-clang`), which links against Bionic. Tests run inside a Termux Docker container (`termux/termux-docker:aarch64` under QEMU on the ARM64 runner), which provides a matching Bionic environment.
407
+
**Android:** Android uses Bionic rather than glibc. The binary is compiled on the host using the Android NDK's clang (`aarch64-linux-android21-clang`), which links against Bionic. Tests run inside a Termux Docker container (`termux/termux-docker:aarch64` under QEMU on the ARM64 runner), which provides a matching Bionic environment.
0 commit comments