Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mention uniffi_macros = "*" in the rust book #1645

Closed
gogo2464 opened this issue Jul 7, 2023 · 9 comments
Closed

mention uniffi_macros = "*" in the rust book #1645

gogo2464 opened this issue Jul 7, 2023 · 9 comments

Comments

@gogo2464
Copy link

gogo2464 commented Jul 7, 2023

since 0.23 uniffi_macros = "*" must be included in Cargo.toml with

[dependencies]
uniffi = {version = "", features = [ "cli" ]}
uniffi_macros = "
"
uniffi_bindgen = "*"

in order to avoid a uniffi_bindgen build fail with:

error[E0425]: cannot find function uniffi_bindgen_main in crate uniffi
--> uniffi-bindgen.rs:2:13
|
2 | uniffi::uniffi_bindgen_main()
| ^^^^^^^^^^^^^^^^^^^ not found in uniffi

IT sounds necessary. Fell free to tell me if you have same issue. I may document it and be assigend in the issue if necessary.

@mhammond
Copy link
Member

mhammond commented Jul 7, 2023

I don't think that's true, eg, here's a Cargo.toml referencing 0.24 without any such requirement.

@gogo2464
Copy link
Author

gogo2464 commented Jul 8, 2023

Strange. If you think so you may be right.

@YuchenJin
Copy link

Also facing this with uniffi==0.24.3, adding uniffi_macros="*" did fix this.

@andywwright
Copy link

@gogo2464 I have the same issue. PLEASE add this in the book

@gogo2464
Copy link
Author

I may do this this week.

@mhammond
Copy link
Member

mhammond commented Oct 2, 2023

See above - uniffi_macros = "*" should not be needed, so we'd be unlikely to take a patch which recommends it without a detailed explanation which explains why it's not used either inside the repo or by Mozilla's use of the repo.

@hhanh00
Copy link

hhanh00 commented Dec 5, 2024

I don't think that's true, eg, here's a Cargo.toml referencing 0.24 without any such requirement.

I don't see where this project calls uniffi_bindgen_main. In any case, the problem goes away if you include the "cli " feature (as explained in the docs).

@gogo2464
Copy link
Author

gogo2464 commented Dec 5, 2024

@gogo2464 I have the same issue. PLEASE add this in the book

Hello.

I am sorry that I did not do it yet. Do you still would like I do it? I could add it to the book REALLY this week if you like.

@hhanh00
Copy link

hhanh00 commented Dec 6, 2024

It is not necessary to have uniffi_macros="*" but you need features=["cli"] and the book mentions it on the command line of cargo run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants