- Notifications
You must be signed in to change notification settings - Fork5
chore: use slim binary over dylib#210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ethanndickson commentedJul 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
7ef8131 to8f00c6aCompare547fd97 to6687411Compare8f00c6a to479576aCompare| onCancel:{ | ||
| self.logger.debug("async stream canceled") | ||
| self.dispatch.close() | ||
| self.dispatch.close(flags:[.stop]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This causes any currently runningdispatch.read calls to supply their callback with an error which lets us actually end the read loop and cause the manager and all of it's children to be deallocated, including pipe file descriptors.
Previously we would leak pipes, but it didn't matter because the process would die each time.
| privatestaticfunc validateInfo(infoPlist:[String:AnyObject], expectedVersion:String)throws(ValidationError){ | ||
| guardlet plistIdent=infoPlist[infoIdentifierKey]as?String, plistIdent== expectedIdentifierelse{ | ||
| throw.invalidIdentifier(identifier:infoPlist[infoIdentifierKey]as?String) | ||
| } | ||
| guardlet plistName=infoPlist[infoNameKey]as?String, plistName== expectedNameelse{ | ||
| throw.invalidIdentifier(identifier:infoPlist[infoNameKey]as?String) | ||
| } | ||
| // Downloaded dylib must match the version of the server | ||
| guardlet dylibVersion=infoPlist[infoShortVersionKey]as?String, | ||
| expectedVersion== dylibVersion | ||
| else{ | ||
| throw.invalidVersion(version:infoPlist[infoShortVersionKey]as?String) | ||
| } | ||
| // Downloaded dylib must be at least the minimum Coder server version | ||
| guardlet dylibVersion=infoPlist[infoShortVersionKey]as?String, | ||
| // x.compare(y) is .orderedDescending if x > y | ||
| minimumCoderVersion.compare(dylibVersion, options:.numeric)!=.orderedDescending | ||
| else{ | ||
| throw.belowMinimumCoderVersion | ||
| } | ||
| } |
ethanndicksonJul 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Unfortunate, but because we don't build the slim binary with an external linker (previously xcode via cgo for the dylib) we can no longer create an info.plist section in the binary with-sectcreate. If we ever need to build the slim binary with cgo then we can add this back.
ethanndicksonJul 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've added another PR to check the version by exec'ing.
6687411 toef370dbCompare479576a toe9e15dbComparee9e15db toc7602c2Compareef370db to55319f4Comparec7602c2 tof008801Compare8670f11 tobe347a8Comparef008801 to847006fComparebe347a8 toe6a3578Compare847006f tod9255bcComparee6a3578 toa1864f6Compared9255bc to4f29ff3Comparea1864f6 to8b4c8cdCompare4f29ff3 to5840bceCompare8b4c8cd to78fd6c0Compare5840bce to3f7f6b6CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
3f7f6b6 to42b8f0bComparea5d5337 toc450bd4Compare42b8f0b tob716554Compareb716554 to02b3369CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR replaces the dylib-based tunnel implementation with a slim binary approach for the VPN functionality. It removes dylib-specific code and signature validation, introducingTunnelDaemon as a new abstraction that spawns and manages a binary process.
- Replaces
TunnelHandlewithTunnelDaemonthat usesposix_spawnto run a slim binary - Updates download and validation logic to work with binaries instead of dylibs
- Removes dylib-specific signature validation and quarantine removal processes
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/update-cask.sh | Updates cleanup paths to include new binary locations |
| Coder-Desktop/project.yml | Removes bridging header reference for dylib integration |
| Coder-Desktop/VPNLibTests/TunnelDaemonTests.swift | Adds comprehensive tests for the new TunnelDaemon functionality |
| Coder-Desktop/VPNLib/XPC.swift | Updates progress descriptions from "library" to "binary" |
| Coder-Desktop/VPNLib/Validate.swift | Simplifies validation by removing dylib-specific checks |
| Coder-Desktop/VPNLib/TunnelDaemon.swift | New implementation for managing tunnel binary process |
| Coder-Desktop/VPNLib/System.swift | Adds system utilities for process spawning and monitoring |
| Coder-Desktop/Coder-DesktopHelper/TunnelHandle.swift | Removes old dylib-based tunnel implementation |
| Coder-Desktop/Coder-DesktopHelper/Manager.swift | Major refactor to use TunnelDaemon instead of TunnelHandle |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
02b3369 toa4bbf6bComparec450bd4 to557e4feCompareethanndickson commentedAug 6, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Merge activity
|
a4bbf6b to3267a06Compare8c08563 intomainUh oh!
There was an error while loading.Please reload this page.
This requirement is introduced by#210, as the `vpn-daemon` command on the macOS CLI isn't present on prior versions.(2.24.3 isn't out yet, but when it does come out, it'll be compatible. 2.25 is out, and it's compatible)

Uh oh!
There was an error while loading.Please reload this page.
Closes#201.
This PR:
TunnelHandlewithTunnelDaemon, an abstraction which runsposix_spawnon the slim binary, and manages the spawned process.TunnelDaemon.In a future PR: