sg.nvim icon indicating copy to clipboard operation
sg.nvim copied to clipboard

feat: optimize nix CI time + nix nvim integration test

Open Pegasust opened this issue 2 years ago • 6 comments

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 initialized since MacOS occasionally fails

Pegasust avatar Jul 29 '23 06:07 Pegasust

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: )

tjdevries avatar Aug 04 '23 00:08 tjdevries

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

Pegasust avatar Aug 04 '23 00:08 Pegasust

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 avatar Aug 04 '23 01:08 Pegasust

@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)

tjdevries avatar Aug 04 '23 15:08 tjdevries

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).

tjdevries avatar Aug 08 '23 15:08 tjdevries

Ok @Pegasust i merged the downloading binaries version, if you want to check that out

tjdevries avatar Aug 11 '23 15:08 tjdevries