Debian Codegraph @

third_party/rust/mach2/README.md

raw
1 # mach2
2
3 [![Latest Version]][crates.io] [![docs]][docs.rs]
4
5 A Rust interface to the **user-space** API of the Mach 3.0 kernel exposed in
6 `/usr/include/mach` that underlies macOS and is linked via `libSystem` (and
7 `libsystem_kernel`).
8
9 This library does not expose the **kernel-space** API of the Mach 3.0 kernel
10 exposed in
11 `SDK/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/mach`.
12
13 That is, if you are writing a kernel-resident device drivers or some other
14 kernel extensions you have to use something else. The user-space kernel API is
15 often API-incompatible with the kernel space one, and even in the cases where
16 they match, they are sometimes ABI incompatible such that using this library
17 would have **undefined behavior**.
18
19 ## Usage
20
21 Add the following to your `Cargo.toml` to conditionally include mach on those
22 platforms that support it.
23
24 ```toml
25 [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.mach]
26 version = "0.4"
27 ```
28
29 Available crate feature:
30
31 * **unstable** (disabled by default): Exposes newly changed APIs. Enabling this may
32 bring breaking changes (see the breaking change policy).
33
34
35 ### Breaking change policy
36
37 We do the following steps when an item is changed/removed on latest toolchain:
38
39 1. Deprecate an existing one
40 2. Declare a new one under the `unstable` feature
41 3. After a month or more since releasing a new version that contains that change,
42 remove/change an older one
43
44 For instance, if const `FOO` value is changed from `3` to `4`,
45 we expose the newer one, i.e. `4`, under `unstable` first.
46 So the `unstable` users should notice the change on the first release since deprecating.
47 After a month or more, all the users should notice it.
48
49 ## Platform support
50
51 The following table describes the current CI set-up:
52
53 | Target | Min. Rust | XCode | build | ctest | run |
54 |-------------------------|-----------|-----------------|-------|-------|-----|
55 | `x86_64-apple-darwin` | 1.33.0 | 10.3.0 - 13.1.0 | ✓ | ✓ | ✓ |
56 | `aarch64-apple-darwin` | nightly | 13.1.0 | ✓ | - | - |
57 | `aarch64-apple-ios` | nightly | 13.1.0 | ✓ | - | - |
58 | `aarch64-apple-ios-sim` | nightly | 13.1.0 | ✓ | - | - |
59 | `x86_64-apple-ios` | nightly | 13.1.0 | ✓ | - | - |
60
61 ## License
62
63 This project is licensed under either of
64
65 * A 2-clause BSD License ([LICENSE-BSD](LICENSE-BSD)), or
66 * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
67 http://www.apache.org/licenses/LICENSE-2.0)
68 * MIT license ([LICENSE-MIT](LICENSE-MIT) or
69 http://opensource.org/licenses/MIT)
70
71 at your option.
72
73 ## Contribution
74
75 Unless you explicitly state otherwise, any contribution intentionally submitted
76 for inclusion in `mach` by you, as defined in the Apache-2.0 license, shall be
77 triple licensed as above, without any additional terms or conditions.
78
79 To locally test the library, run:
80
81 ```
82 TARGET=x86_64-apple-darwin RUST_VERSION=nightly ./ci/run.sh
83 ```
84
85 where you can replace the `TARGET` and `RUST_VERSION` with the target you
86 want to test (e.g. `aarch64-apple-darwin`) and the Rust version you want to use for
87 the tests (e.g. `stable`, `1.33.0`, etc.).
88
89 [crates.io]: https://crates.io/crates/mach2
90 [Latest Version]: https://img.shields.io/crates/v/mach2.svg
91 [docs]: https://docs.rs/mach2/badge.svg
92 [docs.rs]: https://docs.rs/mach2