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

Add Minimum Supported Swift Version Policy #316

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,25 @@ to see if any peak your interest.

These issues come with step-by-step instructions that should help guide you towards implementing your first patch.

## Minimum Supported Swift Version (MSSV)

`swift-bridge` currently guarantees that the Swift code that it generates will work on Swift `6.0` and later.
This is known the project's "Minimum Supported Swift Version" (MSSV).

`swift-bridge`'s current policy is that the minimum required Swift version can be increased at any time to
any Swift version that is at least one month old.

For instance, if Swift `9.10.11` is released on April 5, 2035, then on May 5, 2035 the `swift-bridge` project is allowed
to begin emitting Swift code that relies on Swift `9.10.11`.

We will increase our support windows when one or both of the following happen:

- We are no longer waiting for Swift features that increase the safety, performance and ergonomics of the Swift code that `swift-bridge` emits.
- For instance, Swift recently introduced the `~Copyable` protocol, which we plan to use enforce ownership when Swift code uses opaque Rust types.

- The short support window is disrupting projects that use `swift-bridge` today.
- Please open an issue if our MSSV policy impacts your project

## Acknowledgements

- [cxx](https://github.com/dtolnay/cxx) inspired the idea of using a bridge module to describe the FFI boundary.
Expand Down
48 changes: 24 additions & 24 deletions crates/swift-bridge-ir/src/codegen/codegen_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@ use crate::test_utils::{
assert_trimmed_generated_equals_trimmed_expected, parse_ok,
};

mod already_declared_attribute_codegen_tests;
mod argument_label_codegen_tests;
mod async_function_codegen_tests;
mod boxed_fnonce_codegen_tests;
mod built_in_tuple_codegen_tests;
mod c_header_declaration_order_codegen_tests;
mod conditional_compilation_codegen_tests;
mod derive_attribute_codegen_tests;
mod derive_struct_attribute_codegen_tests;
mod extern_rust_function_opaque_rust_type_argument_codegen_tests;
mod extern_rust_function_opaque_rust_type_return_codegen_tests;
mod extern_rust_method_swift_class_placement_codegen_tests;
mod function_attribute_codegen_tests;
mod generic_opaque_rust_type_codegen_tests;
mod opaque_rust_type_codegen_tests;
mod opaque_swift_type_codegen_tests;
mod option_codegen_tests;
mod result_codegen_tests;
mod return_into_attribute_codegen_tests;
mod single_representation_type_elision_codegen_tests;
mod string_codegen_tests;
mod transparent_enum_codegen_tests;
mod transparent_struct_codegen_tests;
mod vec_codegen_tests;
mod already_declared_attribute;
mod argument_label;
mod async_function;
mod boxed_fnonce;
mod built_in_tuple;
mod c_header_declaration_order;
mod conditional_compilation;
mod derive_attribute;
mod derive_struct_attribute;
mod extern_rust_function_opaque_rust_type_argument;
mod extern_rust_function_opaque_rust_type_return;
mod extern_rust_method_swift_class_placement;
mod function_attribute;
mod generic_opaque_rust_type;
mod opaque_rust_type;
mod opaque_swift_type;
mod option;
mod result;
mod return_into_attribute;
mod single_representation_type_elision;
mod string;
mod transparent_enum;
mod transparent_struct;
mod vec;

struct CodegenTest {
bridge_module: BridgeModule,
Expand Down
Loading