feat: optimize nix CI time + nix nvim integration test
Aggregates:
- https://github.com/sourcegraph/sg.nvim/pull/41
- https://github.com/sourcegraph/sg.nvim/pull/49
Chores:
- Test this without adding
package.cpath, should work now - Might need to raise test timer on
tests.cody_spec/cody/should have been initializedsince MacOS occasionally fails
I'm actually going to remove the shared library this week / early next week, so let's hold off on this for a sec. Just going to move to the one rust binary and the one javascript agent. Ideally, people will be downloading those binaries from github (any suggestions on how to build those? :smile: )
The current building logic for Rust is it will build the whole workspace, copies to $out/bin/$CRATE_NAME. What Nix guarantees is there is a $PATH to point to $out/bin, either via symlinking, wrapping, or impurely managing $PATH of the current shell.
If you remove dylib target, the build logic should reflect this.
Regarding javascript agent, we can always include it in the source, then for the build logic, just copy it to $out/bin. Like how I'm just copying all things inside dist/ to $out/bin.
Regarding the bits on downloading from GitHub, which I presume is the way forward from 'dist/cody-agent.js', we can always 'fetchFromGithub' with predefined sha256, or just add another non-flake entry to control version of, say, gh:sourcegraph/cody
Oh I think I get what you mean now, I'll experiment under my fork. Are you per-chance thinking about creating binary releases?
Something like "for each PR merged to master, create a release tag that includes binary"?
@Pegasust yup! I plan on each master release, we create a binary so users do not have to build manually. I don't know what that means for you on nix (it will still be possible & just as easy to build the binaries, but this should remove the rust buildtime dep for users)
With #68 we have the ability to easily download the binaries. I'm not sure if that changes anything. No more shared lib, only the binary (and the cody-agent js bundle).
Ok @Pegasust i merged the downloading binaries version, if you want to check that out