Commit Graph

17 Commits

Author SHA1 Message Date
Keegan Carruthers-Smith
d42a99b5a3
nix: use go1.22.4 (#63372)
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.
2024-06-20 11:12:17 +02:00
Noah S-C
ad082497f2
nix: build pg-utils with nix [static edition] (#61734)
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
2024-04-09 20:24:19 +01:00
Noah S-C
1fcc1f0e32
nix: build pg-utils with nix & upload to GCS (#61658)
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
2024-04-09 11:54:17 +01:00
Noah S-C
2f8990e745
nix: bump to bazel 7.1 (#61326)
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 😎
2024-03-22 16:57:50 +00:00
Noah S-C
694f174511
nix: patch bazel_7 with hardcoded bin paths (#59359)
bazel (and its community of rules) is a bit of a mess when it comes to passing around env values, including $PATH, resulting in some actions not receiving the $PATH value set via `--action_path=PATH=...` that we rely on. Bazel 6 in nixpkgs had [the following patch](https://sourcegraph.com/github.com/NixOS/nixpkgs/-/blob/pkgs/development/tools/build-managers/bazel/bazel_6/actions_path.patch) that hardcodes a set of packages to include in that case, which is currently missing from Bazel 7 in nixpkgs, so we (temporarily, hopefully) reintroduce that patch locally. 

See: https://github.com/NixOS/nixpkgs/pull/262152#issuecomment-1879053113 and https://github.com/NixOS/nixpkgs/issues/94222 for some reading

I plan to move more bazel stuff out of shell.nix perhaps, into bazel.nix, as its a tad messy all-in-one

## Test plan

`bazel build //client/web/dist` is successful
2024-01-16 20:58:22 +00:00
William Bezuidenhout
b33b596506
nix: upgrade node and pnpm (#58015)
* nix: upgrade node and pnpm
* nix fmt
2023-10-31 17:55:55 +02:00
Noah S-C
831c06ca16
nix: separate nixpkgs-unstable pin from nixpkgs pin for static binaries (#56959)
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:
2023-09-22 17:12:18 +00:00
Dave Try
f882023227
sg: use bazel run universtal-ctags (#55944)
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>
2023-08-18 16:02:46 +00:00
Keegan Carruthers-Smith
4081681ec2
nix: develop uses non static binaries (#52927)
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
```
2023-06-07 08:36:09 +02:00
Noah S-C
35a8f87c7e
nix: reorganizing (#52273)
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
2023-05-31 16:20:32 +01:00
Noah S-C
9f7df7ca07
nix: set formatter & use nil instead of rnix-lsp (#51409)
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
2023-05-03 12:56:44 +00:00
Noah S-C
fa0a5769c2
nix: fix flake.nix (#51279)
Small oversight, devshells were flipped around

## Test plan

N/A nix stuff
2023-04-28 23:06:39 +02:00
Noah S-C
46caf922a0
nix: tidy & static comby+ctags+p4-fusion on linux+darwin (#49884)
## 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
2023-04-28 00:52:57 +01:00
Keegan Carruthers-Smith
f9248aaf1f
nix: use go1.20 (#47541)
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
2023-02-13 12:19:12 +02:00
Keegan Carruthers-Smith
866c28b2ac
nix: switch to unpinned nixpkgs (#46482)
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
2023-01-16 13:10:38 +02:00
Noah S-C
f8d96a83d9
nix: add p4-fusion building (#44588) 2022-11-23 16:06:28 +00:00
Noah S-C
7853ce8bb9
nix: migrate to Nix Flakes (#43668) 2022-10-31 15:08:06 +00:00