ZIm/script
Julia Ryan 4a7c84f490
Fix nix build (#26270)
This PR includes lots of small fixes to get our `build.nix` and
`shell.nix` back to a working state.

I've tested this by running `cargo run` (inside the devshell) and `nix
run` on 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](92d11f06d5/pkgs/by-name/ze/zed-editor/package.nix (L226-L234))
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:
- Fix our `generate-licenses` script
- Relaxes the `cargo-about` version requirement slightly so it doesn't
try to install an older binary when the nixpkgs one is newer than our
requirement
- Add a workaround for [this cargo-about
issue](https://github.com/zed-industries/zed/issues/19971) obviating the
need for the patching done in the nixpkgs package
- Set the new `--frozen` flag to avoid network access/mutating the
lockfile
- Use dynamic webrtc lib from nixpkgs, and fixes up the build script in
webrtc-sys that hardcodes it to be statically linked.
- Use `inputsFrom` in `shell.nix` and avoid duplicating everything from
`build.nix`
- Add a temporary workaround for an [upstream crane
bug](https://github.com/ipetkov/crane/issues/808).
- Fix shebangs in our `script` dir to not hard-code `/bin/bash`

There 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
`libgit2` from `staticPkgs` and 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's `inputsFrom` list.

Thanks @niklaskorz, @GaetanLepage, @bbigras and all the other nixpkgs
maintainers that have kept the `zed-editor` package working and up to
date! I seriously considered just making our flake `overrideAttrs` the
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 `buildDepsOnly` isn't working for us. I'm assuming it'd make
our `nix build` times 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:

- N/A

---------

Co-authored-by: Rahul Butani <rrbutani@users.noreply.github.com>
Co-authored-by: Rahul Butani <rr.butani@gmail.com>
2025-03-10 01:06:11 -07:00
..
danger Update dependency danger to v12.3.4 (#24770) 2025-02-12 23:26:07 +00:00
flatpak Flatpak fixes (#14083) 2024-07-10 12:51:08 -06:00
issue_response Do not include recent issues in issue response script (#26064) 2025-03-04 16:13:53 -05:00
lib Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
licenses Improve cargo about licenses configuration (#24997) 2025-02-17 07:18:03 +00:00
patches More telemetry events (#22171) 2024-12-17 22:16:59 -07:00
terms legal: Terms of Use (2025-02-13) (#24803) 2025-02-13 09:41:43 -05:00
update_top_ranking_issues Resurrect top-ranking issues script (#25433) 2025-02-23 14:24:56 -05:00
analyze_highlights.py ci: Add shellcheck for scripts (#20631) 2024-11-18 16:41:22 -05:00
bootstrap Refactor scripts to use command -v instead of which (#20306) 2024-11-07 09:34:56 +02:00
bootstrap.ps1 windows: Make collab run on Windows (#23117) 2025-01-17 09:39:13 +02:00
build-docker Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
bump-extension-cli Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
bump-nightly Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
bump-zed-minor-versions Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
bump-zed-patch-version Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
bundle-linux Revert "Revert "Upgrade to rustls v0.23.22" (#24197)" (#24210) 2025-02-05 14:24:21 -07:00
bundle-mac chore: Do not bust Rust build cache when opening projects with dev build (#26278) 2025-03-07 14:06:44 +00:00
check-licenses Change license of crates/livekit_api from AGPL to GPL (#25206) 2025-02-19 23:32:51 +00:00
check-rust-livekit-macos Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
check-todos ci: Remove zero-width whitespace in job name (#23238) 2025-01-16 14:50:40 +00:00
clear-target-dir-if-larger-than Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
clippy Stop using xtask for clippy (#13223) 2024-06-18 13:49:44 -06:00
clippy.ps1 windows: Use a clippy script instead of xtask (#25807) 2025-02-28 14:01:10 +00:00
collab-flamegraph Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
crate-dep-graph Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
create-draft-release Use our own git clone in draft release notes (#20956) 2024-11-21 11:55:22 -07:00
create-migration remoting (#9680) 2024-03-22 08:44:56 -06:00
deploy-collab Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
deploy-postgrest Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
determine-release-channel Fix bad quote in script/determine-release-channel (#20613) 2024-11-13 12:41:50 -05:00
draft-release-notes Use our own git clone in draft release notes (#20956) 2024-11-21 11:55:22 -07:00
drop-test-dbs Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
exit-ci-if-dev-drive-is-full.ps1 windows: Fix tests on Windows (#22616) 2025-02-05 14:30:09 +00:00
generate-licenses Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
generate-licenses-csv Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
generate-terms-rtf Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
get-crate-version Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
get-preview-channel-changes Minor improvements to release tooling (#17502) 2024-09-06 13:34:33 -04:00
get-pull-requests-since Add a get-release-notes-since script (#18445) 2024-09-27 10:59:19 -04:00
get-release-notes-since Add a get-release-notes-since script (#18445) 2024-09-27 10:59:19 -04:00
get-released-version Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
histogram Print error message and skip line 2024-01-23 16:52:08 +01:00
import-themes Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
install-cmake Improve install-cmake script (#20836) 2024-11-18 16:39:57 -05:00
install-linux linux scripts: Respect $CARGO_TARGET_DIR (#13830) 2024-07-05 14:19:05 +03:00
install-mold Support More Linux (#18480) 2024-09-30 17:46:21 -04:00
install.sh linux: Fix file not opening from file explorer (#21137) 2024-11-29 23:01:29 +02:00
kube-shell Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
language-extension-version Add text objects to extensions (#21488) 2024-12-03 13:56:25 -07:00
linux Revert "Revert "Upgrade to rustls v0.23.22" (#24197)" (#24210) 2025-02-05 14:24:21 -07:00
metal-debug Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
mitm-proxy.sh Improve script/mitm-proxy.sh to support podman (#25834) 2025-02-28 22:37:03 +00:00
new-crate Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
prompts Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
randomized-test-ci Remove ZED_CLIENT_SECRET_TOKEN 2024-01-23 10:34:43 -07:00
randomized-test-minimize Format scripts with Prettier (#8393) 2024-02-25 11:03:33 -05:00
remote-server Add remote server cross compilation (#19136) 2024-10-12 23:23:56 -07:00
reset_db collab: Setup database for LLM service (#15882) 2024-08-06 17:18:08 -04:00
run-local-minio Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
seed-db Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
setup-dev-driver.ps1 windows: Use dev drive instead of ReFS (#25858) 2025-03-01 22:43:10 +08:00
shellcheck-scripts ci: Add shellcheck for scripts (#20631) 2024-11-18 16:41:22 -05:00
snap-build Add scripts and configuration for building snap package (#25064) 2025-02-19 10:28:23 -07:00
snap-try Add scripts and configuration for building snap package (#25064) 2025-02-19 10:28:23 -07:00
squawk Configure squawk rules (#16144) 2024-08-12 22:11:36 -04:00
storybook Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
symbolicate Improve Linux panic reporting (#22202) 2024-12-22 08:20:17 +00:00
trigger-release Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
uninstall.sh Add an uninstall script (#21213) 2024-11-28 10:31:12 +02:00
update-json-schemas Bump JSON schemas: package.json, tsconfig.json (#20910) 2024-11-20 13:35:00 -05:00
upload-extension-cli Add GitHub Action for publishing the extension CLI (#9542) 2024-03-19 14:19:32 -04:00
upload-nightly chore: Do not produce universal binaries for our releases (#21014) 2024-11-21 23:16:49 +01:00
what-is-deployed Fix nix build (#26270) 2025-03-10 01:06:11 -07:00
zed-local windows: Make collab run on Windows (#23117) 2025-01-17 09:39:13 +02:00