Repository: metacall/core (language: rust)

Issue:
py_port test fails due to rs_loader linker bug
## 🐛 Bug Report

You can reproduce it by running `./docker-compose.sh test`. It does not happen outside docker, neither with sanitizers enabled, but it happens with  `./docker-compose.sh test-sanitizer` too.

```
 30/168 Test   #3: py_port ..........................................***Failed    8.53 sec
.....warning: field is never read: `constructor`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:52:5
   |
52 |     constructor: Option<Constructor>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: field is never read: `attributes`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:53:5
   |
53 |     attributes: Attributes,
   |     ^^^^^^^^^^^^^^^^^^^^^^

warning: field is never read: `attr_setters`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:54:5
   |
54 |     attr_setters: AttributeSetters,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never read: `instance_methods`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:55:5
   |
55 |     instance_methods: InstanceMethods,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `builder`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:60:12
   |
60 |     pub fn builder<T: 'static>() -> ClassBuilder<T> {
   |            ^^^^^^^

warning: associated function is never used: `init`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:64:12
   |
64 |     pub fn init(&self, fields: Vec<MetacallValue>) -> Instance {
   |            ^^^^

warning: associated function is never used: `call`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:72:12
   |
72 |     pub fn call(&self, attr: &str, args: Vec<MetacallValue>) -> Result<MetacallValue> {
   |            ^^^^

warning: associated function is never used: `get_method`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:81:8
   |
81 |     fn get_method(&self, name: &str) -> Option<InstanceMethod> {
   |        ^^^^^^^^^^

warning: field is never read: `class`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:88:5
   |
88 |     class: Class,
   |     ^^^^^^^^^^^^

warning: associated function is never used: `new`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:97:8
   |
97 |     fn new() -> Self {
   |        ^^^

warning: associated function is never used: `name`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:114:12
    |
114 |     pub fn name(mut self, name: &str) -> Self {
    |            ^^^^

warning: associated function is never used: `build`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:120:12
    |
120 |     pub fn build(self) -> Class {
    |            ^^^^^

warning: associated function is never used: `add_attribute_getter`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:124:12
    |
124 |     pub fn add_attribute_getter<F, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `add_attribute_setter`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:134:12
    |
134 |     pub fn add_attribute_setter<F, Arg>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `with_constructor`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:146:12
    |
146 |     pub fn with_constructor<F, Args>(f: F) -> Self
    |            ^^^^^^^^^^^^^^^^

warning: associated function is never used: `set_constructor`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:157:12
    |
157 |     pub fn set_constructor<F, Args>(mut self, f: F) -> Self
    |            ^^^^^^^^^^^^^^^

warning: associated function is never used: `add_method`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:167:12
    |
167 |     pub fn add_method<F, Args, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^

warning: associated function is never used: `add_class_method`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:179:12
    |
179 |     pub fn add_class_method<F, Args, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^

warning: field is never read: `inner`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:191:5
    |
191 |     inner: Arc<RefCell<dyn std::any::Any + Send + Sync>>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:203:12
    |
203 |     pub fn new<T: Send + Sync + 'static>(instance: T) -> Self {
    |            ^^^

warning: associated function is never used: `instance_of`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:211:12
    |
211 |     pub fn instance_of(&self, class: &Class) -> bool {
    |            ^^^^^^^^^^^

warning: associated function is never used: `type_id`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:215:12
    |
215 |     pub fn type_id(&self) -> std::any::TypeId {
    |            ^^^^^^^

warning: associated function is never used: `name`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:220:12
    |
220 |     pub fn name<'a>(&self) -> &'a str {
    |            ^^^^

warning: associated function is never used: `get_attr`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:225:12
    |
225 |     pub fn get_attr(&self, name: &str, class: &Class) -> Result<MetacallValue> {
    |            ^^^^^^^^

warning: associated function is never used: `set_attr`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:233:12
    |
233 |     pub fn set_attr(&mut self, name: &str, value: MetacallValue, class: &Class) {
    |            ^^^^^^^^

warning: associated function is never used: `borrow`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:242:12
    |
242 |     pub fn borrow(&self) -> Ref<dyn std::any::Any + Send + Sync> {
    |            ^^^^^^

warning: associated function is never used: `borrow_mut`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:246:12
    |
246 |     pub fn borrow_mut(&self) -> RefMut<dyn std::any::Any + Send + Sync> {
    |            ^^^^^^^^^^

warning: associated function is never used: `call`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:250:12
    |
250 |     pub fn call(
    |            ^^^^

warning: function is never used: `join`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:325:4
    |
325 | fn join<A, B>(left: Result<A>, right: Result<B>) -> Result<(A, B)> {
    |    ^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:336:12
    |
336 |     pub fn new<Args, F>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:347:12
    |
347 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<Instance> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:355:12
    |
355 |     pub fn new<T, F, R>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:370:12
    |
370 |     pub fn invoke(&self, receiver: &Instance) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:378:12
    |
378 |     pub fn new<T, F, Arg>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:393:12
    |
393 |     pub fn invoke(&self, value: MetacallValue, receiver: &mut Instance) {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:402:12
    |
402 |     pub fn new<T, F, Args>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:424:12
    |
424 |     pub fn invoke(&self, receiver: &Instance, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:433:12
    |
433 |     pub fn new<F, Args>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:447:12
    |
447 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:470:12
    |
470 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: unused `std::result::Result` that must be used
  --> /usr/local/metacall/build/scripts/basic.rs:21:5
   |
21 |     f.write(b"Hello metacall");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,--version-script=/tmp/rustchT84ZM/list" "-m64" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.0.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.1.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.10.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.11.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.12.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.13.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.14.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.15.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.2.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.3.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.4.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.5.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.6.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.7.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.8.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.9.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.2ep5rm9qie5mibsg.rcgu.o" "-Wl,--as-needed" "-L" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-13e2ae73269b4206.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-3d4ff53e7005b4dd.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-54bcdfc29d659c8a.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-4534cde42d1275da.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-a2bd8b0ea7c9b00d.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-8881dc3bb3f10f3b.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3fd242e18fdd0c36.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3a798fed05fab799.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-80d3100602c910ea.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-1dccce5a21675f27.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-f64377ecebdde207.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c7653eb7fe07b9c8.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-36839fa9267107c9.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-8aa1cded26ac715b.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f48e57d6d73020ee.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e95d805e5aecd8ef.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2a6a2797f7a73818.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-0e3656b1fda5fd7b.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-18115510f759732e.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/usr/local/metacall/build/scripts/wrapped_basic.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: /usr/bin/ld: can not read symbols: file truncated
          /usr/bin/ld: can not read symbols: file truncated
          /usr/bin/ld: failed to set dynamic section sizes: file truncated
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error; 41 warnings emitted



ErrorReported

warning: field is never read: `constructor`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:52:5
   |
52 |     constructor: Option<Constructor>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: field is never read: `attributes`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:53:5
   |
53 |     attributes: Attributes,
   |     ^^^^^^^^^^^^^^^^^^^^^^

warning: field is never read: `attr_setters`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:54:5
   |
54 |     attr_setters: AttributeSetters,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never read: `instance_methods`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:55:5
   |
55 |     instance_methods: InstanceMethods,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `builder`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:60:12
   |
60 |     pub fn builder<T: 'static>() -> ClassBuilder<T> {
   |            ^^^^^^^

warning: associated function is never used: `init`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:64:12
   |
64 |     pub fn init(&self, fields: Vec<MetacallValue>) -> Instance {
   |            ^^^^

warning: associated function is never used: `call`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:72:12
   |
72 |     pub fn call(&self, attr: &str, args: Vec<MetacallValue>) -> Result<MetacallValue> {
   |            ^^^^

warning: associated function is never used: `get_method`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:81:8
   |
81 |     fn get_method(&self, name: &str) -> Option<InstanceMethod> {
   |        ^^^^^^^^^^

warning: field is never read: `class`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:88:5
   |
88 |     class: Class,
   |     ^^^^^^^^^^^^

warning: associated function is never used: `new`
  --> /usr/local/metacall/build/scripts/metacall_class.rs:97:8
   |
97 |     fn new() -> Self {
   |        ^^^

warning: associated function is never used: `name`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:114:12
    |
114 |     pub fn name(mut self, name: &str) -> Self {
    |            ^^^^

warning: associated function is never used: `build`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:120:12
    |
120 |     pub fn build(self) -> Class {
    |            ^^^^^

warning: associated function is never used: `add_attribute_getter`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:124:12
    |
124 |     pub fn add_attribute_getter<F, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `add_attribute_setter`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:134:12
    |
134 |     pub fn add_attribute_setter<F, Arg>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `with_constructor`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:146:12
    |
146 |     pub fn with_constructor<F, Args>(f: F) -> Self
    |            ^^^^^^^^^^^^^^^^

warning: associated function is never used: `set_constructor`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:157:12
    |
157 |     pub fn set_constructor<F, Args>(mut self, f: F) -> Self
    |            ^^^^^^^^^^^^^^^

warning: associated function is never used: `add_method`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:167:12
    |
167 |     pub fn add_method<F, Args, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^

warning: associated function is never used: `add_class_method`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:179:12
    |
179 |     pub fn add_class_method<F, Args, R>(mut self, name: &'static str, f: F) -> Self
    |            ^^^^^^^^^^^^^^^^

warning: field is never read: `inner`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:191:5
    |
191 |     inner: Arc<RefCell<dyn std::any::Any + Send + Sync>>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:203:12
    |
203 |     pub fn new<T: Send + Sync + 'static>(instance: T) -> Self {
    |            ^^^

warning: associated function is never used: `instance_of`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:211:12
    |
211 |     pub fn instance_of(&self, class: &Class) -> bool {
    |            ^^^^^^^^^^^

warning: associated function is never used: `type_id`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:215:12
    |
215 |     pub fn type_id(&self) -> std::any::TypeId {
    |            ^^^^^^^

warning: associated function is never used: `name`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:220:12
    |
220 |     pub fn name<'a>(&self) -> &'a str {
    |            ^^^^

warning: associated function is never used: `get_attr`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:225:12
    |
225 |     pub fn get_attr(&self, name: &str, class: &Class) -> Result<MetacallValue> {
    |            ^^^^^^^^

warning: associated function is never used: `set_attr`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:233:12
    |
233 |     pub fn set_attr(&mut self, name: &str, value: MetacallValue, class: &Class) {
    |            ^^^^^^^^

warning: associated function is never used: `borrow`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:242:12
    |
242 |     pub fn borrow(&self) -> Ref<dyn std::any::Any + Send + Sync> {
    |            ^^^^^^

warning: associated function is never used: `borrow_mut`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:246:12
    |
246 |     pub fn borrow_mut(&self) -> RefMut<dyn std::any::Any + Send + Sync> {
    |            ^^^^^^^^^^

warning: associated function is never used: `call`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:250:12
    |
250 |     pub fn call(
    |            ^^^^

warning: function is never used: `join`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:325:4
    |
325 | fn join<A, B>(left: Result<A>, right: Result<B>) -> Result<(A, B)> {
    |    ^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:336:12
    |
336 |     pub fn new<Args, F>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:347:12
    |
347 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<Instance> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:355:12
    |
355 |     pub fn new<T, F, R>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:370:12
    |
370 |     pub fn invoke(&self, receiver: &Instance) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:378:12
    |
378 |     pub fn new<T, F, Arg>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:393:12
    |
393 |     pub fn invoke(&self, value: MetacallValue, receiver: &mut Instance) {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:402:12
    |
402 |     pub fn new<T, F, Args>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:424:12
    |
424 |     pub fn invoke(&self, receiver: &Instance, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `new`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:433:12
    |
433 |     pub fn new<F, Args>(f: F) -> Self
    |            ^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:447:12
    |
447 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: associated function is never used: `invoke`
   --> /usr/local/metacall/build/scripts/metacall_class.rs:470:12
    |
470 |     pub fn invoke(&self, args: Vec<MetacallValue>) -> Result<MetacallValue> {
    |            ^^^^^^

warning: unused `std::result::Result` that must be used
  --> /usr/local/metacall/build/scripts/basic.rs:21:5
   |
21 |     f.write(b"Hello metacall");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: this `Result` may be an `Err` variant, which should be handled

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,--version-script=/tmp/rustchT84ZM/list" "-m64" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.0.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.1.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.10.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.11.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.12.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.13.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.14.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.15.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.2.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.3.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.4.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.5.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.6.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.7.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.8.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.wrapped_basic.542f1037-cgu.9.rcgu.o" "/usr/local/metacall/build/scripts/wrapped_basic.2ep5rm9qie5mibsg.rcgu.o" "-Wl,--as-needed" "-L" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-13e2ae73269b4206.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-3d4ff53e7005b4dd.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-54bcdfc29d659c8a.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-4534cde42d1275da.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-a2bd8b0ea7c9b00d.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-8881dc3bb3f10f3b.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3fd242e18fdd0c36.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-3a798fed05fab799.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-80d3100602c910ea.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-1dccce5a21675f27.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-f64377ecebdde207.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c7653eb7fe07b9c8.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-36839fa9267107c9.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-8aa1cded26ac715b.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-f48e57d6d73020ee.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e95d805e5aecd8ef.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-2a6a2797f7a73818.rlib" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-0e3656b1fda5fd7b.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-18115510f759732e.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/root/.rustup/toolchains/nightly-2021-12-04-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/usr/local/metacall/build/scripts/wrapped_basic.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
  = note: /usr/bin/ld: can not read symbols: file truncated
          /usr/bin/ld: can not read symbols: file truncated
          /usr/bin/ld: failed to set dynamic section sizes: file truncated
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error; 41 warnings emitted


E
======================================================================
ERROR: test_rust (test_simple.py_port_test)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/metacall/source/ports/py_port/test/test_simple.py", line 101, in test_rust
    from basic.rs import add, add_float, string_len, new_string
  File "/usr/local/metacall/source/ports/py_port/metacall/api.py", line 251, in __metacall_import__
    raise ImportException(f'MetaCall could not import: {name}')
ModuleNotFoundError: MetaCall could not import: basic.rs

----------------------------------------------------------------------
Ran 6 tests in 1.900s

FAILED (errors=1)
```


Discussion / hints:
I am on it.

Fix patch:
diff --git a/source/loaders/rs_loader/rust/compiler/Cargo.toml b/source/loaders/rs_loader/rust/compiler/Cargo.toml
index 73645d2d4..3cf7d0554 100644
--- a/source/loaders/rs_loader/rust/compiler/Cargo.toml
+++ b/source/loaders/rs_loader/rust/compiler/Cargo.toml
@@ -11,4 +11,5 @@ dlopen = "0.1.8"
 libffi = "3.0.0"
 cargo_toml = "0.11.5"
 lazy_static = "1.4.0"
-itertools = "0.10.3"
\ No newline at end of file
+itertools = "0.10.3"
+fastrand = "1.4"
\ No newline at end of file
diff --git a/source/loaders/rs_loader/rust/compiler/src/lib.rs b/source/loaders/rs_loader/rust/compiler/src/lib.rs
index a0ce07dce..a884331c7 100644
--- a/source/loaders/rs_loader/rust/compiler/src/lib.rs
+++ b/source/loaders/rs_loader/rust/compiler/src/lib.rs
@@ -509,6 +509,19 @@ impl CompilerCallbacks {
     }
 }
 
+fn generate_random_string(length: usize) -> String {
+    let charset_str = "abcdefghijklmnopqrstuvwxyz";
+    let chars: Vec<char> = charset_str.chars().collect();
+    let mut result = String::with_capacity(length);
+
+    unsafe {
+        for _ in 0..length {
+            result.push(*chars.get_unchecked(fastrand::usize(0..chars.len())));
+        }
+    }
+    result
+}
+
 impl rustc_driver::Callbacks for CompilerCallbacks {
     fn config(&mut self, config: &mut Config) {
         if matches!(self.source.source, Source::Package { .. }) {
@@ -573,8 +586,26 @@ impl rustc_driver::Callbacks for CompilerCallbacks {
             config.input_path = Some(self.source.input_path.clone());
         }
         // Set up output
-        config.output_file = Some(self.source.output.clone());
-
+        if self.is_parsing {
+            let random_string = generate_random_string(5);
+            let mut output_path = self.source.output.clone();
+            let new_filename = format!(
+                "{}_{}",
+                output_path
+                    .file_prefix()
+                    .expect("Unable to get file prefix")
+                    .to_string_lossy(),
+                random_string
+            );
+            output_path.set_file_name(new_filename);
+            if let Some(ext) = self.source.output.extension() {
+                output_path.set_extension(ext);
+            }
+            config.output_file = Some(output_path.clone());
+            self.source.output = output_path;
+        } else {
+            config.output_file = Some(self.source.output.clone());
+        }
         // Setting up default compiler flags
         config.opts.output_types = config::OutputTypes::new(&[(config::OutputType::Exe, None)]);
         config.opts.optimize = config::OptLevel::Default;
diff --git a/source/loaders/rs_loader/rust/compiler/src/wrapper/mod.rs b/source/loaders/rs_loader/rust/compiler/src/wrapper/mod.rs
index 80423fc46..70fc451bc 100644
--- a/source/loaders/rs_loader/rust/compiler/src/wrapper/mod.rs
+++ b/source/loaders/rs_loader/rust/compiler/src/wrapper/mod.rs
@@ -129,7 +129,7 @@ fn generate_class_wrapper_for_package(classes: &Vec<&crate::Class>) -> String {
 }
 pub fn generate_wrapper(callbacks: CompilerCallbacks) -> std::io::Result<CompilerCallbacks> {
     match callbacks.source.source {
-        Source::Package { path } => {
+        Source::Package { ref path } => {
             let mut content = String::new();
             let function_wrapper = generate_function_wrapper_for_package(&callbacks.functions);
             content.push_str(&function_wrapper);
@@ -152,9 +152,13 @@ pub fn generate_wrapper(callbacks: CompilerCallbacks) -> std::io::Result<Compile
             wrapper_file.write_all(b"mod metacall_class;\nuse metacall_class::*;\n")?;
             wrapper_file.write_all(content.as_bytes())?;
 
+            let mut source = Source::new(Source::Package {
+                path: path.to_path_buf(),
+            });
+            source.output = callbacks.source.output;
             // construct new callback
             Ok(CompilerCallbacks {
-                source: Source::new(Source::Package { path: path }),
+                source,
                 is_parsing: false,
                 ..callbacks
             })
@@ -190,10 +194,11 @@ pub fn generate_wrapper(callbacks: CompilerCallbacks) -> std::io::Result<Compile
                     wrapper_file.write_all(content.as_bytes())?;
                     let dst = format!("include!({:?});", callbacks.source.input_path.clone());
                     wrapper_file.write_all(dst.as_bytes())?;
-
+                    let mut source = Source::new(Source::File { path: source_path });
+                    source.output = callbacks.source.output;
                     // construct new callback
                     Ok(CompilerCallbacks {
-                        source: Source::new(Source::File { path: source_path }),
+                        source,
                         is_parsing: false,
                         ..callbacks
                     })
@@ -217,12 +222,13 @@ pub fn generate_wrapper(callbacks: CompilerCallbacks) -> std::io::Result<Compile
                         wrapper_file.write_all(content.as_bytes())?;
                         let dst = format!("include!({:?});", source_path.join("script.rs"));
                         wrapper_file.write_all(dst.as_bytes())?;
-
+                        let mut source = Source::new(Source::File {
+                            path: source_path.join("wrapped_script.rs"),
+                        });
+                        source.output = callbacks.source.output;
                         // construct new callback
                         Ok(CompilerCallbacks {
-                            source: Source::new(Source::File {
-                                path: source_path.join("wrapped_script.rs"),
-                            }),
+                            source,
                             is_parsing: false,
                             ..callbacks
                         })
diff --git a/source/ports/py_port/metacall/__init__.py b/source/ports/py_port/metacall/__init__.py
index 1b9adfdd7..a185a2121 100644
--- a/source/ports/py_port/metacall/__init__.py
+++ b/source/ports/py_port/metacall/__init__.py
@@ -17,4 +17,4 @@
 #	See the License for the specific language governing permissions and
 #	limitations under the License.
 
-from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_inspect
+from metacall.api import metacall, metacall_load_from_file, metacall_load_from_memory, metacall_load_from_package, metacall_inspect
diff --git a/source/scripts/rust/basic/source/basic.rs b/source/scripts/rust/basic/source/basic.rs
index 9c20473fa..4184ca59a 100644
--- a/source/scripts/rust/basic/source/basic.rs
+++ b/source/scripts/rust/basic/source/basic.rs
@@ -18,7 +18,7 @@ pub fn add_float(num_1: f32, num_2: f32) -> f32 {
 pub fn run() {
     let dir = env::temp_dir();
     let mut f = File::create(dir.join("hello.txt")).unwrap();
-    f.write(b"Hello metacall");
+    let _ = f.write(b"Hello metacall");
 }
 
 // pub fn add_vec(vec: &mut Vec<i32>) -> i32 {
diff --git a/source/scripts/rust/melody/Cargo.lock b/source/scripts/rust/melody/Cargo.lock
index b45d44313..af83393b5 100644
--- a/source/scripts/rust/melody/Cargo.lock
+++ b/source/scripts/rust/melody/Cargo.lock
@@ -3,214 +3,37 @@
 version = 3
 
 [[package]]
-name = "block-buffer"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "cpufeatures"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc948ebb96241bb40ab73effeb80d9f93afaad49359d159a5e61be51619fe813"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "crypto-common"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
-dependencies = [
- "generic-array",
- "typenum",
-]
-
-[[package]]
-name = "digest"
-version = "0.10.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506"
-dependencies = [
- "block-buffer",
- "crypto-common",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.14.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "libc"
-version = "0.2.132"
+name = "itoa"
+version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
+checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
 
 [[package]]
-name = "melody"
+name = "json-wrapper"
 version = "0.1.0"
 dependencies = [
- "melody_compiler",
-]
-
-[[package]]
-name = "melody_compiler"
-version = "0.18.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c65dfed91963cb9aa714e283edbc99cfffc3a971f9ea816eed3dbf593d378d6"
-dependencies = [
- "once_cell",
- "pest",
- "pest_derive",
- "thiserror",
+ "serde_json",
 ]
 
 [[package]]
-name = "once_cell"
-version = "1.13.1"
+name = "ryu"
+version = "1.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e"
+checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
 
 [[package]]
-name = "pest"
-version = "2.3.0"
+name = "serde"
+version = "1.0.144"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b0560d531d1febc25a3c9398a62a71256c0178f2e3443baedd9ad4bb8c9deb4"
-dependencies = [
- "thiserror",
- "ucd-trie",
-]
+checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860"
 
 [[package]]
-name = "pest_derive"
-version = "2.3.0"
+name = "serde_json"
+version = "1.0.85"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "905708f7f674518498c1f8d644481440f476d39ca6ecae83319bba7c6c12da91"
+checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
 dependencies = [
- "pest",
- "pest_generator",
+ "itoa",
+ "ryu",
+ "serde",
 ]
-
-[[package]]
-name = "pest_generator"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5803d8284a629cc999094ecd630f55e91b561a1d1ba75e233b00ae13b91a69ad"
-dependencies = [
- "pest",
- "pest_meta",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "pest_meta"
-version = "2.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1538eb784f07615c6d9a8ab061089c6c54a344c5b4301db51990ca1c241e8c04"
-dependencies = [
- "once_cell",
- "pest",
- "sha-1",
-]
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
-dependencies = [
- "unicode-ident",
-]
-
-[[package]]
-name = "quote"
-version = "1.0.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "sha-1"
-version = "0.10.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f"
-dependencies = [
- "cfg-if",
- "cpufeatures",
- "digest",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.99"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-ident",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "typenum"
-version = "1.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
-
-[[package]]
-name = "ucd-trie"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89570599c4fe5585de2b388aab47e99f7fa4e9238a1399f707a02e356058141c"
-
-[[package]]
-name = "unicode-ident"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf"
-
-[[package]]
-name = "version_check"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
diff --git a/source/scripts/rust/melody/Cargo.toml b/source/scripts/rust/melody/Cargo.toml
index 64bf69e4e..bb7456758 100644
--- a/source/scripts/rust/melody/Cargo.toml
+++ b/source/scripts/rust/melody/Cargo.toml
@@ -1,7 +1,9 @@
 [package]
-name = "melody"
+name = "json-wrapper"
 version = "0.1.0"
 edition = "2021"
 
+crate-type=["lib"]
+
 [dependencies]
-melody_compiler = "0.18.1"
\ No newline at end of file
+serde_json = "1.0"
\ No newline at end of file
diff --git a/source/scripts/rust/melody/src/lib.rs b/source/scripts/rust/melody/src/lib.rs
index 4d2d78cf6..7a03eb598 100644
--- a/source/scripts/rust/melody/src/lib.rs
+++ b/source/scripts/rust/melody/src/lib.rs
@@ -1,7 +1,6 @@
-use melody_compiler::compiler;
+use serde_json::Value;
 
 pub fn compile(s: String) -> String {
-    let ret = compiler(&s).unwrap_or_else(|x| format!("Compiler error {:?}", x));
-    dbg!(&ret);
-    ret
+    let v: Value = serde_json::from_str(&s).unwrap();
+    v["name"].to_string()
 }


Test patch:
diff --git a/source/tests/metacall_python_port_test/CMakeLists.txt b/source/tests/metacall_python_port_test/CMakeLists.txt
index 75a63bc3d..0fc7b6e5b 100644
--- a/source/tests/metacall_python_port_test/CMakeLists.txt
+++ b/source/tests/metacall_python_port_test/CMakeLists.txt
@@ -1,5 +1,5 @@
 # Check if loaders are enabled
-if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_NODE)
+if(NOT OPTION_BUILD_LOADERS OR NOT OPTION_BUILD_LOADERS_PY OR NOT OPTION_BUILD_LOADERS_RB OR NOT OPTION_BUILD_LOADERS_NODE OR NOT OPTION_BUILD_LOADERS_RS OR NOT OPTION_BUILD_PORTS OR NOT OPTION_BUILD_PORTS_PY OR NOT OPTION_BUILD_SCRIPTS OR NOT OPTION_BUILD_SCRIPTS_PY OR NOT OPTION_BUILD_SCRIPTS_RB OR NOT OPTION_BUILD_SCRIPTS_RS OR NOT OPTION_BUILD_SCRIPTS_NODE)
 	return()
 endif()
 
diff --git a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp
index 406045323..7cf0d2eae 100644
--- a/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp
+++ b/source/tests/metacall_rust_load_from_package_dep_test/source/metacall_rust_load_from_package_dep_test.cpp
@@ -22,14 +22,14 @@
 
 #include <metacall/metacall.h>
 
-class metacall_rust_load_from_mem_test : public testing::Test
+class metacall_rust_load_from_package_dep_test : public testing::Test
 {
 protected:
 };
 
-TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor)
+TEST_F(metacall_rust_load_from_package_dep_test, DefaultConstructor)
 {
-	const char *rs_script = "debug/libmelody.rlib";
+	const char *rs_script = "debug/libjson_wrapper.rlib";
 
 	ASSERT_EQ((int)0, (int)metacall_initialize());
 
@@ -37,15 +37,9 @@ TEST_F(metacall_rust_load_from_mem_test, DefaultConstructor)
 
 	/* Test: Load from package */
 	{
-		const char *text =
-			"option of \"v\";"
-			"capture major { some of<digit>; }"
-			"\".\";"
-			"capture minor { some of<digit>; }"
-			"\".\";"
-			"capture patch { some of<digit>; }";
+		const char *text = "{\"name\": \"John Doe\"}";
 		void *ret = metacall("compile", text);
-		EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), R"(v?(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+))"));
+		EXPECT_EQ((int)0, (int)strcmp(metacall_value_to_string(ret), "\"John Doe\""));
 		metacall_value_destroy(ret);
 	}