Repository navigation
Linux: twcore release builds, Linux CI, NIC list skips unplugged interfaces and ranks physical first - #170
Merged
Conversation
Contributor
Author
|
Release rehearsal (workflow_dispatch on this branch, nothing published): https://github.com/ThinkWatchProject/ThinkWatch-Core/actions/runs/35974388792 — all four jobs green. Both Linux binaries: |
fylorn
force-pushed
the
linux/release-nics
branch
from
September 24, 2026 10:24
d017fb8 to
7f96204
Compare
…s unplugged and virtual-first interfaces
- release.yml: build twcore natively for x86_64-unknown-linux-gnu
(ubuntu-22.04) and aarch64-unknown-linux-gnu (ubuntu-22.04-arm); check the
architecture with `file`, the version against the tag, and fail if the
binary needs a glibc newer than 2.35. Same asset and .sha256 naming as the
other platforms. glibc, not musl: the desktop app needs glibc 2.35 anyway.
- ci.yml: an ubuntu-22.04 job running clippy, the workspace tests and the
smoke script. smoke.sh now asks GNU stat first (BSD `stat -f` means
something else on GNU and still exits 0) and honours CARGO_TARGET_DIR.
- nics: list only interfaces that are up *and* running (IFF_RUNNING), so an
unplugged NIC or an idle docker0/br-* no longer shows up; on Linux,
interfaces backed by a device (/sys/class/net/<name>/device) sort before
virtual ones. exists() is unchanged.
- A bound interface that is present but unusable now reports
gw.listen.nic_offline ("is not connected right now") instead of
gw.listen.nic_no_addr: a disconnected interface often still has an
address.
- lockfile test no longer assumes pid 999999 cannot exist (Linux pid_max is
4194304 under systemd); the --parent watcher comment covers
systemd --user as the subreaper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its handler writes the headers and the body in two small sends; with Nagle the body waits for the ACK of the headers, and Linux delays that ACK by 40ms on a pooled connection, so every request through the gateway looked 40ms slower on the Linux runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn
force-pushed
the
linux/release-nics
branch
from
September 24, 2026 10:33
7f96204 to
449fcf0
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of Linux support for ThinkWatch Lite.
Release (
release.yml)twcore-linuxmatrix:x86_64-unknown-linux-gnuonubuntu-22.04,aarch64-unknown-linux-gnuonubuntu-22.04-arm(both native; the arm64 runner label is listed for public repos in GitHub's hosted-runner reference).filemust show the right architecture,--versionmust match the tag, and the highestGLIBC_x.ysymbol version fromobjdump -Tmust be ≤ 2.35 (Ubuntu 22.04, the desktop app's floor). Guards against a runner image bump silently raising the glibc requirement.twcore-<triple>+twcore-<triple>.sha256(<sha> <name>), same as the other platforms.CI (
ci.yml)linuxjob onubuntu-22.04: clippy,cargo test --workspace, andscripts/smoke.sh.smoke.sh: ask GNUstat -cfirst; BSDstat -f '%Lp'means "filesystem status" on GNU and still exits 0, so the old fallback order never fell back. HonoursCARGO_TARGET_DIR.NICs (
tw-config/src/nics.rs)list()now requiresIFF_UP | IFF_RUNNING: an unplugged NIC, a disconnected Wi-Fi, or an idledocker0/br-*(up, has an address, no carrier) no longer appears. getifaddrs on glibc and macOS copies the link's flags onto each address entry, so the per-address check is a per-interface check./sys/class/net/<name>/deviceexists. Virtual ones (docker0,br-*,veth*,virbr*,tailscale0,wg*,tun*) are still listed, after physical ones; loopback stays last. macOS and Windows treat every interface as physical, so their order is unchanged (verified on a Mac:list()/by_name()output identical before/after).exists()is unchanged.gw.listen.nic_no_addr→gw.listen.nic_offline("Interface {name} is not connected right now. Check the cable or the Wi-Fi connection."). A disconnected interface often still has an address, so "has no address" became wrong onceIFF_RUNNINGfilters it.BindError::NicHasNoAddr→BindError::NicOffline. Lite needs the translation for the new code.Other
cfg(unix)audit (outsidetw-adopt)lockfiletest used pid 999999 as "cannot exist"; Linuxpid_maxis 4194304 under systemd, so it now spawns and reaps a child and uses that pid.--parentwatcher: already compares the original pid viakill(pid, 0), nevergetppid(), so reparenting tosystemd --user(a subreaper, not pid 1) is fine; comment updated to say so.private_dir,store/history/blobs/dbmodes, control socket,SUN_PATH_MAX= min(104, 108), SIGTERM,HOME) holds on Linux as written.🤖 Generated with Claude Code