Skip to content
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
6 changes: 3 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TetherKit code formatting configuration.
# Tethernet code formatting configuration.
# Google style as the baseline, with line width relaxed to 100 columns to fit
# protocol constant tables and long type names.
---
Expand All @@ -12,7 +12,7 @@ TabWidth: 2
UseTab: Never
AccessModifierOffset: -1

# Pointer/reference hugs the type: TetherKit writes `Foo* p`, not `Foo *p`
# Pointer/reference hugs the type: Tethernet writes `Foo* p`, not `Foo *p`
DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Left
Expand All @@ -34,7 +34,7 @@ PackConstructorInitializers: NextLine
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"tetherkit/'
- Regex: '^"tethernet/'
Priority: 1
- Regex: '^<(doctest|libusb)'
Priority: 2
Expand Down
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TetherKit static analysis configuration.
# Tethernet static analysis configuration.
#
# Trade-offs:
# * This project is a low-level driver dealing with kernel ABIs and USB wire
Expand Down Expand Up @@ -53,7 +53,7 @@ Checks: >
-readability-uppercase-literal-suffix

WarningsAsErrors: ''
HeaderFilterRegex: 'tetherkit/.*'
HeaderFilterRegex: 'tethernet/.*'
FormatStyle: file

CheckOptions:
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# That is expected: Dependabot cannot approve its own PR. You bypass it
# the same way you bypass your own PRs, because the "Require review"
# ruleset lists the admin role as a bypass actor:
# gh api repos/justsrc/TetherKit/pulls/<PR>/merge -X PUT -f merge_method=merge
# gh api repos/justsrc/Tethernet/pulls/<PR>/merge -X PUT -f merge_method=merge
# The REST endpoint makes the mechanism explicit. `gh pr merge` refuses
# at its own pre-flight when the PR is BLOCKED (cli/cli#13388, still
# open) and suggests --auto or --admin; --admin only suppresses that
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
name: Bench

on:
# No inputs: tetherkit_bench never reads argv (benchmarks/ has no argv or
# No inputs: tethernet_bench never reads argv (benchmarks/ has no argv or
# argc use), so the old args input was dead plumbing.
workflow_dispatch:

Expand All @@ -32,22 +32,22 @@ jobs:
run: brew install libusb

# Sanitizers crush throughput; benchmarks must build Release with none of
# the TETHERKIT_ENABLE_*SAN options (the cmake/Sanitizers.cmake contract;
# the TETHERNET_ENABLE_*SAN options (the cmake/Sanitizers.cmake contract;
# all default off, so not passing them is already correct).
- name: Configure & Build
run: |
cmake -S . -B build-rel -DCMAKE_BUILD_TYPE=Release
cmake --build build-rel --target tetherkit_bench -j"$(sysctl -n hw.ncpu)"
cmake --build build-rel --target tethernet_bench -j"$(sysctl -n hw.ncpu)"

- name: Run
# pipefail: keep tee from swallowing the benchmark's exit code.
run: |
set -o pipefail
./build-rel/bin/tetherkit_bench | tee bench-report.md
./build-rel/bin/tethernet_bench | tee bench-report.md

- name: Upload the bench report
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: tetherkit-bench-${{ github.run_number }}
name: tethernet-bench-${{ github.run_number }}
path: bench-report.md
retention-days: 14
36 changes: 18 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build: a manually triggered full build with artifact upload.
#
# Dispatch-only full build: C++ (warnings as errors) + the libtetherkit shared
# Dispatch-only full build: C++ (warnings as errors) + the libtethernet shared
# library + GUI packaging. Artifacts are uploaded for each run.

name: Build
Expand Down Expand Up @@ -81,54 +81,54 @@ jobs:
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE="${DISPATCHED_BUILD_TYPE}" \
-DTETHERKIT_WARNINGS_AS_ERRORS=ON
-DTETHERNET_WARNINGS_AS_ERRORS=ON

- name: Build
run: cmake --build build -j"$(sysctl -n hw.ncpu)"

# Basic tetherkit-cli smoke checks; --list only enumerates devices and
# Basic tethernet-cli smoke checks; --list only enumerates devices and
# state, no root needed.
- name: Smoke test (--list needs no root)
run: |
./build/bin/tetherkit-cli --version
./build/bin/tetherkit-cli --list
./build/bin/tethernet-cli --version
./build/bin/tethernet-cli --list

- name: Assemble TetherKit.app
- name: Assemble Tethernet.app
run: cmake --build build --target gui

- name: Self-checks
run: |
codesign --verify --deep --strict dist/TetherKit.app
codesign --verify --deep --strict dist/Tethernet.app
# The non-root path of --install must fail loudly instead of
# half-installing.
payload="dist/TetherKit.app/Contents/Library/HelperTools"
if "${payload}/com.tetherkit.helper" --install; then
payload="dist/Tethernet.app/Contents/Library/HelperTools"
if "${payload}/com.tethernet.helper" --install; then
echo "::error::helper --install unexpectedly succeeded without root"
exit 1
fi
# The Finder-alias install mode always exits 0 (result on stdout).
./dist/TetherKit.app/Contents/MacOS/TetherKit --install-finder-alias
./dist/Tethernet.app/Contents/MacOS/Tethernet --install-finder-alias

- name: Package TetherKit.app
- name: Package Tethernet.app
run: |
# ditto preserves the bundle structure and extended attributes; it is
# the standard way to package a .app.
name="TetherKit-${GITHUB_RUN_NUMBER}-${DISPATCHED_OS}-${DISPATCHED_BUILD_TYPE}.zip"
ditto -c -k --keepParent dist/TetherKit.app "$name"
name="Tethernet-${GITHUB_RUN_NUMBER}-${DISPATCHED_OS}-${DISPATCHED_BUILD_TYPE}.zip"
ditto -c -k --keepParent dist/Tethernet.app "$name"

# upload-artifact v7 supports single-file direct upload (archive: false):
# the downloaded artifact IS the ditto zip above, not a zip inside another
# zip. With archive: false the name input is ignored (the file name wins).
- name: Upload TetherKit.app artifact
- name: Upload Tethernet.app artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
path: TetherKit-${{ github.run_number }}-${{ env.DISPATCHED_OS }}-${{ env.DISPATCHED_BUILD_TYPE }}.zip
path: Tethernet-${{ github.run_number }}-${{ env.DISPATCHED_OS }}-${{ env.DISPATCHED_BUILD_TYPE }}.zip
archive: false
retention-days: 14

- name: Upload libtetherkit shared-library artifact
- name: Upload libtethernet shared-library artifact
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: tetherkit-libs-${{ github.run_number }}-${{ env.DISPATCHED_OS }}-${{ env.DISPATCHED_BUILD_TYPE }}
path: build/lib/libtetherkit*.dylib
name: tethernet-libs-${{ github.run_number }}-${{ env.DISPATCHED_OS }}-${{ env.DISPATCHED_BUILD_TYPE }}
path: build/lib/libtethernet*.dylib
retention-days: 14
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# The review requirement on the bot PR is bypassed BY YOU, the same way it
# is for your own PRs: the "Require review" ruleset lists the admin role as
# a bypass actor with bypass_mode pull_request, so
# gh api repos/justsrc/TetherKit/pulls/<PR>/merge -X PUT -f merge_method=merge
# gh api repos/justsrc/Tethernet/pulls/<PR>/merge -X PUT -f merge_method=merge
# engages the bypass. (`gh pr merge` refuses at its own pre-flight when
# mergeStateStatus is BLOCKED; that is cli/cli#13388, still open. The REST
# endpoint does the right thing.) Do NOT add Dependabot to the bypass list:
Expand Down Expand Up @@ -109,8 +109,8 @@ jobs:
#
# So the build decides the analysis set, and this project already
# has the switch: doctest is an INTERFACE library linked only into
# tetherkit_tests (tests/CMakeLists.txt), so with
# TETHERKIT_BUILD_TESTS=OFF no test TU is compiled, doctest.h is
# tethernet_tests (tests/CMakeLists.txt), so with
# TETHERNET_BUILD_TESTS=OFF no test TU is compiled, doctest.h is
# never parsed, and third_party/doctest never reaches the database.
#
# That retires cpp/use-after-free at third_party/doctest/doctest.h:3710
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DTETHERKIT_BUILD_TESTS=OFF
-DTETHERNET_BUILD_TESTS=OFF
cmake --build build -j"$(sysctl -n hw.ncpu)"

# The upload is skipped for a commit authored by Dependabot.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,6 @@ jobs:
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: always()
with:
name: tetherkit-tidy-log
name: tethernet-tidy-log
path: tidy.log
retention-days: 14
27 changes: 14 additions & 13 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Pre-release: pushing a pre-release v* tag issues a pre-release
# automatically.
#
# git tag -a v0.2.0-rc.1 -m "TetherKit 0.2.0 rc 1" && git push origin v0.2.0-rc.1
# git tag -a v0.2.0-rc.1 -m "Tethernet 0.2.0 rc 1" && git push origin v0.2.0-rc.1
#
# Cut rc tags only from current main: tag-filtered workflows are resolved
# from the TAGGED commit, not from main, so an rc tag on a commit older
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# Same check as release.yml: the tag and CMakeLists' VERSION must
# agree, otherwise `tetherkit-cli --version` will not match the
# agree, otherwise `tethernet-cli --version` will not match the
# release. A pre-release tag carries a suffix (v0.2.0-rc.1) that
# CMake's project() VERSION cannot hold (components are numeric
# only), so the comparison uses the base version: everything before
Expand All @@ -77,7 +77,7 @@ jobs:
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DTETHERKIT_WARNINGS_AS_ERRORS=ON
-DTETHERNET_WARNINGS_AS_ERRORS=ON
cmake --build build -j"$(sysctl -n hw.ncpu)"
ctest --test-dir build --output-on-failure

Expand All @@ -87,20 +87,21 @@ jobs:
- name: Package the command-line binary
id: pkg
run: |
name="tetherkit-cli-${GITHUB_REF_NAME}-macos-arm64.tar.gz"
tar -C build/bin -czf "$name" tetherkit-cli
name="tethernet-cli-${GITHUB_REF_NAME}-macos-arm64.tar.gz"
cp THIRD_PARTY_NOTICES.md build/bin/
tar -C build/bin -czf "$name" tethernet-cli THIRD_PARTY_NOTICES.md
{
echo "name=${name}"
echo "sha256=$(shasum -a 256 "$name" | awk '{print $1}')"
} >> "$GITHUB_OUTPUT"

- name: Package TetherKit.app
- name: Package Tethernet.app
id: app
run: |
name="TetherKit-${GITHUB_REF_NAME}-macos-arm64.zip"
name="Tethernet-${GITHUB_REF_NAME}-macos-arm64.zip"
# ditto preserves the bundle structure and extended attributes; it is
# the standard way to package a .app.
ditto -c -k --keepParent dist/TetherKit.app "$name"
ditto -c -k --keepParent dist/Tethernet.app "$name"
{
echo "name=${name}"
echo "sha256=$(shasum -a 256 "$name" | awk '{print $1}')"
Expand Down Expand Up @@ -160,15 +161,15 @@ jobs:
built artifacts do not carry the flag):

```bash
xattr -d com.apple.quarantine tetherkit-cli # CLI
xattr -dr com.apple.quarantine TetherKit.app # GUI (recursive)
xattr -d com.apple.quarantine tethernet-cli # CLI
xattr -dr com.apple.quarantine Tethernet.app # GUI (recursive)
```

## Command line

```bash
tetherkit-cli --list # list recognized devices, no root needed
sudo tetherkit-cli # start the driver, needs root
tethernet-cli --list # list recognized devices, no root needed
sudo tethernet-cli # start the driver, needs root
```

## Requirements
Expand Down Expand Up @@ -200,7 +201,7 @@ jobs:
APP_NAME: ${{ steps.app.outputs.name }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--title "TetherKit ${GITHUB_REF_NAME}" \
--title "Tethernet ${GITHUB_REF_NAME}" \
--prerelease \
--notes-file notes.md \
--generate-notes \
Expand Down
41 changes: 18 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release: pushing a stable v* tag issues a release automatically.
#
# git tag -a v0.2.0 -m "TetherKit 0.2.0" && git push origin v0.2.0
# git tag -a v0.2.0 -m "Tethernet 0.2.0" && git push origin v0.2.0
#
# Pre-release tags (a hyphen marks the semver pre-release part, e.g.
# v0.2.0-rc.1) are excluded below and handled by pre-release.yml, which
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# The tag and CMakeLists' VERSION must agree, otherwise
# `tetherkit-cli --version` will not match the version on the Release /
# `tethernet-cli --version` will not match the version on the Release /
# Homebrew. Catch that before the release.
- name: Verify the tag matches the CMakeLists VERSION
run: |
Expand All @@ -56,7 +56,7 @@ jobs:
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DTETHERKIT_WARNINGS_AS_ERRORS=ON
-DTETHERNET_WARNINGS_AS_ERRORS=ON
cmake --build build -j"$(sysctl -n hw.ncpu)"
ctest --test-dir build --output-on-failure

Expand All @@ -66,20 +66,21 @@ jobs:
- name: Package the command-line binary
id: pkg
run: |
name="tetherkit-cli-${GITHUB_REF_NAME}-macos-arm64.tar.gz"
tar -C build/bin -czf "$name" tetherkit-cli
name="tethernet-cli-${GITHUB_REF_NAME}-macos-arm64.tar.gz"
cp THIRD_PARTY_NOTICES.md build/bin/
tar -C build/bin -czf "$name" tethernet-cli THIRD_PARTY_NOTICES.md
{
echo "name=${name}"
echo "sha256=$(shasum -a 256 "$name" | awk '{print $1}')"
} >> "$GITHUB_OUTPUT"

- name: Package TetherKit.app
- name: Package Tethernet.app
id: app
run: |
name="TetherKit-${GITHUB_REF_NAME}-macos-arm64.zip"
name="Tethernet-${GITHUB_REF_NAME}-macos-arm64.zip"
# ditto preserves the bundle structure and extended attributes; it is
# the standard way to package a .app.
ditto -c -k --keepParent dist/TetherKit.app "$name"
ditto -c -k --keepParent dist/Tethernet.app "$name"
{
echo "name=${name}"
echo "sha256=$(shasum -a 256 "$name" | awk '{print $1}')"
Expand Down Expand Up @@ -120,26 +121,20 @@ jobs:
Homebrew is recommended (built from source, no Gatekeeper prompt):

```bash
brew install justsrc/tap/tetherkit # GUI, TetherKit.app
brew install justsrc/tap/tetherkit-cli # command-line tool
brew install justsrc/tap/tethernet # GUI, Tethernet.app
brew install justsrc/tap/tethernet-cli # command-line tool
```

After installing the GUI, `open "$(brew --prefix)/opt/tetherkit/TetherKit.app"`.
After installing the GUI, `open "$(brew --prefix)/opt/tethernet/Tethernet.app"`.
On first run, click "Install privileged components" and enter the
admin password once; the first launch also creates the Finder alias
automatically, after which TetherKit turns up in Spotlight.

> Note for users of older versions: starting with this release the
> formula name `tetherkit` belongs to the GUI, and the CLI is renamed
> `tetherkit-cli` (the binary carries that name too). If you
> previously installed the CLI, run
> `brew uninstall tetherkit && brew install tetherkit-cli`.
automatically, after which Tethernet turns up in Spotlight.

## Command line

```bash
tetherkit-cli --list # list recognized devices, no root needed
sudo tetherkit-cli # start the driver, needs root
tethernet-cli --list # list recognized devices, no root needed
sudo tethernet-cli # start the driver, needs root
```

## Requirements
Expand All @@ -154,8 +149,8 @@ jobs:
browser download. Remove the quarantine manually to run them:

```bash
xattr -d com.apple.quarantine tetherkit-cli # CLI
xattr -dr com.apple.quarantine TetherKit.app # GUI (recursive)
xattr -d com.apple.quarantine tethernet-cli # CLI
xattr -dr com.apple.quarantine Tethernet.app # GUI (recursive)
```

If that bothers you, use the Homebrew route above or build from
Expand All @@ -179,7 +174,7 @@ jobs:
APP_NAME: ${{ steps.app.outputs.name }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--title "TetherKit ${GITHUB_REF_NAME}" \
--title "Tethernet ${GITHUB_REF_NAME}" \
--notes-file notes.md \
--generate-notes \
--verify-tag \
Expand Down
Loading
Loading