Skip to content

perry run --local rejects prebuilt installs: can_compile_locally ignores the exe-relative lib dir that find_library uses #10209

Description

@keufcp

What happened

perry run android --local fails with "requires cross-compiled runtime libraries" on a prebuilt perry, although the Android libs are bundled next to perry.exe and perry main.ts --target android links against them fine.

What you expected

perry run android --local finds the same bundled libs as --target android.

Minimal reproduction

Any input; the check fails before compilation. Empty directory, no target/.

console.log("hello");

Command you ran:

# <dir> = extracted perry-windows-x86_64.zip (v0.5.1520),
# contains <dir>\aarch64-linux-android\release\libperry_runtime.a etc.
<dir>\perry.exe run android main.ts --local        # exit 1
<dir>\perry.exe main.ts -o out.so --target android  # exit 0

Environment

  • Perry version: 0.5.1520 (381045a)
  • Host OS: Windows 11 Pro 10.0.26200 (x86_64)
  • Target: android
  • Rust toolchain (if building from source): n/a
  • Installed via: GitHub release zip (perry-windows-x86_64.zip)

Diagnostic output

Error: Local compilation for "android" requires cross-compiled runtime libraries.
Build with: cargo build --release -p perry-runtime -p perry-stdlib --target aarch64-linux-android
Or use --remote to compile via Perry Hub.

Anything else

can_compile_locally
(run/entry.rs#L7-L23)
only probes ./target/<triple>/release/ and
env!("CARGO_MANIFEST_DIR")/../../target/<triple>/release/. The latter is the CI
checkout (D:\a\perry\perry\crates\perry in this binary), so on any prebuilt
install it returns false. collect_library_candidates
(library_search.rs#L1105-L1117)
additionally probes <exe dir>/<triple>/release/ (#872), which is where the
release zip puts them.

Unchanged on main as of 5d3bf85 (entry.rs identical to v0.5.1520).

Possible fix: have can_compile_locally delegate to
find_runtime_library(target).is_ok() (currently pub(super)) or the pub
find_library("libperry_runtime.a", target) instead of keeping its own path
list.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect or regression

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions