denoland / denoland/deno_bindgen

undefined symbol: init_deno_bindgen

Open
#154 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
320
Forks
28
PR merge metrics
No merged PRs in 30d

Description

```toml
[dependencies]
deno_bindgen = "0.8.1"
```

```Rust
use deno_bindgen::deno_bindgen;

#[deno_bindgen]
pub fn add_numbers(a: i32, b: i32) -> i32 {
a + b
}
```
- cargo build runs ok
```
target/debug/libjsw.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked,
BuildID[sha1]=606fc2786687b7dae0e472b12b4f87f3970fa419, with debug_info, not stripped
```
```sh
$ objdump -x target/debug/libjsw.so |grep init
```
```
8 .init 00000017 0000000000005000 0000000000005000 00005000 2**2
19 .init_array 00000010 000000000004f460 000000000004f460 0004f460 2**3
000000000004f468 l O .init_array 0000000000000000 __frame_dummy_init_array_entry
000000000003a5d0 l F .text 0000000000000daf _ZN11miniz_oxide7inflate4core9init_tree17h47cea3e94fb906f2E
00000000000334e3 l F .text 0000000000000034 _ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in17hde9bf5f6252c4665E
0000000000025c40 l F .text 0000000000000017 _ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY12init_wrapper17h849ef28bdfd413fbE
000000000004f460 l O .init_array 0000000000000008 _ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY17hf0e4ba666b615240E
00000000000334af l F .text 0000000000000034 _ZN5alloc5boxed16Box$LT$T$C$A$GT$13new_uninit_in17h9e6677a8d3bda66fE
0000000000005000 l F .init 0000000000000000 _init
```
- but bindgens runs with error and don't see `init_deno_bindgen` symbol:
```sh
$ deno_bindgen
```
```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.03s
Initializing jsw
Error: Custom { kind: Other, error: "failed to load library: Could not obtain symbol from the library: /home/dponyatov/jsw/target/debug/libjsw.so: undefined symbol: init_deno_bindgen" }
```
- cli version:
```
deno_bindgen -V
deno_bindgen_cli 0.1.0
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the supplied add_numbers example using deno_bindgen 0.8.1 and deno_bindgen_cli 0.1.0; run cargo build, then deno_bindgen. Inspect target/debug/libjsw.so with the reported objdump command and investigate the expected init_deno_bindgen symbol, including compatibility between the reported versions. Done means the example initializes without the missing-symbol error; no implementation files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, rust
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.