backport :doc in repl #27

Closed
opened 2024-03-13 18:40:57 +00:00 by jade · 6 comments
Owner

hmmm there's two? https://github.com/NixOS/nix/pull/9054
https://github.com/NixOS/nix/pull/8778

also might depend on parser work..... anyway. filing this nonetheless.

hmmm there's two? https://github.com/NixOS/nix/pull/9054 https://github.com/NixOS/nix/pull/8778 also might depend on parser work..... anyway. filing this nonetheless.
Author
Owner

(cc @pennae as it's parser related)

(cc @pennae as it's parser related)
jade added the
ux
label 2024-03-13 18:43:56 +00:00
Owner

oof

*oof*
jade added this to the v2.91 milestone 2024-03-14 06:34:42 +00:00
Author
Owner

Blocked on parser rewrite so marked as v2.91 at minimum

Blocked on parser rewrite so marked as v2.91 at minimum
Author
Owner

OK plan devised on matrix with @lunaphied and @puck: simply statically or shared-link the rust side of nix-doc, which we compile with nix, into nix, to avoid fucking with the make build system. Then invoke it with :doc in the repl.

This is a very silly solution because it is literally adding a second Nix parser to Nix, but it is an extremely easy win with extremely deletable code (the API surface we use is two functions) when we solve it properly and basically no actual disadvantages aside from being ugly.

OK plan devised on matrix with @lunaphied and @puck: simply statically or shared-link the *rust side of* nix-doc, which we compile with nix, into nix, to avoid fucking with the make build system. Then invoke it with `:doc` in the repl. This is a very silly solution because it is literally adding a second Nix parser to Nix, but it is an extremely easy win with extremely deletable code (the API surface we use is two functions) when we solve it properly and basically no actual disadvantages aside from being ugly.
Author
Owner

Implementation steps:

  • Yoink lf-/nix-doc into a subdir in here
  • Make this into a staticlib output, build it with nix: fff1c0b3cc/plugin/src/lib.rs (L1-L20)
  • Tree-shake the entire rest of the program into nothingness
  • Static link our forked nix-doc in lix
  • Make :doc in repl invoke this function.
  • Write some tests
Implementation steps: * Yoink lf-/nix-doc into a subdir in here * Make this into a staticlib output, build it with nix: https://github.com/lf-/nix-doc/blob/fff1c0b3cce58383599195d5628f4abf009e9ba9/plugin/src/lib.rs#L1-L20 * Tree-shake the entire rest of the program into nothingness * Static link our forked nix-doc in lix * Make `:doc` in repl invoke this function. * Write some tests
Author
Owner
https://gerrit.lix.systems/c/lix/+/564
jade closed this issue 2024-04-08 03:48:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#27
No description provided.