Skip to content

Bridge staticlibs (libelephc_web.a etc.) must sit next to the elephc binary or --web link fails #517

Description

@mirchaemanuel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions