NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.29k stars 14.27k forks source link

Build failure: zed-editor #320084

Open tqwewe opened 5 months ago

tqwewe commented 5 months ago

Steps To Reproduce

Zed-editor fails to build for MaxOS Intel using NIXPKGS_ALLOW_BROKEN=1 nix-shell -p zed-editor -I nixpkgs=channel:nixos-unstable

Build log

  ...
  cargo:rerun-if-changed=/nix/store/xz8j1amvgwas4nbfqgpmcz147pkd391s-apple-framework-VideoToolbox/Library/Frameworks/VideoToolbox.framework/Headers/VTBase.h
  cargo:rerun-if-changed=/nix/store/wahwaqbn6f57ybai7akc5920vrln9s2j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h
  cargo:rerun-if-changed=/nix/store/xz8j1amvgwas4nbfqgpmcz147pkd391s-apple-framework-VideoToolbox/Library/Frameworks/VideoToolbox.framework/Headers/VTErrors.h

  --- stderr
  thread 'main' panicked at /private/tmp/nix-build-zed-0.137.6.drv-0/cargo-vendor-dir/bindgen-0.65.1/ir/ty.rs:1074:22:
  Not able to resolve array element?: Continue
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: builder for '/nix/store/dv6kd8ljw54aw4j728cy97mqg0jxlv6y-zed-0.137.6.drv' failed with exit code 101;
       last 10 log lines:
       >   cargo:rerun-if-changed=/nix/store/a5swqw43q2yahpawgwbrsgildzqni5n1-apple-framework-CoreMedia/Library/Frameworks/CoreMedia.framework/Headers/CMBase.h
       >   cargo:rerun-if-changed=/nix/store/xz8j1amvgwas4nbfqgpmcz147pkd391s-apple-framework-VideoToolbox/Library/Frameworks/VideoToolbox.framework/Headers/VTBase.h
       >   cargo:rerun-if-changed=/nix/store/wahwaqbn6f57ybai7akc5920vrln9s2j-apple-framework-CoreFoundation/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h
       >   cargo:rerun-if-changed=/nix/store/xz8j1amvgwas4nbfqgpmcz147pkd391s-apple-framework-VideoToolbox/Library/Frameworks/VideoToolbox.framework/Headers/VTErrors.h
       >
       >   --- stderr
       >   thread 'main' panicked at /private/tmp/nix-build-zed-0.137.6.drv-0/cargo-vendor-dir/bindgen-0.65.1/ir/ty.rs:1074:22:
       >   Not able to resolve array element?: Continue
       >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       > warning: build failed, waiting for other jobs to finish...
       For full logs, run 'nix log /nix/store/dv6kd8ljw54aw4j728cy97mqg0jxlv6y-zed-0.137.6.drv'.

Additional context

Add any other context about the problem here.

Notify maintainers

@GaetanLepage

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 23.5.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.2`
 - channels(ari): `"darwin"`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a :+1: reaction to issues you find important.

matteo-pacini commented 5 months ago

More about the build error here: https://github.com/NixOS/nixpkgs/pull/303233#issuecomment-2048650618

The Swift package is in crates/live_kit_client/LiveKitBridge - perhaps removing xcrun and adding swift swiftpm to the build inputs may fix this. Another possibility is to integrate swiftpm2nix.

GaetanLepage commented 5 months ago

More information regarding darwin: https://github.com/NixOS/nixpkgs/pull/317564#pullrequestreview-2144857712

niklaskorz commented 5 months ago

Building the Swift package will soon become unnecessary, as mentioned in my comment referenced by Gaétan. Unfortunately we'll have to wait for https://github.com/NixOS/nixpkgs/pull/229210 as Livekit depends on ScreenCaptureKit on macOS.

jvmncs commented 4 months ago

Looks like https://github.com/NixOS/nixpkgs/pull/326406 merged early support for apple_sdks 12.3 -- would that resolve the blocker you mentioned @niklaskorz?

niklaskorz commented 4 months ago

Looks like #326406 merged early support for apple_sdks 12.3 -- would that resolve the blocker you mentioned @niklaskorz?

Draft PR is available at #329653 but is blocked until https://github.com/zed-industries/zed/pull/13343 is merged and released. As the draft is based on that PR branch, it however already builds and runs:

$ nix build "github:nixos/nixpkgs?ref=pull/329653/head#zed-editor"
$ result/bin/zed
grafik

Edit: now correctly produces an app bundle, and the CLI also works now

niklaskorz commented 1 month ago

329653 is now ready for review, fixing the latest Zed release on macOS. Livekit (and thus collaboration features) remains disabled on both macOS and Linux until https://github.com/zed-industries/zed/pull/13343 is released.