fix(pack): follow symlinks, and say so when a root packs nothing
Maroon Lake keeps assets/polyhaven as a symlink into a shared checkout - which is an ordinary thing to do, and what `ludic assets` encourages - and `find` does not follow symlinks. The pack was written, reported success, and silently omitted all 71 files behind the link, including the sky HDRI. What that looked like from the outside is worth recording, because it is the failure mode this whole feature has to avoid: the bundled game started, printed one line about an HDRI it could not read, carried on, and then died in terrain_height reading offset 0x1cd681c off a null pointer - the CPU height field, never allocated, because r3d_init had given up several steps earlier. A missing asset surfaced as a segfault a long way from the cause. So: `find -L`, and a warning when a declared root contributes no files at all. A root that packs nothing is nearly always a typo or a link into a tree that was never fetched, and the warning costs one line where the alternative costs an afternoon. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
be74b4de6f
commit
d80226f948
2 changed files with 131 additions and 45 deletions
|
|
@ -265,17 +265,20 @@ function cmd_bundle() -> int {
|
|||
# 2. the assets
|
||||
let roots = pack_roots(m, 999) # manifest/convention only, no argv
|
||||
var packed = false
|
||||
if len(roots) > 0 {
|
||||
let files = pack_gather_all(roots)
|
||||
if len(files) > 0 {
|
||||
let staged_pak = `{tmp_dir()}/game.lpak`
|
||||
if not pack_write(staged_pak, files) { return 1 }
|
||||
if not shq(`cp {staged_pak} "{contents}/Resources/game.lpak"`) {
|
||||
err("ludic bundle: could not place the asset pack\n")
|
||||
return 1
|
||||
}
|
||||
packed = true
|
||||
let files = pack_gather_all(roots)
|
||||
# the resources the packages themselves load at runtime - the renderer's
|
||||
# shaders above all, which resolve against a project or an install and would
|
||||
# find neither inside a .app
|
||||
pack_add_packages(files)
|
||||
pack_sort(files)
|
||||
if len(files.names) > 0 {
|
||||
let staged_pak = `{tmp_dir()}/game.lpak`
|
||||
if not pack_write(staged_pak, files) { return 1 }
|
||||
if not shq(`cp {staged_pak} "{contents}/Resources/game.lpak"`) {
|
||||
err("ludic bundle: could not place the asset pack\n")
|
||||
return 1
|
||||
}
|
||||
packed = true
|
||||
}
|
||||
|
||||
# 3. what to mount, and where the game may write. Without `home` a bundled
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue