Summary
elephc --web (and other bridges, e.g. PDO) link against staticlibs
(libelephc_web.a, libelephc_pdo.a, etc.) that the linker looks for in the
same directory as the elephc executable
(src/linker.rs::find_lib_dir). Distributing only the elephc binary
outside of target/release (e.g. copying it to a tools/bin directory as
part of a project's build setup) makes every --web/bridge build fail at
link time.
Environment
- elephc v0.26.0 (release, commit
892ff162), macOS ARM64
Repro
cp target/release/elephc /some/other/dir/elephc
/some/other/dir/elephc --web app.php
ld: library 'elephc_web' not found
Expected
Either document that libelephc_*.a must be copied alongside the binary
when redistributing it outside the build tree, or have elephc locate its
staticlibs independently of the executable's directory (e.g. embedded path,
environment variable, or a fallback search relative to a known install
layout).
Workaround
The project's get-elephc.sh setup script copies libelephc_*.a alongside
the elephc binary into its tools directory.
Notes
Low-priority packaging/UX issue; filed last among a batch of bugs found
building a pastebin single-binary app (--web) for the Discord contest.
Summary
elephc --web(and other bridges, e.g. PDO) link against staticlibs(
libelephc_web.a,libelephc_pdo.a, etc.) that the linker looks for in thesame directory as the
elephcexecutable(
src/linker.rs::find_lib_dir). Distributing only theelephcbinaryoutside of
target/release(e.g. copying it to a tools/bin directory aspart of a project's build setup) makes every
--web/bridge build fail atlink time.
Environment
892ff162), macOS ARM64Repro
Expected
Either document that
libelephc_*.amust be copied alongside the binarywhen redistributing it outside the build tree, or have
elephclocate itsstaticlibs independently of the executable's directory (e.g. embedded path,
environment variable, or a fallback search relative to a known install
layout).
Workaround
The project's
get-elephc.shsetup script copieslibelephc_*.aalongsidethe
elephcbinary into its tools directory.Notes
Low-priority packaging/UX issue; filed last among a batch of bugs found
building a pastebin single-binary app (
--web) for the Discord contest.