| Age | Commit message (Collapse) | Author |
|
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.
|
|
* rust-package.scm: regenerate with 'guix import crate -f Cargo.lock
genenetwork4', bringing the crate set in sync with Cargo.lock (the
gemma/auth work bumped tokio, which added signal-hook-registry 1.4.8).
* guix.scm (native-inputs): add rust-signal-hook-registry-1.4.8.
Without these the vendored build aborts at patch-cargo-checksums
(missing guix-vendor/rust-signal-hook-registry-1.4.8.tar.gz). Verified
hermetic: guix time-machine -C channels.scm -- build -L ~/guix-bioinformatics
-f guix.scm -> /gnu/store/7gk50nkrlyd3sc52bra48j70i5hb031z-genenetwork4-git-0.1.0
|
|
rust-package.scm: the git origin becomes rust-xapian-rs-0.3.0.70c5eac
(write-API patch set + the document-termlist-only eager positions
fix; hash taken fresh from the pushed revision). guix.scm: the
source-replacement stanza rev and the origin input follow. The
offline vendored build resolves against the new rev END-to-end
(guix build -f guix.scm EXIT 0).
|
|
Add src/embedded.rs with lmdb/duckdb/sqlite round-trip helpers and
tests/embedded.rs integration tests: an LMDB put/get (surviving a
fresh environment handle), an in-memory DuckDB query, and a SQLite
query.
Depend on the system libraries rather than bundled builds:
duckdb 1.10506.0, lmdb 0.8.0 and rusqlite 0.40.2 with their default
features, so the Guix build reuses libduckdb/liblmdb/libsqlite3 instead
of compiling its own.
Guix wiring (guix.scm): add the duckdb, lmdb and sqlite inputs
((gnu packages duckdb)/(gnu packages databases)/(gnu packages sqlite)),
a set-duckdb-paths phase that points libduckdb-sys at the system
libduckdb via DUCKDB_LIB_DIR/DUCKDB_INCLUDE_DIR (there is no
duckdb.pc), and the 79 new crate sources in rust-package.scm
(regenerated with `guix import crate -f Cargo.lock genenetwork4`).
|
|
teach the vendor phase to restore Cargo.lock.
House rule (rust-package.scm header): regenerate whenever Cargo.lock
changes. The cxx-gen 0.7.198 -> 0.7.124 pin swaps two crate sources
(cxx-gen itself, codespan-reporting 0.13.1 -> 0.11.1) and drops
unicode-width 0.2.2; guix.scm's native-inputs follow. 288 crate
sources plus the xapian-rs git origin, matching the lock exactly.
The first guix build attempt of this recipe failed inside
vendor-vendored-git-dep: the build-side environment has no (ice-9
ftw), so the phase now finds the vendored checkout with find-files
from (guix build utils) (attempt 1, logs/guix-c1-3.log). The second
failed in the build phase: cargo-build-system deletes Cargo.lock at
configure, but cargo refuses to resolve a git dependency against
vendored sources without one -- "the source git+... requires a lock
file to be present first" (attempt 2, same log + drv log). The phase
now restores the committed lock from the source store path. The whole
mechanism (lock + vendor dir + cargo-vendor git-source stanza +
checksum stub, fully offline) was proven outside guix first: cargo
build --offline EXIT 0 against the vendored graph, xapian-rs
compiling from the vendored git checkout.
|
|
rust-package.scm regenerated per the house header (guix import crate -f
Cargo.lock genenetwork4) for the C1.1 lock: 289 exported crate sources
(223 existing + 66 new) plus the xapian-rs git origin
(rust-xapian-rs-0.3.0.97fd343, Alexanderlacuna fork at rev 97fd343,
sha256 the recipe lane proved -- see ~/spikes/xapian-guix-recipe/
RECIPE-REPORT.md).
guix.scm: new (inputs (list xapian)) -- the vendored xapian-rs build
script locates it through pkg-config and the cxx bridge links
libxapian into genenetwork4 itself; clang (libclang for the autocxx
codegen) and pkg-config join native-inputs, mirroring the proven
standalone fork recipe; the 66 new crate sources join native-inputs.
The git dependency needs two things the old cargo-build-system does
not do by itself (empirically confirmed with cargo vendor on this
lock): a source-replacement stanza mapping the git source onto the
vendored directory, and a .cargo-checksum.json stub in the copied
checkout (registry crates carry one inside their .crate; a git
checkout does not). A new vendor-vendored-git-dep phase adds both,
appending exactly the stanza cargo vendor emits.
Gate: guix build -f guix.scm under the pinned channels with
substitutes in ci.guix.gnu.org-first order; evidence
~/spikes/port-execution/logs/guix-c1-3.log.
|
|
reqwest is the HTTP client for the phase-A search proxy (pure-Rust
TLS, no system OpenSSL, per the sandbox-hermetic convention);
serde_json is promoted from a dev-dependency; url percent-encodes
forwarded queries.
* Cargo.lock rust-package.scm guix.scm (packaging): regenerate the
crate mirror from the lock (guix import crate -f Cargo.lock
genenetwork4); add the 35 new crate sources to the inputs list.
All four artifacts move as one unit so cargo's and guix's views of
the dependency set can never drift or be half-reverted.
|
|
* Cargo.toml (jsonwebtoken, ureq): New dependencies, RS256 JWT
verification and gn-auth's HTTP API respectively. ureq pulls in ring
for RSA verification, needing a C compiler at build time -- already
provided by cargo-build-system's standard inputs, nothing added to
guix.scm for it. Promote serde_json from dev-dependencies to
dependencies; src/auth.rs needs it outside tests now.
(mysql-common-derive, simple_asn1, time): Pin to the newest versions
still compatible with the Guix-packaged rustc 1.85.1 (same trap as
before: ureq's dependency chain pulls darling 0.23/time 0.3.46+, both
needing rustc 1.88).
* rust-package.scm: Regenerate with `guix import crate -f Cargo.lock
genenetwork4`.
* guix.scm (genenetwork4-git)[native-inputs]: Update crate list to
match.
* src/auth.rs (AuthToken): New extractor. Verifies a bearer token's
RS256 signature and standard time claims (exp/nbf, checked only when
present -- gn-auth's own validator treats them as optional too)
against gn-auth's JWKS, cached and refreshed periodically
(OnceLock<Mutex<HashMap<...>>>, same shape as db::pool()) rather than
fetched per request.
(is_publicly_readable): New function. Matches GeneNetwork2's own
threshold (public > 0 AND confidentiality < 1, used throughout
wqflask/api/router.py) for whether a dataset needs an authorization
check at all; InbredSet/group rows carry a public column too, but GN2
never filters on it, so groups/species endpoints need no gating.
(authorise): New function. Wraps gn-auth's POST
/auth/resource/authorisation, caching the per-(user, resource) answer
briefly (AUTHORISATION_TTL) so repeated requests for the same resource
by the same user don't each cost a round trip. Not yet called from any
route -- see RELEASE_NOTES.md.
* src/config.rs (Config)[auth_server_url]: New field, AUTH_SERVER_URL
config key, matching GeneNetwork3's own key of the same name.
* src/error.rs (ApiError): Derive Debug; needed by tests/auth.rs's
.unwrap() on a Result<_, ApiError>, and every error type should
implement it regardless.
* src/lib.rs: Register the new auth module.
* tests/auth.rs: New file. Runs AuthToken verification and authorise()
(including its cache) against a real gn-auth instance; set
GN4_TEST_AUTH_TOKEN/GN4_TEST_RESOURCE_ID (see docs/gn-auth.md), skips
otherwise.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
|
|
Guix's rust package is 1.85.1; crates.io has since published newer
mysql_common, utoipa, utoipa-axum and transitive-dependency releases
that only compile on rustc 1.88+ (mysql_common's own let-chains and
is_multiple_of usage, utoipa-gen's darling 0.23 dependency, and
icu_*/idna_adapter/uuid bumps pulled in via url/mysql). None of that
is reachable by relaxing darling/icu/uuid alone -- mysql_common itself
needs downgrading, which drags mysql with it.
* Cargo.toml (mysql): 28.0.3 -> 26.0.1, the newest release still on
mysql_common 0.35.x (0.36.x and 0.37.x both use let-chains/
is_multiple_of, stable only from rustc 1.88).
(utoipa): 6.0.0 -> 5.5.0, (utoipa-axum): 0.3.0 -> 0.2.0, the newest
pre-6.0 utoipa line (MSRV 1.75); utoipa-gen 6.x's darling 0.23
dependency (MSRV 1.88) comes along with utoipa 6.x.
* Cargo.lock: Regenerate for the above; icu_collections,
icu_locale_core, icu_normalizer, icu_normalizer_data, icu_properties,
icu_properties_data, icu_provider, idna_adapter and uuid also drop to
their newest rustc-1.85.1-compatible releases as a result.
* rust-package.scm: Regenerate with `guix import crate -f Cargo.lock
genenetwork4`.
* guix.scm (genenetwork4-git)[native-inputs]: Update crate list to
match.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
|
|
* Cargo.toml (dependencies): Add tower-http, features request-id and
util.
* src/error.rs: New file. ApiError, modeled on RFC 7807 (Problem
Details for HTTP APIs) plus code, operation_id, spec_url, request_id
and next. type and spec_url are relative paths since this service has
no fixed public domain. Implements axum::response::IntoResponse.
* src/lib.rs (app): Add SetRequestIdLayer and PropagateRequestIdLayer,
assigning each request an x-request-id and copying it onto the
response.
(request_id_string): New function.
(species, species_by_name): Take an Extension<RequestId> parameter.
Return Result<_, ApiError> instead of Result<_, (StatusCode, String)>.
(species_by_name): On no match, set ApiError's next to /species, so a
caller with a wrong species name can discover the valid ones.
* tests/species_by_name.rs (species_by_name_unknown_species_returns_404):
Check the full ApiError body (status, code, operation_id, spec_url,
next) and that request_id matches the x-request-id response header,
instead of only the status code.
* test/python/test_species_by_name.py
(test_species_by_name_unknown_species_returns_404): Likewise.
* README.md: Add an Error handling section documenting the ApiError
shape and each field.
* rust-package.scm: Regenerate with guix import crate -f Cargo.lock
genenetwork4. Adds crate-source definitions for tower-http and its
new transitive dependencies.
* guix.scm (genenetwork4-git)[native-inputs]: Add rust-tower-http-0.7.1,
rust-getrandom-0.4.3 and rust-r-efi-6.0.0.
|
|
* Cargo.toml (dependencies): Add utoipa, feature axum_extras; add
utoipa-axum.
* src/lib.rs: Use utoipa_axum::router::OpenApiRouter and routes!
instead of axum::Router and route!, so paths register into an OpenApi
document as well as the router.
(ApiDoc): New struct, deriving utoipa::OpenApi with title, description
and license.
(app): Add /openapi.json, serving the OpenApi document split out of
OpenApiRouter via split_for_parts.
(hello_world, version, species): Add #[utoipa::path(...)] attributes
describing each endpoint's responses.
(VersionInfo): Derive utoipa::ToSchema in addition to Serialize.
* src/db.rs (Species): Likewise.
* tests/openapi.rs: New file. Checks /openapi.json's info.title and
that it lists all three endpoints.
* test/python/test_openapi.py: New file. Likewise.
* README.md: Document /openapi.json.
* rust-package.scm: Regenerate with guix import crate -f Cargo.lock
genenetwork4. Adds crate-source definitions for utoipa, utoipa-gen,
utoipa-axum and pastey.
* guix.scm (genenetwork4-git)[native-inputs]: Add rust-utoipa-6.0.0,
rust-utoipa-gen-6.0.1, rust-utoipa-axum-0.3.0 and rust-pastey-0.2.3.
|
|
* Cargo.toml (dependencies): Add mysql, default-features = false,
features minimal-rust and derive (minimal pulls in flate2/zlib, which
fails to compile here; minimal-rust uses flate2's pure-Rust backend
instead).
* Cargo.lock: Regenerate. Picks up mysql and its roughly 100
transitive dependencies; also bumps libc to 0.2.190 and tokio to
1.53.2 from re-resolution.
* src/db.rs: New file. sql_uri, Species, get_all_species. Mirrors
GeneNetwork3's gn3.db.species.get_all_species: same query, same
ordering. Connection string from the SQL_URI environment variable
(same config key GeneNetwork3 uses), defaulting to
mysql://webqtlout:webqtlout@127.0.0.1/db_webqtl.
* src/lib.rs (app): Add /species route.
(species): New handler. Runs db::get_all_species on a blocking
thread, since mysql::Conn is synchronous.
* tests/species.rs: New file. Checks for a database on
127.0.0.1:3306 first and skips with a message instead of failing when
none is reachable, since the Guix build sandbox has no network.
* test/python/test_species.py: New file. Likewise.
* README.md: Document /species, SQL_URI, and the skip-without-database
behavior of species.rs and test_species.py.
* rust-package.scm: Regenerate with guix import crate -f Cargo.lock
genenetwork4. Adds crate-source definitions for mysql's transitive
dependencies; bumps rust-libc and rust-tokio to the versions above.
* guix.scm (genenetwork4-git)[native-inputs]: Add every new
rust-package.scm entry mysql pulled in (roughly 100 packages,
including rust-mysql-28.0.3, rust-mysql-common-0.37.3, rust-uuid,
rust-url, rust-sha1, rust-sha2, rust-flate2).
|
|
|