Skip to content
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: init at 0.129.1 #284010

Merged
merged 1 commit into from
Apr 8, 2024
Merged

zed-editor: init at 0.129.1 #284010

merged 1 commit into from
Apr 8, 2024

Conversation

GaetanLepage
Copy link
Contributor

@GaetanLepage GaetanLepage commented Jan 26, 2024

Description of changes

Add zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

wegank
wegank previously requested changes Jan 26, 2024
Copy link
Member

@wegank wegank left a comment

Choose a reason for hiding this comment

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

zed -> zed-editor in the commit message and the title.

@PaulGrandperrin
Copy link
Contributor

Hi,
I just tried building on nixos-23.11 and I get a build failure:

error: failed to run custom build command for `gpui v0.1.0 (/build/source/crates/gpui)`

Caused by:
  process didn't exit successfully: `/build/source/target/release/build/gpui-18ab4c5689d6bc1b/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-link-lib=framework=System
  cargo:rerun-if-changed=src/platform/mac/dispatch.h
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  src/platform/mac/dispatch.h:1:10: fatal error: 'dispatch/dispatch.h' file not found
  thread 'main' panicked at crates/gpui/build.rs:31:10:
  unable to generate bindings: ClangDiagnostic("src/platform/mac/dispatch.h:1:10: fatal error: 'dispatch/dispatch.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

@NickCao
Copy link
Member

NickCao commented Jan 26, 2024

Hi, I just tried building on nixos-23.11 and I get a build failure:

It only supports darwin, not linux, for now.

@PaulGrandperrin
Copy link
Contributor

Hi, I just tried building on nixos-23.11 and I get a build failure:

It only supports darwin, not linux, for now.

Oh 🥲
Yeah i didn't check upstream project..

@GaetanLepage
Copy link
Contributor Author

GaetanLepage commented Jan 26, 2024

Building fails when compiling the media crate (here on aarch64-darwin):

error: failed to run custom build command for `media v0.1.0 (/private/tmp/nix-build-zed-0.119.19.drv-0/source/crates/media)`

Caused by:
  process didn't exit successfully: `/private/tmp/nix-build-zed-0.119.19.drv-0/source/target/release/build/media-0b943f1fb28af98c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=src/bindings.h
  cargo:rerun-if-env-changed=TARGET
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_aarch64_apple_darwin
  cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS

  --- stderr
  src/bindings.h:1:9: fatal error: 'CoreMedia/CMFormatDescription.h' file not found
  thread 'main' panicked at crates/media/build.rs:33:10:
  unable to generate bindings: ClangDiagnostic("src/bindings.h:1:9: fatal error: 'CoreMedia/CMFormatDescription.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@wegank
Copy link
Member

wegank commented Jan 27, 2024

Probably add CoreMedia and try again?

@GaetanLepage
Copy link
Contributor Author

Probably add CoreMedia and try again?

Indeed that helped !

It now fails with:

cargo:rerun-if-changed=./src/platform/mac/shaders.metal

--- stderr
Failed to run rustfmt: cannot find binary path (non-fatal, continuing)
metal shader compilation failed:
/nix/store/c70whv4m822qpi47pfdrclx0q9i4dcnf-xcrun/bin/xcrun: line 42: exec: metal: not found

It looks like darwin.apple_dsk.frameworks.Metal does not provide the requested metal binary.

@GaetanLepage GaetanLepage changed the title zed-editor: init at 0.128.3 zed-editor: init at 0.129.1 Apr 3, 2024
@jansol
Copy link
Contributor

jansol commented Apr 3, 2024

@GaetanLepage did nix-update "helpfully" eat my suggested changes or did you just not get to applying them yet?

@GaetanLepage
Copy link
Contributor Author

@GaetanLepage did nix-update "helpfully" eat my suggested changes or did you just not get to applying them yet?

No, I just didn't have done it yet.

I did include both changes now (fontconfig + desktop file).
However it still does not build:

...
   Compiling activity_indicator v0.1.0 (/build/source/crates/activity_indicator)
   Compiling quick_action_bar v0.1.0 (/build/source/crates/quick_action_bar)
   Compiling welcome v0.1.0 (/build/source/crates/welcome)
    Finished release [optimized + debuginfo] target(s) in 5m 56s
     Running unittests src/main.rs (target/x86_64-unknown-linux-gnu/release/deps/Zed-9da96fb920105d52)

running 4 tests
error: test failed, to rerun pass `--bin Zed`

Caused by:
  process didn't exit successfully: `/build/source/target/x86_64-unknown-linux-gnu/release/deps/Zed-9da96fb920105d52 --test-threads=48 --skip=test_base_keymap --skip=test_bundled_settings_and_themes --skip=test_disabled_keymap_binding --skip=test_navigation --skip=test_new_empty_workspace --skip=test_open_and_save_new_file --skip=test_open_entry --skip=test_opening_excluded_paths --skip=test_open_paths --skip=test_open_paths_action --skip=test_pane_actions --skip=test_reopening_closed_items --skip=test_save_conflicting_item --skip=test_setting_language_when_saving_as_single_file_worktree --skip=test_window_edit_state` (signal: 11, SIGSEGV: invalid memory reference)

@jansol
Copy link
Contributor

jansol commented Apr 3, 2024

Looks like you grabbed the original version of the desktop item snippet, which hardcodes the full executable path and is missing the "inode/directory" mime type rather than the fixed version. Nevertheless, the build passes fine on my end:

$ nix build github:GaetanLepage/nixpkgs/zed#zed-editor
$ tree result
result
├── bin
│   ├── zed -> zed-stable
│   └── zed-stable
└── share
    ├── applications
    │   └── Zed.desktop
    └── icons
        └── hicolor
            ├── 1024x1024@2x
            │   └── apps
            │       └── Zed.png
            └── 512x512
                └── apps
                    └── Zed.png

@GaetanLepage
Copy link
Contributor Author

ooks like you grabbed the original version of the desktop item snippet, which hardcodes the full executable path and is missing the "inode/directory" mime type rather than the fixed version.

You are right ! Fixed.

@jansol
Copy link
Contributor

jansol commented Apr 4, 2024

Did you get the tests to pass on your side?

Tried with Nix on Ubuntu 24.04 now and it builds fine, but crashes on launch due to vulkan driver stuff (with both X11 and Wayland backends). Given that it works fine on NixOS I don't consider this a blocker though (assuming darwin is fine).

pkgs/by-name/ze/zed-editor/package.nix Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Show resolved Hide resolved
pkgs/by-name/ze/zed-editor/package.nix Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

Tried with Nix on Ubuntu 24.04 now and it builds fine, but crashes on launch due to vulkan driver stuff (with both X11 and Wayland backends). Given that it works fine on NixOS I don't consider this a blocker though (assuming darwin is fine).

This is a common problem, you probably can work around this with nixGL

@Titaniumtown
Copy link

Hey sorry for this newbie comment. I'm pretty new to nixos, how can I add this to my home manager flake? I spent an hour or so trying to figure it out and read a bunch online, can someone give some pointers? I want to try and test/use zed-editor on my machine.

@wyndon
Copy link
Contributor

wyndon commented Apr 8, 2024

Hey sorry for this newbie comment. I'm pretty new to nixos, how can I add this to my home manager flake? I spent an hour or so trying to figure it out and read a bunch online, can someone give some pointers? I want to try and test/use zed-editor on my machine.

If you just want to try it, you can run nix run github:NixOS/nixpkgs/pull/284010/head#zed-editor

If you want to add it to your configuration, add github:NixOS/nixpkgs/pull/284010/head as an input, make sure inputs are passed in extraSpecialArgs and add it to home.packages with inputs.INPUTNAME.legacyPackages.${pkgs.system}.zed-editor

@Titaniumtown
Copy link

@wyndon thank you so much! you're amazing <3

@SuperSandro2000 SuperSandro2000 merged commit c011096 into NixOS:master Apr 8, 2024
24 checks passed
@GaetanLepage GaetanLepage deleted the zed branch April 8, 2024 13:39
@GaetanLepage
Copy link
Contributor Author

Thanks @SuperSandro2000 for the review and merge :)
And thank you @jansol for all your help !

@LeonardAukea
Copy link

Screenshot 2024-04-09 at 10 07 05

Should this package not be visible at https://search.nixos.org/packages now that it has been merged to master?

@GaetanLepage
Copy link
Contributor Author

Should this package not be visible at https://search.nixos.org/packages now that it has been merged to master?

No, there is a delay between master and nixos-unstable. You can follow the progress of this PR here.

@bnjmnt4n
Copy link
Contributor

bnjmnt4n commented Apr 9, 2024

It typically takes some time to land from master to other channels; you can look at https://nixpk.gs/pr-tracker.html?pr=284010 to see if it's landed.

(😆 looks like we made the same comment at around the same time)

@LeonardAukea
Copy link

Should this package not be visible at https://search.nixos.org/packages now that it has been merged to master?

No, there is a delay between master and nixos-unstable. You can follow the progress of this PR here.

Thanks for the info 🙏 I was not aware of the PR tracker. I suspected that there would be some sort of delay but 20h seemed rather long.

@jansol
Copy link
Contributor

jansol commented Apr 9, 2024

I suspected that there would be some sort of delay but 20h seemed rather long.

You can also peek at https://status.nixos.org to see when your release channel last got updated. There can easily be a few days of delay if CI is failing.

@musjj
Copy link
Contributor

musjj commented Apr 9, 2024

I suspected that there would be some sort of delay but 20h

It normally takes roughly ~3 days unfortunately, and that's an optimistic estimate. I really do wish something can be done about it, it would be disastrous the next time something like xz actually hits NixOS.

@NixOS NixOS locked as off-topic and limited conversation to collaborators Apr 9, 2024
@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Apr 9, 2024

I've locked the conversation to stop the general off topic chat in this PR as every comment pings 20 plus people.

It normally takes roughly ~3 days unfortunately, and that's an optimistic estimate.

It really depends on the changes that are going through and if there are regressions it takes a bit longer but we are generally really fast in the last months.

I really do wish something can be done about it, it would be disastrous the next time something like xz actually hits NixOS.

xz is a totally separate issue as this is part of the bootstrapping and updating those packages takes way longer because, well it is the bootstrapping.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet