Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
4c88a55
Vendor BlueZ's bluetooth.h verbatim
colemancda Aug 1, 2026
8f7b3d9
Vendor BlueZ's hci.h verbatim
colemancda Aug 1, 2026
5c05b7f
Vendor BlueZ's hci_lib.h verbatim
colemancda Aug 1, 2026
59632e1
Vendor BlueZ's sdp.h verbatim
colemancda Aug 1, 2026
249d1a4
Vendor BlueZ's sdp_lib.h verbatim
colemancda Aug 1, 2026
186c4e1
Vendor BlueZ's l2cap.h verbatim
colemancda Aug 1, 2026
3ba48c5
Vendor BlueZ's rfcomm.h verbatim
colemancda Aug 1, 2026
23f2a90
Vendor BlueZ's sco.h verbatim
colemancda Aug 1, 2026
be74890
Vendor BlueZ's bnep.h verbatim
colemancda Aug 1, 2026
e2dab8c
Vendor BlueZ's cmtp.h verbatim
colemancda Aug 1, 2026
be04872
Vendor BlueZ's hidp.h verbatim
colemancda Aug 1, 2026
ee12a04
Vendor BlueZ's uuid.h verbatim
colemancda Aug 1, 2026
4dd84f7
Add the GPL-2.0-or-later license for the vendored headers
colemancda Aug 1, 2026
3c2b231
Add the CBluetoothLinuxABI umbrella header
colemancda Aug 1, 2026
a6af041
Add the CBluetoothLinuxABI module map
colemancda Aug 1, 2026
50b41b8
Document CBluetoothLinuxABI's licensing and stub table
colemancda Aug 1, 2026
73ab4d6
Record the exported symbol surface of libbluetooth.so.3
colemancda Aug 1, 2026
ca644a4
Record which exported symbols are already implemented
colemancda Aug 1, 2026
f6f94bd
Add the ownership audit for each exported symbol
colemancda Aug 1, 2026
b1469be
Add a generator for stubs of not-yet-implemented symbols
colemancda Aug 1, 2026
ba52bd9
Generate stubs for the not-yet-implemented symbols
colemancda Aug 1, 2026
555fe15
Add a generator for the linker version script and export list
colemancda Aug 1, 2026
0e33e28
Add the linker version script for libbluetooth.so.3
colemancda Aug 1, 2026
e6e57b8
Add the flat exported symbol list for check-exports
colemancda Aug 1, 2026
aa0ae21
Add a script to assert exported symbols against a list
colemancda Aug 1, 2026
7cb042e
Add the CMake shared-library placeholder translation unit
colemancda Aug 1, 2026
a5c0a94
Add the pkg-config template for libbluetooth
colemancda Aug 1, 2026
8c5e9e9
Add the CMake build for libbluetooth.so.3
colemancda Aug 1, 2026
0d08c6c
Add the opt-in CBluetoothLinuxABI target
colemancda Aug 1, 2026
6db3296
Document where the differential conformance driver lives
colemancda Aug 1, 2026
dc7f015
Add script to generate HCI lookup tables from BlueZ hci.c
colemancda Aug 1, 2026
feae81c
Add generated HCI lookup tables
colemancda Aug 1, 2026
6198c1f
Implement HCI string converter family
colemancda Aug 1, 2026
72cbde5
Wire BluetoothLinuxABI into the C ABI SwiftPM build
colemancda Aug 1, 2026
783cf08
Add unit tests for HCI string converters
colemancda Aug 1, 2026
9df0bc1
Mark HCI string converter symbols as implemented
colemancda Aug 2, 2026
29e270e
Regenerate C ABI stub table
colemancda Aug 2, 2026
23d5c4b
Add differential conformance driver for HCI string converters
colemancda Aug 2, 2026
ed0be9a
Add conformance compare script for BluetoothLinux drivers
colemancda Aug 2, 2026
fbda7ae
Wire BluetoothSDP and BluetoothLinuxABI into the CMake build
colemancda Aug 2, 2026
f533b48
Implement HCI device management family
colemancda Aug 2, 2026
56d0198
Add unit tests for HCI device management
colemancda Aug 2, 2026
99f47bb
Mark HCI device management symbols as implemented
colemancda Aug 2, 2026
74cc41e
Regenerate C ABI stub table
colemancda Aug 2, 2026
9c02486
Add shared HCI command request helpers
colemancda Aug 2, 2026
3c62693
Implement connection and link-policy HCI command wrappers
colemancda Aug 2, 2026
4facdb1
Implement remote-device query HCI command wrappers
colemancda Aug 2, 2026
14635ae
Implement local controller info HCI command wrappers
colemancda Aug 2, 2026
53403ad
Implement LE HCI command wrappers
colemancda Aug 2, 2026
b8cef5f
Implement controller configuration HCI command wrappers
colemancda Aug 2, 2026
c85791f
Implement hci_inquiry
colemancda Aug 2, 2026
c37234a
Mark HCI command wrapper symbols as implemented
colemancda Aug 2, 2026
4de8ba9
Regenerate C ABI stub table
colemancda Aug 2, 2026
602d1a6
Update dependencies
colemancda Aug 7, 2026
cfa7e2b
Drop the BluetoothSDP target from the CMake link
colemancda Aug 7, 2026
a527876
Add the SDP request-PDU assembly helpers
colemancda Aug 7, 2026
be35f10
Implement the SDP client session lifecycle
colemancda Aug 7, 2026
3e09884
Implement the blocking SDP requests
colemancda Aug 7, 2026
a98239b
Mark the SDP session symbols as implemented
colemancda Aug 7, 2026
37149db
Regenerate C ABI stub table
colemancda Aug 7, 2026
3770884
Put BluetoothABI on the CMake module search path
colemancda Aug 7, 2026
39bb8c9
Add an alignment-safe store for PDU fields
colemancda Aug 7, 2026
be6bec0
Implement the SDP service record registration functions
colemancda Aug 7, 2026
6830eca
Implement the asynchronous SDP requests and sdp_process
colemancda Aug 7, 2026
b699706
Mark the last SDP symbols as implemented
colemancda Aug 7, 2026
6153724
Regenerate C ABI stub table
colemancda Aug 7, 2026
b4964bb
Raise the CI toolchain floor and cover the C ABI
colemancda Aug 7, 2026
5b9213f
Add a CMake workflow
colemancda Aug 7, 2026
18a45a7
Fix the classic-address decoding expectation
colemancda Aug 7, 2026
f97b0a1
Install python3 in the CMake workflow
colemancda Aug 7, 2026
138965b
Accept BlueZ version skew in the conformance diff
colemancda Aug 7, 2026
6e79d2f
Include string.h in MathTestsHelper.h
colemancda Aug 7, 2026
8376fa3
Use GITHUB_WORKSPACE instead of the workspace expression
colemancda Aug 7, 2026
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
62 changes: 62 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CMake

on: [push]

jobs:

# Verifies the CMake packaging path, which is what actually produces
# the installable libbluetooth.so.3: soname, symbol versioning and the
# export list are not expressible in Package.swift, so SwiftPM's build
# of the same sources proves nothing about the shipped artifact.
#
# This is also the only job that runs check-exports, the assertion that
# the library exports exactly the reference's symbol set — the one
# check that would catch the drop-in premise breaking.
cmake:
name: CMake
runs-on: ubuntu-latest
# noble, not jammy like the Swift workflow: CMakeLists.txt requires
# CMake 3.26+ and jammy's apt carries only 3.22. noble ships 3.28.
# 6.3 because the C ABI is bound with `@c`, which 6.2 rejects.
container: swift:6.3.3-noble
steps:
- name: Checkout
uses: actions/checkout@v4
# The shared object links the non-socket half of the C ABI out of
# PureSwift/Bluetooth's own CMakeLists, so that has to be checked out
# too — pinned to the same version Package.swift depends on, so the
# two halves cannot drift apart in CI.
- name: Checkout PureSwift/Bluetooth
uses: actions/checkout@v4
with:
repository: PureSwift/Bluetooth
ref: "8.1.0"
path: Bluetooth
- name: Swift Version
run: swift --version
# python3 as well: the swift containers don't ship it, and the
# configure step runs the stub/symbol generators (scripts/*.py)
# through find_package(Python3), which is REQUIRED.
- name: Install CMake, Ninja and Python
run: apt-get update && apt-get install -y cmake ninja-build python3
# $GITHUB_WORKSPACE (the runtime variable), not ${{ github.workspace }}
# (the expression): in a container job the expression expands to the
# host path (/home/runner/work/...), which does not exist inside the
# container, where the workspace is mounted at /__w/... instead. The
# variable is set by the runner in the container's environment and
# resolves to the mounted path.
- name: Configure
run: >
cmake -B build -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DBLUETOOTH_PACKAGE_PATH="${GITHUB_WORKSPACE}/Bluetooth"
- name: Build
run: cmake --build build
- name: Check exported symbols
run: cmake --build build --target check-exports
# Installing is cheap and catches a broken install rule, which would
# otherwise only surface when someone tries to package the library.
- name: Install
run: cmake --install build --prefix "${GITHUB_WORKSPACE}/install"
- name: Show installed layout
run: find "${GITHUB_WORKSPACE}/install" -type f -o -type l
74 changes: 67 additions & 7 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,39 @@ on: [push]

jobs:

linux-swift:
name: Linux
# The toolchain floor is 6.2, not the 6.0.2 this used to pin:
# PureSwift/Bluetooth 8.1.0 declares swift-tools-version:6.2, so an
# older toolchain cannot parse the dependency's manifest and fails
# during resolution, before anything is compiled.
linux:
name: Linux (${{ matrix.container }}, ${{ matrix.config }})
strategy:
# One failing cell shouldn't hide the others' results — which
# toolchain/configuration combinations fail is the whole point
# of running a matrix.
fail-fast: false
matrix:
container: ["swift:6.2.3", "swift:6.3.3"]
config: ["debug", "release"]
runs-on: ubuntu-latest
container: swift:6.0.2-jammy
container: ${{ matrix.container }}-jammy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}

# Coverage runs once rather than per matrix cell: the report is a
# property of the source, not of the toolchain, and one upload keeps
# the artifact names unambiguous.
coverage:
name: Coverage
runs-on: ubuntu-latest
container: swift:6.3.3-jammy
permissions:
contents: read
code-quality: write # required by actions/upload-code-coverage
Expand All @@ -16,10 +45,6 @@ jobs:
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build (Debug)
run: swift build -c debug
- name: Build (Release)
run: swift build -c release
- name: Test (Debug)
run: swift test --configuration debug --enable-code-coverage
- name: Archive Build artifacts
Expand Down Expand Up @@ -48,3 +73,38 @@ jobs:
name: code-coverage
path: .build/coverage/
if-no-files-found: error

# The C ABI targets are excluded from the package unless
# SWIFTPM_BLUETOOTH_CABI=1, so none of the jobs above compile a line
# of them — this is the only SwiftPM coverage the drop-in library
# gets.
#
# 6.3 only, unlike the matrix above: the boundary functions are bound
# to the vendored declarations with `@c`, which 6.2 rejects as an
# unknown attribute.
c-abi:
name: C ABI (${{ matrix.config }})
strategy:
fail-fast: false
matrix:
config: ["debug", "release"]
runs-on: ubuntu-latest
container: swift:6.3.3-jammy
env:
SWIFTPM_BLUETOOTH_CABI: "1"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}
# The differential drivers are C programs linked twice, once
# against the reference library and once against ours, so both a
# C compiler and the real libbluetooth.so.3 have to be present.
- name: Install conformance prerequisites
run: apt-get update && apt-get install -y gcc libbluetooth3
- name: Differential conformance
run: Conformance/compare.sh "$(swift build -c ${{ matrix.config }} --show-bin-path)/libBluetoothLinuxABI.so"
Loading
Loading