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

failed build release aarch64-apple-ios #44

Closed
DAOCUONG opened this issue Apr 4, 2021 · 11 comments
Closed

failed build release aarch64-apple-ios #44

DAOCUONG opened this issue Apr 4, 2021 · 11 comments

Comments

@DAOCUONG
Copy link

DAOCUONG commented Apr 4, 2021

error[E0463]: can't find crate for core
|
= note: the aarch64-apple-ios target may not be installed

error: aborting due to previous error

For more information about this error, try rustc --explain E0463.
error: could not compile cfg-if

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for core
|
= note: the aarch64-apple-ios target may not be installed

error: aborting due to previous error

For more information about this error, try rustc --explain E0463.
error: build failed
[ERROR cargo_lipo] Failed to build "rust_sdk" for "aarch64-apple-ios": Executing "/Users/xxxx/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo" "--color" "auto" "build" "-p" "rust_sdk" "--target" "aarch64-apple-ios" "--release" "--lib" finished with error status: exit code: 101

@DAOCUONG DAOCUONG changed the title failed build release failed build release aarch64-apple-ios Apr 4, 2021
@rajivshah3
Copy link

Are you using GitHub Actions by any chance?

@DAOCUONG
Copy link
Author

DAOCUONG commented Apr 7, 2021

No im not i just want to build release build for ios target aarch64-apple-ios Command: cargo lipo --release

@fxpineau
Copy link

fxpineau commented Apr 8, 2021

I have the same trouble in github actions with target x86_64-unknown-linux-musl (the very same CI was working fine 28 days ago):

Compiling cfg-if v1.0.0
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-unknown-linux-musl` target may not be installed


   Compiling libc v0.2.93
error: aborting due to previous error


error: could not compile `cfg-if`

@rajivshah3
Copy link

We were running into a similar issue but ours was related to maturin so I'm not sure if this will help: PyO3/maturin#478

@fxpineau
Copy link

fxpineau commented Apr 8, 2021

Thank you very much @rajivshah3, it does help a lot. I am also using maturin, so in my case it's the same maturin related bug.

@rajivshah3
Copy link

Oh, great! We've pinned maturin to 0.9.4 for the time being until the PR to fix that issue is merged

@jirutka
Copy link

jirutka commented Sep 28, 2021

I’m trying to build youki on Alpine Linux with Rust and Cargo installed from the Alpine packages (x86_64-alpine-linux-musl) and it seems that I’ve encountered the same problem:

error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-unknown-linux-gnu` target may not be installed

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to previous error

What the heck is this?! Someone has again created some stupid assumption that there’s only limited set of triplets?

@jirutka
Copy link

jirutka commented Jan 16, 2022

Half a year has passed, there’s the first stable release of youki and I ran into this crap again and it’s still not fixed.

@alexcrichton
Copy link
Member

This is not due to this crate, and I haven't been proactive enough about closing this, so I will do so now. @jirutka I'll ask you to tone down your behavior as well.

@jirutka
Copy link

jirutka commented Jan 18, 2022

You’re right that it’s not due to this crate, I finally found the cause – the youki author committed .cargo/config with build.target into the repository. I’ve packaged dozens of Rust projects, but never encountered this kind of problem (.cargo/config in the source repository/tarball).

Let me show you full build log:

$ cargo build --release -j1
   Compiling libc v0.2.112
   Compiling proc-macro2 v1.0.34
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.83
   Compiling autocfg v1.0.1
   Compiling cfg-if v1.0.0
error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-unknown-linux-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-unknown-linux-gnu`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` due to previous error

It looks like it did compile several crates and failed on cfg-if. Yes, If I had tried to build it with --verbose and read the output properly, I would have seen --target in the rustc options and got a clue that the problem is elsewhere.

   Compiling cfg-if v1.0.0
     Running `rustc --crate-name cfg_if --edition=2018 ~/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/cfg-if-1.0.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C linker-plugin-lto -C metadata=46512ee2004c7e0d -C extra-filename=-46512ee2004c7e0d --out-dir target/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=target/x86_64-unknown-linux-gnu/release/deps -L dependency=target/release/deps --cap-lints allow`

It’s my fault that I didn’t, but 1. the error message is really very misleading, 2. I already encountered crates that stupidly assume a fixed set of build triplets, 3. I found this unresolved issue describing the same error, 4. it wouldn’t be the first time I’ve been bitten by your assumptions. So I was a bit annoyed and had no reason to look for another cause.

So I’m sorry for my tone, but I hope you will understand it now.

@DAOCUONG
Copy link
Author

@alexcrichton thanks you for the work, really appreciate your work.

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

5 participants