-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
zed-editor: shrink darwin closure #369399
Conversation
b3fd239
to
ccec85a
Compare
The Edit: did that and moved |
ccec85a
to
e611476
Compare
FWIW, no Mild preference to omit (a) in favour of waiting for #369094 to make its way through the cycle. |
The remaining apple-sdk runtime dependency is caused by perl (which is needed by git). So that'd be the topic for a separate staging PR, as perl afaik is a transitive build dependency of almost all packages. As for the strip debug list, I'll make sure to remove it again once the strip hook change has made its way into master. :) |
|
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.
LGTM
e611476
to
210c4c2
Compare
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.
LGTM !
|
Zed-editor's closure currently depends on three versions of apple-sdk, at least two of which are not needed at runtime.
These are determined as dependencies because (a) Zed's own binary references headers from
apple-sdk_15
because of #367169 and (b) because we includeargs.gn
andwebrtc.ninja
, which referenceapple-sdk_14
, in the output of livekit-libwebrtc.We fix (a) by adding the app directory to
stripDebugList
in the zed-editor derivation.We fix (b) by splitting livekit-libwebrtc into
out
anddev
outputs, whereout
contains the libraries anddev
contains everything else (headers and other artifacts required by the livekit Rust crate at build-time).As livekit's webrtc crate expects both libraries and build-time artifacts to be in the same directory, we symlink them usingpkgs.buildEnv
.Because the symlinks resolve to the split outputs, the
dev
output will not be considered a dependency of the final closure.For livekit-libwebrtc,
$out/lib
is symlinked into$dev/lib
, so it's easily found by the crate's build script but still resolves to the location in$out
.The solution to (b) might also shrink the closure of zed-editor on Linux, though I did not specifically check for it.
Furthermore, I removed the
WebRTC.framework
for Darwin from livekit-libwebrtc. We originally added it becauselibwebrtc.dylib
was missing symbols that were included inWebRTC.framework
.As both the framework's contained binary and
libwebrtc.dylib
are shared mach objects, it was possible to move the framework's binary in the dylib's stead.This also has the positive effect of not having any headers inside the
out
output, only indev
.Also, the linker command substitution in zed-editor now looks the same for Linux and Darwin as both link to dynamic libraries.
Diff of
nix-store -qR $(nix-build -A zed-editor)
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.