mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +01:00
Fix the native-bluetooth feature on macOS builds. Enable the native-bluetooth by default. Testing: Added --features native-bluetooth to GH actions so the build will fail if something is wrong. Don't know why it was not enabled previously, please let me know if it is ok to leave the feature enabled. Fixes: https://github.com/servo/servo/issues/37454 As for the numerous such warnings ``` warning: unexpected `cfg` condition value: `cargo-clippy` --> third_party/blurmac/src/framework.rs:480:43 | 480 | let uuidstring: *mut Object = msg_send![cbuuid, UUIDString]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: no expected values for `feature` = note: using a cfg inside a macro will use the cfgs from the destination crate and not the ones from the defining crate = help: try referring to `sel_impl` crate for guidance on how handle this unexpected cfg = help: the macro `sel_impl` may come from an old version of the `objc` crate, try updating your dependency with `cargo update -p objc` = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration = note: this warning originates in the macro `sel_impl` which comes from the expansion of the macro `msg_send` (in Nightly builds, run with -Z macro-backtrace for more info) ``` that macOS builds generates (mentioned [here](https://github.com/servo/servo/pull/37439)) I found this: https://github.com/SSheldon/rust-objc/issues/125. Also, in general the `objc` crate seems to be stale and people are forking it, so maybe I should start a Zulip conversation about migrating to something like this https://github.com/madsmtm/objc2? --------- Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com> |
||
---|---|---|
.. | ||
src | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE.md | ||
README.md |
Bluetooth Rust lib using macOS CoreBluetooth
The main aim of BlurMac is to enable WebBluetooth in Servo on macOS. Thus, API and implementation decisions are affected by the encapsulating Devices, and the sibling BlurZ and BlurDroid crates.
Run Servo with WebBluetooth Enabled
Usually, you don't want to work with BlurMac on its own but use it within Servo. So, most probably you'll want to run Servo with WebBluetooth enabled:
RUST_LOG=blurmac \
./mach run \
--dev \
--pref=dom.bluetooth.enabled \
--pref=dom.permissions.testing.allowed_in_nonsecure_contexts \
URL
Notes:
- The above command is actually not really BlurMac-specific (except for the
RUST_LOG
part). It runs Servo with WBT enabled on any platform where WBT is supported. - You don't need the
RUST_LOG=blurmac
part if you don't want to see BlurMac debug messages on the console. - You don't need the
--dev
part if you want to run a release build. - You don't need the
--pref=dom.permissions.testing.allowed_in_nonsecure_contexts
part if yourURL
is https (but you do need it if you test a local file).
Known Issues
- Device RSSI can not be retrieved yet.
- Support for included services is incomplete.
- Descriptors are not supported yet.
- Notifications on characteristics are not supported yet (the limitation comes from Devices).
Compatibility
Tested on:
- macOS Sierra 10.12.
Copyright and Licensing
Licensed under the BSD 3-Clause License.