Giter Club home page Giter Club logo

Comments (8)

pierre-wehbe avatar pierre-wehbe commented on August 19, 2024 1

@rogerneel ^

from uniffi-rs.

badboy avatar badboy commented on August 19, 2024 1

I assume you mean 0.25, etc. (there's no v2.x yet)

from uniffi-rs.

badboy avatar badboy commented on August 19, 2024

I cannot reproduce this locally. Code inline below.
Tested with 0.25, 0.26 and 0.27. All compiles, targetting the host architecture.
The proc macros correctly use ::core::*. Given that's ... the core library it should exist.

If you can providing the failing code in a git repository would help us debug this further.

lib.rs:

use std::time::SystemTime;

#[allow(non_camel_case_types)]
pub enum ExampleEnum {
    v1, v2
}

pub struct Glucose {
    raw: f32,
    timestamp: SystemTime,
    local_timestamp: SystemTime,
}

pub fn hello_world() -> String {
    String::from("hello world")
}

pub struct TodoList;

impl TodoList {
    fn new() -> Self {
        TodoList {
        }
    }
}

uniffi::include_scaffolding!("uniffi-bug-test");

UDL:

namespace uniffi_bug_test {
  /// Hello Rust
  string hello_world();
};

/// Example Enum
enum ExampleEnum {
  "v1",
  "v2",
};


/// Glucose
dictionary Glucose {
    f32 raw;
    timestamp timestamp;
    timestamp local_timestamp;
};

/// TodoList
interface TodoList {
    constructor();
};

from uniffi-rs.

pierre-wehbe avatar pierre-wehbe commented on August 19, 2024

@badboy thanks for looking into it, I'll try building a repo that reproduces the issue.

I failed to mention some information:

  • It runs fine on 0.25.x
  • here is what our Cargo.toml looks like, could it be possible us having a local "core" crate causes some namespace clashing?
...
[dependencies]
uniffi = { version = "0.27.2", features = [ "cli" ] }
shared = { path = "../rust/shared" }
core = { path = "../rust/core" }

[build-dependencies]
uniffi = { version = "0.27.2", features = [ "build" ] }
...

from uniffi-rs.

pierre-wehbe avatar pierre-wehbe commented on August 19, 2024

@badboy Indeed, renaming our local core lib to anything else works...

from uniffi-rs.

mhammond avatar mhammond commented on August 19, 2024

There are some places we use core:: where using ::core:: would probably solve this - eg, here

from uniffi-rs.

pierre-wehbe avatar pierre-wehbe commented on August 19, 2024

@mhammond That was my thought as well, I've unblocked us by renaming our current library, but I bet lots of repos would have a "core" package internal to them, would be nice to prioritize this issue

from uniffi-rs.

badboy avatar badboy commented on August 19, 2024

There are some places we use core:: where using ::core:: would probably solve this - eg, here

Ah, somehow that is the one instance I overlooked. Yes, changing that to ::core should likely fix this issue.

@mhammond That was my thought as well, I've unblocked us by renaming our current library, but I bet lots of repos would have a "core" package internal to them, would be nice to prioritize this issue

I kinda doubt that many people name their crate core. Probably a lot of other crates would use core:: and thus naming an internal crate core has high potential of more breakage. Nonetheless we should of course fix uniffi here.

from uniffi-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.