Skip to content

Commit

Permalink
Bump v0.25.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Aivaras Saulius authored and arg0d committed Nov 16, 2023
1 parent 5e72b3e commit 541f1f4
Show file tree
Hide file tree
Showing 16 changed files with 1,228 additions and 463 deletions.
687 changes: 477 additions & 210 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
FROM rust:1.64-bullseye as builder
FROM rust:1.72-bullseye as builder
COPY . /project
RUN cd /project && cargo install --path uniffi-bindgen
RUN cargo install uniffi-bindgen-cs --tag v0.4.0+v0.23.0 --git https://github.com/NordSecurity/uniffi-bindgen-cs
RUN cargo install uniffi-bindgen-go --tag v0.1.5+v0.23.0 --git https://github.com/NordSecurity/uniffi-bindgen-go

FROM debian:bullseye
# Download crates.io index, saves time if subsequent steps change
RUN cargo search --limit 0

RUN cd /project && cargo install --path uniffi-bindgen
RUN cargo install uniffi-bindgen-cs --tag v0.7.0+v0.25.0 --git https://github.com/NordSecurity/uniffi-bindgen-cs
RUN cargo install uniffi-bindgen-go --tag v0.2.0+v0.25.0 --git https://github.com/NordSecurity/uniffi-bindgen-go
RUN cargo install uniffi-bindgen-cpp --tag v0.1.0+v0.25.0 --git https://github.com/NordSecurity/uniffi-bindgen-cpp

FROM rust:1.72-bullseye
COPY --from=builder /usr/local/cargo/bin/uniffi-bindgen /bin
COPY --from=builder /usr/local/cargo/bin/uniffi-bindgen-cs /bin
COPY --from=builder /usr/local/cargo/bin/uniffi-bindgen-go /bin
COPY --from=builder /usr/local/cargo/bin/uniffi-bindgen-cpp /bin

RUN apt-get update && apt-get install -y --no-install-recommends python3 && apt-get clean && rm -rf /var/lib/apt/lists/*
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ each time one of the generators is updated e.g. because of the bug fix. The tabl
shows which versions of each generator are inside the docker image.


| Docker image | uniffi-rs version | uniffi-bindgen-cs version | uniffi-bindgen-go version |
|------------------------|-------------------|---------------------------|---------------------------|
| v0.23.0-6 | v0.23.0-3 (FORK) | v0.4.0+v0.23.0 | v0.1.5+v0.23.0 |
| v0.23.0-5 | v0.23.0-3 (FORK) | v0.4.0+v0.23.0 | v0.1.5+v0.23.0 |
| v0.23.0-4 | v0.23.0 (FORK) | v0.2.3+v0.23.0 | v0.1.3+v0.23.0 |
| v0.23.0-3 (DO NOT USE) | v0.23.0 (FORK) | v0.2.2+v0.23.0 | v0.1.0+v0.23.0 |
| v0.23.0-2 (DO NOT USE) | v0.23.0 | v0.2.1+v0.23.0 | v0.1.0+v0.23.0 |
| v0.23.0-1 | v0.23.0 | v0.2.1+v0.23.0 | not present |
| Docker image | uniffi-rs version | uniffi-bindgen-cs version | uniffi-bindgen-go version | uniffi-bindgen-cpp version |
|------------------------|-----------------------|---------------------------|---------------------------|----------------------------|
| v0.25.0-1 | **v0.25.0-1 (FORK)** | **v0.7.0+v0.25.0** | **v0.2.0+v0.25.0** | **v0.1.0+v0.25.0** |
| v0.23.0-6 | v0.23.0-3 (FORK) | v0.4.0+v0.23.0 | v0.1.5+v0.23.0 | not present |
| v0.23.0-5 | v0.23.0-3 (FORK) | **v0.4.0+v0.23.0** | **v0.1.5+v0.23.0** | not present |
| v0.23.0-4 | v0.23.0 (FORK) | **v0.2.3+v0.23.0** | **v0.1.3+v0.23.0** | not present |
| v0.23.0-3 (DO NOT USE) | v0.23.0 (FORK) | **v0.2.2+v0.23.0** | v0.1.0+v0.23.0 | not present |
| v0.23.0-2 (DO NOT USE) | v0.23.0 | v0.2.1+v0.23.0 | **v0.1.0+v0.23.0** | not present |
| v0.23.0-1 | v0.23.0 | v0.2.1+v0.23.0 | not present | not present |

### v0.23.0-6

Expand Down
4 changes: 2 additions & 2 deletions compatibility-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ crate-type = ["lib", "staticlib", "cdylib"]
name = "uniffi_coverall"

[dependencies]
uniffi = { version = "0.23.0" }
uniffi = { version = "0.25.0" }
once_cell = "1.12"
thiserror = "1.0"

[build-dependencies]
uniffi = { version = "0.23.0", features = ["build"] }
uniffi = { version = "0.25.0", features = ["build"] }
83 changes: 80 additions & 3 deletions compatibility-test/src/coverall.udl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@ namespace coverall {

u64 get_num_alive();

sequence<TestTrait> get_traits();

MaybeSimpleDict get_maybe_simple_dict(i8 index);

// void returning error throwing namespace function to catch clippy warnings (eg, #1330)
[Throws=CoverallError]
void println(string text);

[Throws=CoverallFlatError]
void throw_flat_error();

[Throws=CoverallRichErrorNoVariantData]
void throw_rich_error_no_variant_data();
};

dictionary SimpleDict {
string text;
string? maybe_text;
boolean a_bool;
bytes some_bytes;
bytes? maybe_some_bytes;
boolean a_bool;
boolean? maybe_a_bool;
u8 unsigned8;
u8? maybe_unsigned8;
Expand All @@ -29,6 +41,7 @@ dictionary SimpleDict {
double float64;
double? maybe_float64;
Coveralls? coveralls;
TestTrait? test_trait;
};

dictionary DictWithDefaults {
Expand All @@ -43,15 +56,38 @@ interface MaybeSimpleDict {
Nah();
};

// Note that UDL *can not* express flat enums (ie, those with variants that carry data which
// should be ignored for the ffi), only flat errors?
//enum SimpleFlatEnum {
// "First",
// "Second",
//};

[Error]
enum CoverallError {
"TooManyHoles"
};

// This error is described in Rust with variants, but because it's declared
// here via an `enum` it's considered "flat"
[Error]
enum CoverallFlatError {
"TooManyVariants"
};

// This error is for an enum that's still "flat" on the Rust side (ie, no
// variants have associated data), but it behaves differently on the bindings
// side than had it been described via `enum`
[Error]
interface CoverallRichErrorNoVariantData {
TooManyPlainVariants();
};

[Error]
interface ComplexError {
OsError(i16 code, i16 extended_code);
PermissionDenied(string reason);
OsError(i16 code, i16 extended_code);
PermissionDenied(string reason);
UnknownError();
};

interface Coveralls {
Expand Down Expand Up @@ -128,6 +164,9 @@ interface Coveralls {

/// Returns all repairs made.
sequence<Repair> get_repairs();

/// Reverses the bytes.
bytes reverse(bytes value);
};

// coveralls keep track of their repairs (an interface in a dict)
Expand All @@ -150,3 +189,41 @@ interface ThreadsafeCounter {
void busy_wait(i32 ms);
i32 increment_if_busy();
};

// This is a trait implemented on the Rust side.
[Trait]
interface TestTrait {
string name(); // The name of the implementation

[Self=ByArc]
u64 number();

/// Calls `Arc::strong_count()` on the `Arc` containing `self`.
[Self=ByArc]
u64 strong_count();

/// Takes an `Arc<Self>` and stores it in `self`, dropping the existing
/// reference. Note you can create circular references by passing `self`.
void take_other(TestTrait? other);

/// Returns what was previously set via `take_other()`, or null.
TestTrait? get_other();
};

// Forward/backward declarations are fine in UDL.
// Running the Python tests & type checks will ensure this works,
// no function calls needed

interface IFirst {
constructor();

// Handling optional with a default value
boolean compare(optional ISecond? other = null);
};

interface ISecond {
constructor();

// Default only
boolean compare(IFirst? other);
};
Loading

0 comments on commit 541f1f4

Please sign in to comment.