Tired of seeing the go toolchain being easier to use than nix.
Test Plan: nix develop on linux amd64 and macbook arm64 followed by
running "go test ./internal/search" working. Also confirming that "go
env GOROOT" points into the nix store.
Turns out we can do this after all! And thankfully so, because our buildkite runners have an older glibc version than what Nix was building our bins against which was resulting in `dropdb: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by dropdb)` when bazel was running in buildkite
## Test plan
Much local `nix build`'ing, `ldd` and `patchelf`'ing
Lets get rid of PG_UTILS_PATH! :allthethings: 🎉
## Test plan
CI and a _lot_ of `nix build .#pg-utils && ldd ./result/bin/pg_dump`
also tested e2e with the following diff: 61e0eb0d55
Using my fork with open PR: https://github.com/NixOS/nixpkgs/pull/295615
Im needing 7.1 sooner than later, given its new features and this repo also using 7.1 (so all new features are fair game for it!)
Cached version is pushed to sourcegraph-noah.cachix.org, which I've added at the top here so you too can avoid building it locally 🙂
## Test plan
Tested locally 😎
We want to get newer stuff in the devshell, but keep a stabler pin for the static binaries (until darwin stdenv stabilizes, most notably the big brain work over at https://github.com/NixOS/nixpkgs/pull/256590)
## Test plan
N/A nix stuff :clueless:
Use nix to compile and upload universal-ctags to a gcloud bucket. We then pull this down using a bazel http_file and can run it with bazel also. Removed all of the old bash logic that was hard to follow and maintain also.
---------
Co-authored-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>
Co-authored-by: William Bezuidenhout <william.bezuidenhout@sourcegraph.com>
In our flake we expose a bunch of statically compiled binaries. We
introduced this to help us ship those binaries that are quite hard to
build outside of nix. With our recent re-organization we started using
them in the devenv. The downside of this is we now have to do things
like recompile ocaml. Even on my beast linux desktop this feels like
overkill.
This commit switches us to using the normal nix packages. Additionally
it:
- removes p4-fusion from our devenv since no nix users dev with it.
- re-introduces the universal-ctags wrapper
Test Plan: checked ctags in the devenv:
``` shell
nix develop
file $CTAGS_COMMAND
which universal-ctags
```
Re-organizing a couple of things to make the individual files nicer,
consolidated some things in ctags.nix, extracted forEachSystem stuff to
flake.nix instead of the individual files, overlay for our specific
nodejs requirements, some more comments to stuff
## Test plan
N/A, nix stuff
Allows formatting everything with `nix fmt`
[nil](https://github.com/oxalica/nil) appears more maintained and higher
quality than rnix-lsp
## Test plan
N/A, nix stuff
## How to build
`nix build .#ctags .#p4-fusion .#comby` with outputs in
`./result{,-1,-2}/bin`
## Static? Prove it
Linux:
```
$ ldd ./result/bin/comby ./result-1/bin/p4-fusion ./result-2/bin/ctags
./result/bin/comby:
not a dynamic executable
./result-1/bin/p4-fusion:
not a dynamic executable
./result-2/bin/ctags:
not a dynamic executable
```
Darwin (libiconv and libxml are in dylib cache, libSystem.B cannot be
statically linked, and the rest are core system libraries):
```
otool -L ./result-1/bin/p4-fusion ./result/bin/comby ./result-2/bin/ctags
./result-1/bin/p4-fusion:
/System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork (compatibility version 1.0.0, current version 1209.1.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 59754.60.13)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
./result/bin/comby:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
./result-2/bin/ctags:
@rpath/libxml2.2.dylib (compatibility version 13.0.0, current version 13.3.0)
@rpath/libiconv.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
```
Review with whitespace changes hidden
## Test plan
Built many many times, checked ldd & otool many many times
Had to move to unstable for this, but everything seems to be working. I
wonder if we should introduce both stable and unstable pkgs? IE it kind
of sucks needing to download 4G from the cache every update (which I
think is mostly bazel?).
Test Plan: nix develop
Previously we had a pinned input with nix flakes. This switches to
following nixos-22.11. This will allow us to update inputs now via nix
flake update.
Note: I don't pretend to understand flakes properly yet, so this might
be doing something wrong.
Test Plan: nix develop