Граф коммитов

19 Коммитов

Автор SHA1 Сообщение Дата
Murph Murphy 074270afd7
Switch to portable bash shebang (#1876)
Search the path for `bash` vs expecting it at `/bin`.
2023-12-01 09:54:03 +01:00
Jan-Erik Rediger f0be561e98 Update Rust to 1.69, MSRV to 1.66.0
As per our Rust version policy:
https://github.com/mozilla/uniffi-rs/blob/main/docs/policies/rust-versions.md
2023-06-06 10:54:27 +02:00
Jan-Erik Rediger e05e746ed3 Build and deploy the Docker image on `docker-vX` tag pushes 2023-04-06 10:35:17 +02:00
Jan-Erik Rediger a1dc200e17 Docker: Update deps 2023-03-20 11:33:31 +01:00
Jan-Erik Rediger e46deacb57 Add line continuation in dockerfile 2023-03-20 11:33:31 +01:00
Ivan Enderlin cca62747d8
test: Update Swift to 5.5. 2023-02-20 16:12:41 +01:00
Ivan Enderlin 4d6cd0369e
test: Disable Swift tests for `fixtures/futures/. 2023-02-20 16:11:37 +01:00
Ivan Enderlin 170141210a
fix(docker) Remove a double `-o` in a `curl` command. 2023-02-20 15:20:04 +01:00
Ivan Enderlin 48ed0bd509 test: Install `kotlinx-coroutines-core-jvm.jar`. 2022-12-19 15:24:39 +01:00
Alex Rahalevich e109ef9241 Upgrade to a newer base docker image 2021-08-27 15:08:49 +10:00
Jan-Erik Rediger 61ae695191 Remove workaround for JNA bug when passing small structs by value.
This (partially) reverts commit 937f9b76f5

The upstream JNA bug[1] has been resolved.
JNA 5.7 includes the fix.

We're upgrading our Docker test image to 5.8 already.

Fixes #334

[1]: https://github.com/java-native-access/jna/issues/1259
2021-08-05 13:07:52 +10:00
Ryan Kelly db7e0ca81c Add `contributing.md`, and clean up some other docs.
I'm trying to iterate on the contributor experience for UniFFI,
both to support new team members coming on board and to support
additional external contributors. As a start, this:

* Adds a contributing.md file with some concrete steps on how
  to get up and running.
* Cleans up the README, linking out to more thorough docs
  rather than brain-dumping a bunch of stuff into a single place.
  * In particular, some motivational material has moved into a
    new "Motivation" section of the user guide.
* Moves all scaffolding-related code into its own sub-module,
  to make it easier to describe how to navigate the code.
2021-06-11 17:02:10 +10:00
Mark Hammond 66de08450b
Update our rust policy to match mozilla-central's 'uses' version (#470) 2021-06-02 14:51:55 +10:00
Alex Rahalevich ed962e8b93 Use rust version from rust-toolchain.toml file. 2021-05-26 10:22:51 +10:00
Alex Rahalevich c7342d9465 Add ruby dependencies into CI docker image 2021-05-25 14:56:25 +10:00
Ryan Kelly 67fcfaf4d1
Use static assertions to check uniffi/uniffi-bindgen version compatibility. (#414)
Fixes #413.

Prior to this commit, the `uniffi-bindgen` command would use `cargo metadata`
to discover the version of uniffi being used by the target crate, and would
error out if did not match the version of uniffi-bindgen itself.

Unfortunately, this approach is not reliable when the target crate is being
compiled as a dependency rather than as the primary crate. The build process
may pick a version of uniffi based on the `Cargo.lock` of the primary crate
or based on resolving compatible versions with other dependencies, while
while `cargo metadata` will report the verison of uniffi that would be used
if you built the target crate in isolation.

To avoid these potential sources of error, this commit switches to an approach
based on static assertions, in two halves:

* When generating the Rust scaffolding, we emit a call to a new
  macro `uniffi::assert_compatible_version!(v)` and pass it a static
  string constant representing the version of uniffi_bindgen that
  generated the code.

* When compiling the resulting code as part of a uniffied crate, the
  `assert_compatible_version!` macro will check the static string against
  the version of uniffi being used in the build, producing a compile-time
  failure if they do not match.

This is a slightly worse consumer experience because the error message
isn't as good, but it's more reliable, so I think it's a win overall.

Be warned, I had to do some terrible things to perform this check in
a compile-time const context on stable Rust :-/

I've also taken the opportunity to try out the `trybuild` crate to
write a testcase for the actual compiler error message generated
by the macro. As we come to iterate more on the developer experience,
I expect `trybuild` or something like it will become pretty important.
2021-03-17 13:00:34 +11:00
Ryan Kelly eeba64136c
Compatibility tweaks for Rust v1.43.0
The version of Rust in mozilla-central is currently pinned to v1.43.0,
so we need to make sure we're compatible with it as well.
2020-11-09 14:31:25 +11:00
Ryan Kelly cda48b36b6
Turn example scripts into simple test fixtures.
Prior to this commit, the only "tests" we had for the generated code
were a small set of example scripts in the various target languages,
and we could "test" them by manually executing the script and seeing
whether it printed plausible output.

With this commit, those scripts can now be proper testcases. It has
involved a fair bit of restructuring, but broadly:

* The crate and its examples are now part of a single workspace,
  so `cargo test` in the top-level directory will test them all.
* There is a new `uniffi_macros` crate with a single macro called
  `build_foreign_language_testcases!`. Given a list of script files,
  it will generate a testcase shim for each one, executing the file
  via an appropriate interpret and failing the test if it does not
  exit successfully.
* The various example crates have had their example scripts converted
  into testcases in this manner.
2020-07-22 10:07:32 +10:00
Ryan Kelly 18ff9bdab2
Try to turn on CircleCI... 2020-07-17 16:03:13 +10:00