about summary refs log tree commit diff
path: root/rust-package.scm
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-15 01:22:23 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-15 01:22:23 +0000
commit4dbb553d5e4e48a785bbb5f4b97a84836eef296a (patch)
treed8a74d4a32d88e71c98b6460618d1e6a63017fc0 /rust-package.scm
parent2900aa07dfbb857382088ab4148f29dfd04f0123 (diff)
downloadgenenetwork4-4dbb553d5e4e48a785bbb5f4b97a84836eef296a.tar.gz
correlation: vendor the engine's git dependency
Cargo.toml pins gn-rust-correlation 12c2a37 from the genenetwork forge
(refs/heads/main there; GitHub still sits at 473ad82).  The lock grows by
exactly the four packages this brings in -- correlation_rust, GSL,
GSL-sys, assert_approx_eq -- and nothing else moves.

Following the xapian-rs precedent for a git dependency, since guix's
cargo build is offline and the registry replacement only knows crates.io:

- rust-package.scm gains the git origin as a bare `origin' (not a
  crate-source: unpack-rust-crates copies a *directory* input into
  guix-vendor/, so a checkout is exactly what it wants), plus crate
  sources for the three new registry crates;
- guix.scm lists them and adds a second source-replacement stanza beside
  xapian's, keyed `git+<url>?rev=<rev>` because cargo resolves a git source
  by the exact id in Cargo.lock;
- both git checkouts get the empty `.cargo-checksum.json` stub;
- gsl is a native input: the p-values come from GSL's t-distribution
  through rgsl, found with pkg-config at build time.

One fix in the vendoring phase itself: the gawk that back-fills package
checksums named vendor directories from the lock entry verbatim, which is
right for lowercase crates with no underscores and wrong for `GSL` and
`GSL-sys` (crate-source lowercases, via crate-name->package-name).  It
lowercases now, so the two agree.

Cargo cannot fetch this repo at all -- its HEAD is dangling, so cargo's
"fetch HEAD and every head" fails where guix's fetch-by-sha does not.
Generating the lock therefore needed CARGO_NET_OFFLINE with the crate
pre-cloned into ~/.cargo/git/db; nothing about that affects the build,
which vendors the checkout.
Diffstat (limited to 'rust-package.scm')
-rw-r--r--rust-package.scm29
1 files changed, 29 insertions, 0 deletions
diff --git a/rust-package.scm b/rust-package.scm
index aab55ce..6b1c80c 100644
--- a/rust-package.scm
+++ b/rust-package.scm
@@ -97,6 +97,10 @@
   (crate-source "atoi" "2.0.0"
                 "0a05h42fggmy7h0ajjv6m7z72l924i7igbx13hk9d8pyign9k3gj"))
 
+(define-public rust-assert-approx-eq-1.1.0
+  (crate-source "assert_approx_eq" "1.1.0"
+                "1zagfwfad5wssmr830gk3489f97ppczv6xs627jxniwm6ssdl1rw"))
+
 (define-public rust-atomic-waker-1.1.2
   (crate-source "atomic-waker" "1.1.2"
                 "1h5av1lw56m0jf0fd3bchxq8a30xv0b4wv8s4zkp4s0i7mfvs18m"))
@@ -415,6 +419,16 @@
   (crate-source "futures-util" "0.3.34"
                 "1g3r9ghzq7c2fh34lis43i72xavk9p84npgfwgb5vfpqcwjajl0d"))
 
+(define-public rust-gsl-6.0.0
+  ;; Reached through the correlation engine (rgsl -> gsl-sys); the p-values
+  ;; are computed by GSL's t-distribution, so this is not optional.
+  (crate-source "GSL" "6.0.0"
+                "1kpiivagrsk9ags7d4k2521jwix0lqgnd3i8ayj3dfniszvcmgn9"))
+
+(define-public rust-gsl-sys-3.0.0
+  (crate-source "GSL-sys" "3.0.0"
+                "17dx066l1pbjwp9syjkzqb6fiajyb4wc814zqdfrj807rh6nfxs5"))
+
 (define-public rust-generic-array-0.14.7
   (crate-source "generic-array" "0.14.7"
                 "16lyyrzrljfq424c3n8kfwkqihlimmsg5nhshbbp48np3yjrqr45"))
@@ -1440,6 +1454,21 @@
   (crate-source "writeable" "0.6.4"
                 "1p3r4s4wbf3dksfpj3xyrn7id5p0f7r74mj6qx6ngjfd6cm2vn1s"))
 
+(define-public rust-correlation_rust-0.1.0.12c2a37
+  ;; Git dependency of /compute/correlation (Cargo.toml pins this rev).
+  ;; guix.scm vendors it as a directory source, the same way as
+  ;; rust-xapian-rs below; see its 'patch-cargo-checksums phase for the
+  ;; cargo source replacement.  12c2a37 is the commit that makes
+  ;; `Spearman' public, so a caller holding two value vectors can compute
+  ;; the rank correlation without going through `Compute' -- the
+  ;; in-memory path docs/correlations.md asks for.
+  (origin
+    (method git-fetch)
+    (uri (git-reference (url "https://git.genenetwork.org/correlation_rust")
+                        (commit "12c2a37c3ef3a09f1ab0c5ea69b31b433b15f9f6")))
+    (file-name (git-file-name "rust-correlation_rust" "0.1.0.12c2a37"))
+    (sha256 (base32 "15wxzbzf7l4qvfdjd5y51ymjg1knvy74xndlzdhh9gn53sm1a20b"))))
+
 (define-public rust-xapian-rs-0.3.0.70c5eac
   ;; Git dependency of the native search engine (Cargo.toml pins this
   ;; rev).  guix.scm vendors it as a directory source; see its