lapce-rust icon indicating copy to clipboard operation
lapce-rust copied to clipboard

how is lapce-rust compiled

Open SingingBush opened this issue 2 years ago • 3 comments

I cloned this repo so I can look into writing a new plugin but the project won't build with cargo build as due to missing the crate for core. What steps are being used to build the rust plugin? Will the core of lapce be published to crates.io?

Relates to https://github.com/lapce/lapce/issues/123

SingingBush avatar Mar 18 '22 08:03 SingingBush

It depends on lapce-plugin which is on crates.io. It doesn't depend on lapce core.

dzhou121 avatar Mar 18 '22 08:03 dzhou121

I see this in build output:

$ cargo build
   Compiling cfg-if v1.0.0
   Compiling itoa v1.0.1
   Compiling adler v1.0.2
   Compiling ryu v1.0.9
   Compiling proc-macro2 v1.0.34
   Compiling syn v1.0.82
   Compiling serde_derive v1.0.132
   Compiling serde v1.0.132
   Compiling miniz_oxide v0.4.4
   Compiling libc v0.2.112
   Compiling crc32fast v1.3.0
   Compiling serde_json v1.0.73
error[E0463]: can't find crate for `core`
  |
  = note: the `wasm32-wasi` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-wasi`

error[E0463]: can't find crate for `compiler_builtins`

error[E0463]: can't find crate for `core`
  --> /home/samael/.cargo/registry/src/github.com-1ecc6299db9ec823/adler-1.0.2/src/lib.rs:20:1
   |
20 | extern crate core as std;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
   |
   = note: the `wasm32-wasi` target may not be installed
   = help: consider downloading the target with `rustup target add wasm32-wasi`

For more information about this error, try `rustc --explain E0463`.
error: cannot find attribute `derive` in this scope
  --> /home/samael/.cargo/registry/src/github.com-1ecc6299db9ec823/adler-1.0.2/src/lib.rs:86:3
   |
86 | #[derive(Debug, Copy, Clone)]
   |   ^^^^^^

...

SingingBush avatar Mar 18 '22 10:03 SingingBush

It's supposedly to be compiled to WASI so you need to rustup target add wasm32-wasi

dzhou121 avatar Mar 18 '22 10:03 dzhou121