Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m1 Mac: ARCH not found in this scope #130

Closed
laxian opened this issue Apr 11, 2024 · 2 comments
Closed

m1 Mac: ARCH not found in this scope #130

laxian opened this issue Apr 11, 2024 · 2 comments

Comments

@laxian
Copy link

laxian commented Apr 11, 2024

Mac m1

cargo ndk -o $JNI_DIR \
        --manifest-path ../Cargo.toml \
        -t arm64-v8a \
        build --release

Cargo.toml

[workspace]
members = ["packages/btleplug/native"]

log:

    Building arm64-v8a (aarch64-linux-android)

warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions

   Compiling cargo-ndk v3.5.2

error[E0425]: cannot find value `ARCH` in this scope
  --> /Users/leochou/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-ndk-3.5.2/src/cargo.rs:96:44
   |
96 |     let target_cc = ndk_home.join(ndk_tool(ARCH, "clang"));
   |                                            ^^^^ not found in this scope
   |
help: consider importing one of these items
   |
1  + use crate::cargo::env::consts::ARCH;
   |
1  + use std::env::consts::ARCH;
   |
@laxian
Copy link
Author

laxian commented Apr 12, 2024

Here is the declaration of this variable, does it not support m1?

#[cfg(target_os = "macos")]
const ARCH: &str = "darwin-x86_64";
#[cfg(target_os = "linux")]
const ARCH: &str = "linux-x86_64";
#[cfg(target_os = "windows")]
const ARCH: &str = "windows-x86_64";

@bbqsrc
Copy link
Owner

bbqsrc commented Apr 13, 2024

You seem to be trying to build this for Android. Build it for your host OS.

@bbqsrc bbqsrc closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants