Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Merge upstream #16

Merged
merged 26 commits into from
Nov 13, 2023
Merged

Merge upstream #16

merged 26 commits into from
Nov 13, 2023

Conversation

MeerKatDev
Copy link
Member

No description provided.

bendk and others added 26 commits October 18, 2023 13:27
Also arrange for mdbook-linkcheck to be used to check the links which
should fail CI if broken links are re-added.
A single global callback won't work if there are multiple foreign
modules.  Instead, input the callback in `poll()`.

Added some tests for this in `fixtures/ext-types/proc-macro-lib`.
Things worked on Swift and Python for me because that code was based on
leaking a pointer and it happened to work if the pointer came from
another module.  It just halted on Kotlin though and I think the same
would happen if I wasn't on CPython and the alternate PointerMangager
was used.
This is part of mozilla#1791, which was merged just after the `0.25.0` release
was made.  We wanted to give that code a bit of time in main before
releasing it.  However, this part is useful for traits implemented in
Rust.
* Kotlin: fixed external types with async functions (mozilla#1798)
* Swift: fixed compile error when multiple crates define async functions
A single global callback won't work if there are multiple foreign
modules.

In `main` we handle this by inputting a callback in `poll()`.

In `release-v0.25.x` we can't change `UNIFFI_CONTRACT_VERSION`, so
instead we keep the `rust_future_continuation_callback_set` scaffolding
function, then have the scaffolding code pass the callback to
`rustfutures.rs`.

Added some tests for this in `fixtures/ext-types/proc-macro-lib`.
Things worked on Swift and Python for me because that code was based on
leaking a pointer and it happened to work if the pointer came from
another module.  It just halted on Kotlin though and I think the same
would happen if I wasn't on CPython and the alternate PointerMangager
was used.
Instead of replacing `uniffi.toml` with override config entirely, merge
the override config into `uniffi.toml`. The merge recursively upserts
TOML keys.

This strategy seems pretty standard everywhere when it comes to
configuration. Merging allows the configuration to be selectively
changed, without having to duplicate the entire default configuration.

The main use case for this would be to allow "global" configuration
across multiple crates in a library. Some configuration options should
be the same for all crates in a library, without having to duplicate
these options across all crates. Right now I can think of 3 use cases
of such configuration:

- In Swift generator, `omit_argument_labels`. I'm not entirely sure if
    anyone is actually using this, but it seems like an option that
    someone might potentially want to configure for all crates in a
    library.

- In `uniffi-bindgen-go`, `go_mod` configuration key is used to control
    the prefix for external type imports. Multiple crates in a library
    using external types share a common prefix when it comes to
    importing the external types, e.g. `com.example.uniffi.*`. This
    should configured as a single property for all crates.

- External binding generators can use the merge option to inject
    additional configuration into `custom_types` fixture. This one
    is a bit sketchy, because external binding generators might want to
    modify the configuration for specific fixture/example crates in
    upstream, instead of doing global configuration for all crates.
    Still, global configuration solves the immediate issue of
    configuring `custom_types` crate to including `Url` custom type for
    external bindings.
`fatalError()` just causes a crash, there's no need to throw it.
Add a 3rd party language "Dart".
…ozilla#1817)

This brings those language to parity with Python.
- Also make their methods open.
- Make the `Pointer` in `FfiObject` optional.
- Add a `constructor(noPointer: NoPointer)` to create a FFiObject with no pointer for fakes.
- Remove redundant interfaces since they can be implemented, but not used in any way.
- Add tests for fakes.
@MeerKatDev MeerKatDev merged commit 2e22cb2 into main Nov 13, 2023
@MeerKatDev MeerKatDev deleted the merge-upstream branch December 4, 2023 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants