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

Hack: Copy metadata module to avoid uniffi_core dependency #1666

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

badboy
Copy link
Member

@badboy badboy commented Jul 25, 2023

In m-c we're running into linking issues in uniffi_macros, where it's missing symbols coming from uniffi_core:

/bin/ld: uniffi_foreign_executor_callback_set: undefined version:
/bin/ld: failed to set dynamic section sizes: bad value

That's most likely this issue on Rust:
rust-lang/rust#111888
It's called out that this likely actually broke because of another PR: rust-lang/rust#99944

Despite this bug there's a bit of an issue in UniFFI to begin with: We're exporting extern "C" functions from a crate that is a dependency of some other crates, including uniffi_macros, and thus the symbols land in a part where they are not needed.

However for uniffi_meta in particular we don't need much from uniffi_core, so for now we just copy the necessary bits to get it all working.


Same as #1665, but against the release-v0.24.x branch

In m-c we're running into linking issues in `uniffi_macros`,
where it's missing symbols coming from `uniffi_core`:

    /bin/ld: uniffi_foreign_executor_callback_set: undefined version:
    /bin/ld: failed to set dynamic section sizes: bad value

That's most likely this issue on Rust:
rust-lang/rust#111888
It's called out that this likely actually broke because of another PR:
rust-lang/rust#99944

Despite this bug there's a bit of an issue in UniFFI to begin with:
We're exporting `extern "C"` functions from a crate that is a dependency
of some other crates, including `uniffi_macros`, and thus the symbols
land in a part where they are not needed.

However for `uniffi_meta` in particular we don't need much from
`uniffi_core`, so for now we just copy the necessary bits to get it all
working.
@badboy badboy requested a review from a team as a code owner July 25, 2023 11:54
@badboy badboy requested review from tarikeshaq, travis79 and a team and removed request for a team and tarikeshaq July 25, 2023 11:54
Copy link
Contributor

@bendk bendk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice workaround! Let's merge.

@badboy badboy merged commit 667ce2e into mozilla:release-v0.24.x Jul 25, 2023
@badboy badboy deleted the copied-metadata-module branch July 25, 2023 13:42
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

Successfully merging this pull request may close these issues.

3 participants