Conversation
Co-authored-by: Rahul Butani <rrbutani@users.noreply.github.com>
Uses the new `--frozen` flag to avoid attempting to fetch or update versions during the build. Also changes from a hardcoded version to a semver constraint to avoid downloading an extra `cargo-about` when a slightly newer one is present. There are still issues due to `fetchCargoVendor` putting deps in a different place than is expected by zed-licenses.toml. See #19971 for details.
- fixed source filtering - use zed's cargo-bundle fork - use dynamic linking for livekit-webrtc Co-authored-by: Rahul Butani <rr.butani@gmail.com>
|
|
We'd love replacing our nixpkgs generate-licenses patch with a simple env var, thank you! If you're interested, we also have a small Matrix room for Zed on Nix(OS) where we discuss the package maintenance, and would be glad to extend that to upstream maintainers. You can contact me on Matrix if you'd like to join. |
I love supporting a decade old bash version 🙃
Honestly I'd love having the nixpkgs package in a state where that is a workable option, it would make maintenance so much more centralized. What problems were there with that? I guess nixpkgs might be a bit slow to update for how fast zed moves at times. |
I've done that in #22825 ultimately coming to a conclusion that as nixpkgs tracks stable zed and therefore can't be updated before the 2 week release window it would be less sustainable that having the package here Ultimately, the build process of zed seems surprisingly fragile up to the point that building in debug mode in nix breaks it, so I expect actually getting CI to work quickly enough to be included in every PR to be an incredibly painful debugging experience |
|
I came to similar conclusions, while re-using the definition from nixpkgs would reduce duplication and possibly save some effort, there's several reasons why I believe it's still worth maintaining our own:
Of course I plan to keep an eye on the nixpkgs package. Those maintainers are much more knowledgeable about nix than any of us at zed, and some of the fixes in this PR are straight from their solutions. I'll also try to make sure it's easy for them to integrate changes we make to our build, for example by adding knobs to disable things that aren't working under nix so they can avoid patching when possible. |
This PR includes lots of small fixes to get our
build.nixandshell.nixback to a working state.I've tested this by running
cargo run(inside the devshell) andnix runon x86 nixos and arm64 darwin machines. I'd appreciate it if others could test building inside the devshell to double-check that it's not just working because I happen to have some system-level packages installed, as well as seeing if it works on other platforms (non-nixos linux, arm linux, x86 darwin).I couldn't get the full test suite (
cargo nextest run --workspace) passing in the devshell on darwin, but they are all passing on nixos. nixpkgs disables some of our tests that apparently fail or are flakey on hydra, but they don't know why. I'm going to punt on debugging those for now, especially given that they seem to be working for me. I'm also unsure of whether we actually want the nix checkPhase to run the full test suite (it's currently not passing--workspace) given that we have separate CI that should enforce that those pass on all PRs.Here's an overview of the changes made:
generate-licensesscriptcargo-aboutversion requirement slightly so it doesn't try to install an older binary when the nixpkgs one is newer than our requirementALLOW_MISSING_LICENSESin nixpkgs?cargo aboutjust isn't set up to handle deps being vendored like that.--frozenflag to avoid network access/mutating the lockfileinputsFrominshell.nixand avoid duplicating everything frombuild.nixscriptdir to not hard-code/bin/bashThere are still a bunch of issues that aren't resolved here, I'll make a tracking issue for those and try to land this first just to get back to an unbroken state. Eventually among other things I'd like to use a
libgit2fromstaticPkgsand musl cross compilation to build the remote server under nix, and then add that as a separate flake output and include it in the shell'sinputsFromlist.Thanks @niklaskorz, @GaetanLepage, @bbigras and all the other nixpkgs maintainers that have kept the
zed-editorpackage working and up to date! I seriously considered just making our flakeoverrideAttrsthe package in nixpkgs given how well maintained it is.Thanks @WeetHet for your volunteer maintinance of this flake. I referenced #24953 while working on these fixes, and I'd love to collaborate on adding some of those pieces like treefmt and a github action. If you're interested I'd really appreciate some help debugging why crane's
buildDepsOnlyisn't working for us. I'm assuming it'd make ournix buildtimes go way down from the improved dep caching if we could get it working.Thanks @rrbutani for all the help on this PR 💙.
Release Notes: