#Rust compile deno_runtime error

1 messages · Page 1 of 1 (latest)

lunar gazelle
#

Hi ferrisUpsideDown

I've been this error when I'm compiling my code that uses deno_runtime lib. But I don't know what's this and how I can fix it. Can you help me? I'm using Ubuntu

error: linking with cc failed: exit status: 1

slim schooner
#

It's hard to say without full output from the compiler

lunar gazelle
#

Hi @slim schooner, thanks for answer . I'll send a file with the full output, a moment

#

When I add deno_runtime and deno_core this error occurs

slim schooner
#

That's really strange... Is your project available online to be checked out?

lunar gazelle
#

this command cargo run -- daemon --config examples/deno_basics/daemon.toml

#

I updated deno dependencies to the latest version

#

thank you for your help

slim schooner
#

Thanks, I'll check it tomorrow

lunar gazelle
#

Hey, I updated the code to use deno_core inside the deno_runtime and removed it from my deno feature on toml file and everything worked

#

🤔

#

I've tried to remove deno_core from my dependencies but deno_runtime still uses it

#

deno_runtime has a feature to import deno_core?

slim schooner
#

It doesn't have a feature - deno_runtime just directly reexports deno_core. After sleeping on it, I think you just had two different versions of deno_core used, which in turn used two different versions of rusty_v8 and that's why you got duplicate symbols in the linker output

#

It's better to only specify dependency on deno_runtime - then it will make sure you have compatible deno_core and rusty_v8 crate

#

Great that you figured it out 👍

lunar gazelle
#

Hi, gm

#

do I need to install deno_core or just deno_runtime?

slim schooner
#

Do you get the same error if you compile from the terminal? That might be a flake from rust-analyzer

lunar gazelle
#
error: custom attribute panicked
  --> src/filters/deno/mod.rs:19:1
   |
19 | #[op]
   | ^^^^^
   |
   = help: message: deno_core not present in `Cargo.toml`: CrateNotFound { crate_name: "deno_core", path: "/home/paulo/projects/txpipe/oura/Cargo.toml" }

error: custom attribute panicked
  --> src/filters/deno/mod.rs:30:1
   |
30 | #[op]
   | ^^^^^
   |
   = help: message: deno_core not present in `Cargo.toml`: CrateNotFound { crate_name: "deno_core", path: "/home/paulo/projects/txpipe/oura/Cargo.toml" }

warning: unused import: `OpState`
 --> src/filters/deno/mod.rs:3:52
  |
3 | use deno_runtime::deno_core::{op, ModuleSpecifier, OpState};
  |                                                    ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0433]: failed to resolve: use of undeclared crate or module `op_pop_record`
  --> src/filters/deno/mod.rs:17:57
   |
17 | deno_runtime::deno_core::extension!(deno_filter, ops = [op_pop_record, op_put_record]);
   |                                                         ^^^^^^^^^^^^^ use of undeclared crate or module `op_pop_record`

error[E0433]: failed to resolve: use of undeclared crate or module `op_put_record`
  --> src/filters/deno/mod.rs:17:72
   |
17 | deno_runtime::deno_core::extension!(deno_filter, ops = [op_pop_record, op_put_record]);
   |                                                                        ^^^^^^^^^^^^^ use of undeclared crate or module `op_put_record`

For more information about this error, try `rustc --explain E0433`.
warning: `oura` (lib) generated 1 warning
error: could not compile `oura` (lib) due to 4 previous errors; 1 warning emitted
slim schooner
#

@frozen stratus can you take a look and advise?

lunar gazelle
#

It works only if I install deno_core

#

My cargo.toml

#

Do you have an example using #[op2] macro?

exotic rivet
#

I struggled with #[op2] for a little bit, this code helped me figure it out

lunar gazelle
#

@exotic rivet thank you very much

#

it helped me a lot and now it works ❤️

lunar gazelle
#

@slim schooner what's deno_kv ?

slim schooner
lunar gazelle
slim schooner
#

Unfortunately it is. There's no slimmed down version of the runtime, you'd have to pull crates one by one

lunar gazelle
#

Ok, thank you very much. Do you know what version this was implemented?

slim schooner
#

Hmmm, about 2-3 versions back