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

Missing target causes an error #192

Closed
CGMossa opened this issue May 11, 2022 · 8 comments
Closed

Missing target causes an error #192

CGMossa opened this issue May 11, 2022 · 8 comments
Labels
question Question/discussion

Comments

@CGMossa
Copy link
Member

CGMossa commented May 11, 2022

Calling rust_function causes this error if target x86_64-pc-windows-gnu.

This is fixed with rustup target add x86_64-pc-windows-gnu.

Maybe we can remedy this somehow?

> # create a Rust function
> rust_function("fn add(a:f64, b:f64) -> f64 { a + b }")
ℹ build directory: C:/Users/angus/AppData/Local/Temp/RtmpMNe9BF/file311051b2883
Opening fd 2
    Updating crates.io index
 Downloading crates ...
  Downloaded syn v1.0.93
   Compiling winapi v0.3.9
   Compiling proc-macro2 v1.0.38
   Compiling unicode-xid v0.2.3
   Compiling syn v1.0.93
   Compiling extendr-engine v0.2.0
   Compiling lazy_static v1.4.0
error: could not compile `lazy_static` due to 20 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
Error in `invoke_cargo()`:
! Rust code could not be compiled successfully. Aborting.error[E0463]: can't find crate for `core`
  |
  = note: the `x86_64-pc-windows-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-pc-windows-gnu`
✖ error[E0463]: can't find crate for `compiler_builtins`error[E0463]: can't find crate for `core`
 --> C:\Users\angus\.cargo\registry\src\github.com-1ecc6299db9ec823\lazy_static-1.4.0\src\inline_lazy.rs:8:1
  |
8 | extern crate core;
  | ^^^^^^^^^^^^^^^^^^ can't find crate
  |
  = note: the `x86_64-pc-windows-gnu` target may not be installed
  = help: consider downloading the target with `rustup target add x86_64-pc-windows-gnu`error[E0463]: can't find crate for `std`
 --> C:\Users\angus\.cargo\registry\src\github.com-1ecc6299db9ec823\lazy_static-1.4.0\src\inline_lazy.rs:9:1
  |
9 | extern crate std;
  | ^^^^^^^^^^^^^^^^^ can't find crate
[redacted]
@CGMossa
Copy link
Member Author

CGMossa commented May 11, 2022

I also found that devtools should be Imports and not just Suggests.

@Ilia-Kosenkov
Copy link
Member

This can be related to #168. We can at least provide the information about what is available and what is missing. Not sure we should interfere with the installation process.

@Ilia-Kosenkov Ilia-Kosenkov added the question Question/discussion label May 12, 2022
@yutannihilation
Copy link
Contributor

Thanks for catching. I already updated the setup instruction, so I hope not so many people will see this error, but I think it's nice if we can display more friendly error.

I also found that devtools should be Imports and not just Suggests.

JFYI, rextendr requires users to install devtools when it's necessary, so I don't think so.

rlang::check_installed("devtools")

@JosiahParry
Copy link
Contributor

I ran into this problem today when installing on my work machine (windows).
Solved by following the instruction rustup target add x86_64-pc-windows-gnu

@JosiahParry
Copy link
Contributor

We could, in theory, catch that specific message, but that feels icky.

@JosiahParry
Copy link
Contributor

Is this resolved by rust_sitrep()? Perhaps if error is encountered in rust_function() or rust_source() the error message can recommend running rust_sitrep()?

@Ilia-Kosenkov
Copy link
Member

Sounds reasonable. Also we should update docs (README) to mention rust_sitrep(). Up for the task? :)

JosiahParry added a commit to JosiahParry/rextendr that referenced this issue Aug 7, 2023
@JosiahParry
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question/discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants