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

Build error on fresh install #963

Closed
nk9 opened this issue Feb 16, 2025 · 4 comments
Closed

Build error on fresh install #963

nk9 opened this issue Feb 16, 2025 · 4 comments

Comments

@nk9
Copy link

nk9 commented Feb 16, 2025

I created a fresh lambda, but can't get it to build.

$ brew tap cargo-lambda/cargo-lambda && brew install cargo-lambda
...
$ brew list cargo-lambda
/opt/homebrew/Cellar/cargo-lambda/1.6.3.aarch64/bin/cargo-lambda
/opt/homebrew/Cellar/cargo-lambda/1.6.3.aarch64/sbom.spdx.json
$ cargo lambda new islington-events
> Is this function an HTTP function? Yes
$ cd islington-events
$ cargo lambda build
▪▪▪▪▪ Target component installed
   Compiling proc-macro2 v1.0.93
   Compiling unicode-ident v1.0.16
   Compiling serde v1.0.217
   Compiling pin-project-lite v0.2.16
   Compiling itoa v1.0.14
   Compiling futures-core v0.3.31
   Compiling stable_deref_trait v1.2.0
   Compiling memchr v2.7.4
   Compiling autocfg v1.4.0
   Compiling futures-sink v0.3.31
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 `futures-core` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `pin-project-lite` (lib) due to 1 previous error
error: could not compile `itoa` (lib) due to 1 previous error
error: could not compile `stable_deref_trait` (lib) due to 1 previous error
error: could not compile `futures-sink` (lib) due to 1 previous error
error: could not compile `memchr` (lib) due to 1 previous error
$ rustup target add x86_64-unknown-linux-gnu
info: component 'rust-std' for target 'x86_64-unknown-linux-gnu' is up to date

Version info:

$ cargo lambda --version
cargo-lambda 1.6.3 (7b294c9 2025-01-27Z)
$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 15.2 (24C101)
      Kernel Version: Darwin 24.2.0
$ uname -p
arm
$ rustc --version
rustc 1.84.1 (e71f9a9a9 2025-01-27) (Homebrew)
$ cargo --version
cargo 1.84.1
@nk9 nk9 changed the title Error on fresh install Build error on fresh install Feb 16, 2025
@nk9
Copy link
Author

nk9 commented Feb 19, 2025

I have gotten this working locally by using cargo lambda watch, but build and build --release still generate the same error. 🤔

@calavera
Copy link
Contributor

error[E0463]: can't find crate for core

This error is always caused because the Rust toolchain is not correctly installed. I’d recommend you to remove the toolchain with rustup and install it again. You can see dozens of similar problems in different Rust projects:

https://github.com/search?q=%22can%27t+find+crate+for+%60core%60%22&type=issues

@nk9
Copy link
Author

nk9 commented Feb 19, 2025

Thank you very much! I tried uninstalling individual toolchains to start, but that didn't help. Then I found this StackOverflow answer that recommended deleting rust entirely and starting from scratch. And now the build works!

@nk9 nk9 closed this as completed Feb 19, 2025
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.

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