nixdoc icon indicating copy to clipboard operation
nixdoc copied to clipboard

WIP: Use the rnix "rowan" branch

Open jD91mZM2 opened this issue 6 years ago • 2 comments

Don't merge yet.

I'm currently exploring a library called "rowan" in rnix, which supplies a builder for ASTs making the code prettier, but also makes comments completely separate tokens. Sadly this library is currently slower because it's not using an arena-based approach, but that should hopefully be possible to do in rowan without modifying rnix or this project. Eventually this will become the main version of rnix, so I fixed this project now :smile:

jD91mZM2 avatar Nov 03 '18 18:11 jD91mZM2

CI is broken because of the git dependency, I think you had a patch to carnix for that?

jD91mZM2 avatar Nov 03 '18 19:11 jD91mZM2

Interesting, I have to take a more detailed look at what this actually implies, but I have two superficial comments:

  1. Please keep the #[macro_use] annotation, nixdoc should build on NixOS stable which does not have the Rust version that drops this requirement.
  2. Please rewrite the commit message into the format I use (e.g. refactor: Use rowan-based rnix dependency with a body explaining the changes a little bit). I like keeping this uniform so people can see what is going on on a high-level without having to read through PRs.

CI is broken because of the git dependency, I think you had a patch to carnix for that?

Yep, carnix keeps some of the query parameters appended by cargo in the git URL and nix-prefetch-git then fails to clone the repository.

Based on my carnix devel branch, the (kinda brute-force) patch is:

diff --git a/src/prefetch.rs b/src/prefetch.rs
index 0078cb4..dab20c2 100644
--- a/src/prefetch.rs
+++ b/src/prefetch.rs
@@ -182,6 +182,9 @@ impl Crate {
 
         println!("Prefetching {} ({})", self.name, cached_url);
         debug!("cached_url = {:?}", cached_url);
+
+        let url = url.split("?").next().unwrap();
         let prefetch = Command::new("nix-prefetch-git")
             .args(&[ "--url", url, "--rev", rev ])
             .output();

tazjin avatar Nov 04 '18 11:11 tazjin

Closed by #36.

:heart:

asymmetric avatar Jun 14 '23 11:06 asymmetric