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/.
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.
What happened
perry run android --localfails with "requires cross-compiled runtime libraries" on a prebuilt perry, although the Android libs are bundled next toperry.exeandperry main.ts --target androidlinks against them fine.What you expected
perry run android --localfinds the same bundled libs as--target android.Minimal reproduction
Any input; the check fails before compilation. Empty directory, no
target/.Command you ran:
Environment
perry-windows-x86_64.zip)Diagnostic output
Anything else
can_compile_locally(
run/entry.rs#L7-L23)only probes
./target/<triple>/release/andenv!("CARGO_MANIFEST_DIR")/../../target/<triple>/release/. The latter is the CIcheckout (
D:\a\perry\perry\crates\perryin this binary), so on any prebuiltinstall it returns
false.collect_library_candidates(
library_search.rs#L1105-L1117)additionally probes
<exe dir>/<triple>/release/(#872), which is where therelease zip puts them.
Unchanged on main as of
5d3bf85(entry.rsidentical to v0.5.1520).Possible fix: have
can_compile_locallydelegate tofind_runtime_library(target).is_ok()(currentlypub(super)) or thepubfind_library("libperry_runtime.a", target)instead of keeping its own pathlist.