Skip to content

chore: support building Coder Desktop .dylib #15512

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 20, 2024
Merged

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Nov 14, 2024

Relates to #14734.

  • Adds make/coder-dylib to build the Coder Desktop .dylib for both amd64 and arm64.

  • Adds a build-dylib CI job that builds the dylibs on a macOS runner, signs them, uploads them and the header file as a build artifact, and then downloads them and inserts them into the fat binary build during the regular build CI job (which uses an ubuntu runner).

  • Makes the dylibs and the accompanying header file available for download from /bin on a Coder deployment.

  • Adds a build-dylib to release.yaml. release now downloads and embeds these dylibs in it's builds.

  • Minor fixes to get release dry-runs working again.

$ codesign -dvv coder-vpn-darwin-amd64.dylib
[...]
Identifier=com.coder.vpn
Authority=Developer ID Application: Coder Technologies Inc (4399GN35BJ)

/bin:

coder-darwin-amd64
coder-darwin-arm64
coder-vpn-darwin-amd64.dylib
coder-vpn-darwin-arm64.dylib
coder-vpn-darwin-dylib.h
coder-linux-amd64
coder-linux-arm64
coder-linux-armv7
coder-windows-amd64.exe
coder-windows-arm64.exe

Latest passing ci run: https://github.com/coder/coder/actions/runs/11885370889/
build-dylib artifact: https://github.com/coder/coder/actions/runs/11885370889/artifacts/2199477618
Full build artifact: https://github.com/coder/coder/actions/runs/11885370889/artifacts/2199489548

Latest passing release dry-run: https://github.com/coder/coder/actions/runs/11885373782
release build artifact: https://github.com/coder/coder/actions/runs/11885373782/artifacts/2199494843

The C interface for the dylib is currently just:
int OpenTunnel(cReadFD int, cWriteFD int)

Copy link
Member Author

ethanndickson commented Nov 14, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@deansheather
Copy link
Member

Can we call the artifacts codervpn-darwin-arch.ext instead?

@ethanndickson
Copy link
Member Author

ethanndickson commented Nov 15, 2024

Yeah the naming is kinda tricky, how does coder-{desktop|vpn}-darwin-arch.ext sound? We have a bunch of code for embedding the binaries (hashing, tarring) that relies on the files starting with coder-, and I don't really want to touch that needlessly.

Also, the darwin part is kinda implicit, given that we're only exporting a dylib. I guess if we ever added a linux .so, it might use a different header file?

@deansheather
Copy link
Member

We have a bunch of code for embedding the binaries (hashing, tarring) that relies on the files starting with coder-

Yeah OK that sounds good to me then.

Also, the darwin part is kinda implicit, given that we're only exporting a dylib

I'd rather keep the standard anyways. The windows binaries can easily be told apart too because of the .exe but we don't drop windows from the name.

@ethanndickson ethanndickson marked this pull request as ready for review November 18, 2024 04:26
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit inline. LGTM

@ethanndickson ethanndickson merged commit 32fc844 into main Nov 20, 2024
31 checks passed
@ethanndickson ethanndickson deleted the ethan/build-dylib branch November 20, 2024 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants