Skip to content

Commit

Permalink
Polish before alpha (#21)
Browse files Browse the repository at this point in the history
* Fix help, async_complete

* More TODO cleanup

* Fix imported types test, more complete README

* Move readme todos to issues

* Commit including hardcoded dep paths

so I can copy them later if needed

* Point to branch

* Add `List` to map FfiConverter

* Use `main` `metadata_no_deps`

* Consume main uniffi w/ extra info on RustBuffer

* Test runner action

* Don't use sccache

* Try "forcing" GC to see if it's JVM state

* Try without coverage in parallel

* Back to original CI, focusing on theorizing a fix

* Try a longer delay before cancelling

What if the logic is fine but the Java FFI is slow, so the delay
finishes before the call from Rust gets back for it to await the
abortable?

* More exaggerated

* Isolate failing test, add timing info

* Don't isolate, remove GC

* What if we don't block on initial call

and wait longer than the times we're seeing in CI on the delay. The free
is still being called, so nothing looks like it's leaking, but it is way
slower than expected vs local (or even passing CI runs, which were
faster than local)

* The free was close in behind the delay finishing

Try extending the delay a bunch

* Try it in the real test

* Add logging to main test

* :/

* Maybe even longer? The free was half a ms after

* Check when free happens in CI failure

* Sanity check free timing on failures

Right now when it works in CI the free happens ~1.3ms after the call to
the delay trait (which makes sense given the 1ms delay in Rust before it
aborts). When it doesn't work though the free doesn't happen until ~.6ms
after the delay call fully finishes, so 100.5ms after the call to the
delay trait. It seems like a bug where the FreeImpl isn't being called
from Rust in time, but I want to see if bumping the delay to 200ms
results in 1.3/200.5, or 1.3/100.5 still

* Log in millis to compare to rust

* Busy wait when polling CompletableFuture callback

We can't trust Java's `CompletableFuture` to wake a suspended thread correctly when the
`CompletableFuture` being blocked on is `complete()`, so we're manually
busy waiting the futures thread for now.

* Handle CI issue still present

* Try to get some more info about what handle is left

* Push the timing up a bit

* Add changelog and initial releasing doc.

* Drop extra logging

* More permissive timing to avoid intermittent failure
  • Loading branch information
skeet70 authored Aug 14, 2024
1 parent 95c9560 commit c865946
Show file tree
Hide file tree
Showing 16 changed files with 284 additions and 93 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 0.1.0

Initial pre-release. This library will be used to provide Java bindings for [IronCore Alloy](https://github.com/IronCoreLabs/ironcore-alloy/tree/main). It will recieve frequent breaking changes initially as we find improvements through that libaries' usage of it.

68 changes: 27 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ path = "src/main.rs"
anyhow = "1"
askama = { version = "0.12", default-features = false, features = ["config"] }
camino = "1.1.6"
cargo_metadata = "0.15"
clap = { version = "4", default-features = false, features = [
"derive",
"help",
"std",
"cargo",
] }
Expand All @@ -27,20 +29,19 @@ regex = "1.10.4"
serde = "1"
textwrap = "0.16.1"
toml = "0.5" # can't be on 8, `Value` is part of public interface
uniffi_bindgen = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi_meta = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi_bindgen = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi_meta = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }

[dev-dependencies]
cargo_metadata = "0.18.1"
glob = "0.3"
itertools = "0.13.0"
uniffi-example-arithmetic = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-example-custom-types = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-example-futures = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-example-geometry = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-example-rondpoint = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-fixture-coverall = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-fixture-ext-types = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-fixture-futures = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-fixture-time = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi_testing = { git = "https://github.com/skeet70/uniffi-rs.git", branch = "thread-external-type-metadata-rustbuffer" }
uniffi-example-arithmetic = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-example-custom-types = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-example-futures = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-example-geometry = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-example-rondpoint = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-fixture-coverall = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-fixture-ext-types = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-fixture-futures = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi-fixture-time = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
uniffi_testing = { git = "https://github.com/mozilla/uniffi-rs.git", branch = "main" }
Loading

0 comments on commit c865946

Please sign in to comment.