feat(nix-compat/nix_http): init parse_nar[info]_str

This moves the URL component parsing code we had in nar-bridge to
nix-compat.

We change the function signature to return an Option, not a
Result<_, StatusCode>.

This allows returning more appropriate error codes, as we can
ok_or(…) at the callsite, which we now do: on an upload to an
invalid path, we now return "unauthorized", while on a GET/HEAD, we
return "not found".

This also adds support to parse compression suffixes. While not
supported in nar-bridge, other users of nix-compat might very well want
to parse these paths.

Also fix the error message when parsing NAR urls, it mentioned 32, not
52, which is a copypasta error from the narinfo URL parsing code.

Change-Id: Id1be9a8044814b54ce68b125c52dfe933c9c4f74
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12260
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Florian Klink 2024-08-21 11:06:12 +03:00 committed by clbot
parent 2357079891
commit e03ea11bad
15 changed files with 634 additions and 178 deletions

1
tvix/Cargo.lock generated
View file

@ -2361,6 +2361,7 @@ dependencies = [
"thiserror", "thiserror",
"tokio", "tokio",
"tokio-test", "tokio-test",
"tracing",
"zstd", "zstd",
] ]

View file

@ -7443,6 +7443,10 @@ rec {
optional = true; optional = true;
features = [ "io-util" "macros" ]; features = [ "io-util" "macros" ];
} }
{
name = "tracing";
packageId = "tracing";
}
]; ];
devDependencies = [ devDependencies = [
{ {

View file

@ -5,7 +5,7 @@ use axum::response::Response;
use bytes::Bytes; use bytes::Bytes;
use data_encoding::BASE64URL_NOPAD; use data_encoding::BASE64URL_NOPAD;
use futures::TryStreamExt; use futures::TryStreamExt;
use nix_compat::nixbase32; use nix_compat::{nix_http, nixbase32};
use serde::Deserialize; use serde::Deserialize;
use std::io; use std::io;
use tokio_util::io::ReaderStream; use tokio_util::io::ReaderStream;
@ -92,7 +92,14 @@ pub async fn put(
}): axum::extract::State<AppState>, }): axum::extract::State<AppState>,
request: axum::extract::Request, request: axum::extract::Request,
) -> Result<&'static str, StatusCode> { ) -> Result<&'static str, StatusCode> {
let nar_hash_expected = parse_nar_str(&nar_str)?; let (nar_hash_expected, compression_suffix) =
nix_http::parse_nar_str(&nar_str).ok_or(StatusCode::UNAUTHORIZED)?;
// No paths with compression suffix are supported.
if !compression_suffix.is_empty() {
warn!(%compression_suffix, "invalid compression suffix requested");
return Err(StatusCode::UNAUTHORIZED);
}
let s = request.into_body().into_data_stream(); let s = request.into_body().into_data_stream();
@ -133,54 +140,3 @@ pub async fn put(
// FUTUREWORK: maybe head by narhash. Though not too critical, as we do // FUTUREWORK: maybe head by narhash. Though not too critical, as we do
// implement HEAD for .narinfo. // implement HEAD for .narinfo.
/// Parses a `14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar`
/// string and returns the nixbase32-decoded digest.
/// No compression is supported.
fn parse_nar_str(s: &str) -> Result<[u8; 32], StatusCode> {
if !s.is_char_boundary(52) {
warn!("invalid string, no char boundary at 32");
return Err(StatusCode::NOT_FOUND);
}
Ok(match s.split_at(52) {
(hash_str, ".nar") => {
// we know this is 52 bytes
let hash_str_fixed: [u8; 52] = hash_str.as_bytes().try_into().unwrap();
nixbase32::decode_fixed(hash_str_fixed).map_err(|e| {
warn!(err=%e, "invalid digest");
StatusCode::NOT_FOUND
})?
}
_ => {
warn!("invalid string");
return Err(StatusCode::BAD_REQUEST);
}
})
}
#[cfg(test)]
mod test {
use super::parse_nar_str;
use hex_literal::hex;
#[test]
fn success() {
assert_eq!(
hex!("13a8cf7ca57f68a9f1752acee36a72a55187d3a954443c112818926f26109d91"),
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar").unwrap()
)
}
#[test]
fn failure() {
assert!(
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar.x").is_err()
);
assert!(
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar.xz").is_err()
);
assert!(parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0").is_err());
assert!(parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0🦊.nar").is_err())
}
}

View file

@ -1,6 +1,6 @@
use axum::http::StatusCode; use axum::http::StatusCode;
use bytes::Bytes; use bytes::Bytes;
use nix_compat::{narinfo::NarInfo, nixbase32}; use nix_compat::{narinfo::NarInfo, nix_http, nixbase32};
use prost::Message; use prost::Message;
use tracing::{instrument, warn, Span}; use tracing::{instrument, warn, Span};
use tvix_castore::proto::{self as castorepb}; use tvix_castore::proto::{self as castorepb};
@ -18,7 +18,7 @@ pub async fn head(
path_info_service, .. path_info_service, ..
}): axum::extract::State<AppState>, }): axum::extract::State<AppState>,
) -> Result<&'static str, StatusCode> { ) -> Result<&'static str, StatusCode> {
let digest = parse_narinfo_str(&narinfo_str)?; let digest = nix_http::parse_narinfo_str(&narinfo_str).ok_or(StatusCode::NOT_FOUND)?;
Span::current().record("path_info.digest", &narinfo_str[0..32]); Span::current().record("path_info.digest", &narinfo_str[0..32]);
if path_info_service if path_info_service
@ -44,7 +44,7 @@ pub async fn get(
path_info_service, .. path_info_service, ..
}): axum::extract::State<AppState>, }): axum::extract::State<AppState>,
) -> Result<String, StatusCode> { ) -> Result<String, StatusCode> {
let digest = parse_narinfo_str(&narinfo_str)?; let digest = nix_http::parse_narinfo_str(&narinfo_str).ok_or(StatusCode::NOT_FOUND)?;
Span::current().record("path_info.digest", &narinfo_str[0..32]); Span::current().record("path_info.digest", &narinfo_str[0..32]);
// fetch the PathInfo // fetch the PathInfo
@ -101,7 +101,7 @@ pub async fn put(
}): axum::extract::State<AppState>, }): axum::extract::State<AppState>,
request: axum::extract::Request, request: axum::extract::Request,
) -> Result<&'static str, StatusCode> { ) -> Result<&'static str, StatusCode> {
let _narinfo_digest = parse_narinfo_str(&narinfo_str)?; let _narinfo_digest = nix_http::parse_narinfo_str(&narinfo_str).ok_or(StatusCode::UNAUTHORIZED);
Span::current().record("path_info.digest", &narinfo_str[0..32]); Span::current().record("path_info.digest", &narinfo_str[0..32]);
let narinfo_bytes: Bytes = axum::body::to_bytes(request.into_body(), NARINFO_LIMIT) let narinfo_bytes: Bytes = axum::body::to_bytes(request.into_body(), NARINFO_LIMIT)
@ -157,49 +157,3 @@ pub async fn put(
} }
} }
} }
/// Parses a `3mzh8lvgbynm9daj7c82k2sfsfhrsfsy.narinfo` string and returns the
/// nixbase32-decoded digest.
fn parse_narinfo_str(s: &str) -> Result<[u8; 20], StatusCode> {
if !s.is_char_boundary(32) {
warn!("invalid string, no char boundary at 32");
return Err(StatusCode::NOT_FOUND);
}
Ok(match s.split_at(32) {
(hash_str, ".narinfo") => {
// we know this is 32 bytes
let hash_str_fixed: [u8; 32] = hash_str.as_bytes().try_into().unwrap();
nixbase32::decode_fixed(hash_str_fixed).map_err(|e| {
warn!(err=%e, "invalid digest");
StatusCode::NOT_FOUND
})?
}
_ => {
warn!("invalid string");
return Err(StatusCode::NOT_FOUND);
}
})
}
#[cfg(test)]
mod test {
use super::parse_narinfo_str;
use hex_literal::hex;
#[test]
fn success() {
assert_eq!(
hex!("8a12321522fd91efbd60ebb2481af88580f61600"),
parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44la.narinfo").unwrap()
);
}
#[test]
fn failure() {
assert!(parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44la").is_err());
assert!(parse_narinfo_str("/00bgd045z0d4icpbc2yyz4gx48ak44la").is_err());
assert!(parse_narinfo_str("000000").is_err());
assert!(parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44l🦊.narinfo").is_err());
}
}

View file

@ -27,6 +27,7 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
sha2 = "0.10.6" sha2 = "0.10.6"
thiserror = "1.0.38" thiserror = "1.0.38"
tracing = "0.1.37"
[dependencies.tokio] [dependencies.tokio]
optional = true optional = true

View file

@ -2,6 +2,7 @@ pub(crate) mod aterm;
pub mod derivation; pub mod derivation;
pub mod nar; pub mod nar;
pub mod narinfo; pub mod narinfo;
pub mod nix_http;
pub mod nixbase32; pub mod nixbase32;
pub mod nixcpp; pub mod nixcpp;
pub mod nixhash; pub mod nixhash;

View file

@ -0,0 +1,108 @@
use tracing::trace;
use crate::nixbase32;
/// Parses a `14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar`
/// string and returns the nixbase32-decoded digest, as well as the compression
/// suffix (which might be empty).
pub fn parse_nar_str(s: &str) -> Option<([u8; 32], &str)> {
if !s.is_char_boundary(52) {
trace!("invalid string, no char boundary at 52");
return None;
}
let (hash_str, suffix) = s.split_at(52);
// we know hash_str is 52 bytes, so it's ok to unwrap here.
let hash_str_fixed: [u8; 52] = hash_str.as_bytes().try_into().unwrap();
match suffix.strip_prefix(".nar") {
Some(compression_suffix) => match nixbase32::decode_fixed(hash_str_fixed) {
Err(e) => {
trace!(err=%e, "invalid nixbase32 encoding");
None
}
Ok(digest) => Some((digest, compression_suffix)),
},
None => {
trace!("no .nar suffix");
None
}
}
}
/// Parses a `3mzh8lvgbynm9daj7c82k2sfsfhrsfsy.narinfo` string and returns the
/// nixbase32-decoded digest.
pub fn parse_narinfo_str(s: &str) -> Option<[u8; 20]> {
if !s.is_char_boundary(32) {
trace!("invalid string, no char boundary at 32");
return None;
}
match s.split_at(32) {
(hash_str, ".narinfo") => {
// we know this is 32 bytes, so it's ok to unwrap here.
let hash_str_fixed: [u8; 32] = hash_str.as_bytes().try_into().unwrap();
match nixbase32::decode_fixed(hash_str_fixed) {
Err(e) => {
trace!(err=%e, "invalid nixbase32 encoding");
None
}
Ok(digest) => Some(digest),
}
}
_ => {
trace!("invalid string, no .narinfo suffix");
None
}
}
}
#[cfg(test)]
mod test {
use super::{parse_nar_str, parse_narinfo_str};
use hex_literal::hex;
#[test]
fn parse_nar_str_success() {
assert_eq!(
(
hex!("13a8cf7ca57f68a9f1752acee36a72a55187d3a954443c112818926f26109d91"),
""
),
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar").unwrap()
);
assert_eq!(
(
hex!("13a8cf7ca57f68a9f1752acee36a72a55187d3a954443c112818926f26109d91"),
".xz"
),
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0k.nar.xz").unwrap()
)
}
#[test]
fn parse_nar_str_failure() {
assert!(parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0").is_none());
assert!(
parse_nar_str("14cx20k6z4hq508kqi2lm79qfld5f9mf7kiafpqsjs3zlmycza0🦊.nar").is_none()
)
}
#[test]
fn parse_narinfo_str_success() {
assert_eq!(
hex!("8a12321522fd91efbd60ebb2481af88580f61600"),
parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44la.narinfo").unwrap()
);
}
#[test]
fn parse_narinfo_str_failure() {
assert!(parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44la").is_none());
assert!(parse_narinfo_str("/00bgd045z0d4icpbc2yyz4gx48ak44la").is_none());
assert!(parse_narinfo_str("000000").is_none());
assert!(parse_narinfo_str("00bgd045z0d4icpbc2yyz4gx48ak44l🦊.narinfo").is_none());
}
}

View file

@ -1434,6 +1434,7 @@ dependencies = [
"sha2 0.10.8", "sha2 0.10.8",
"thiserror", "thiserror",
"tokio", "tokio",
"tracing",
] ]
[[package]] [[package]]
@ -2776,9 +2777,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [ dependencies = [
"pin-project-lite", "pin-project-lite",
"tracing-attributes",
"tracing-core", "tracing-core",
] ]
[[package]]
name = "tracing-attributes"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.39",
]
[[package]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.32" version = "0.1.32"

View file

@ -4155,6 +4155,10 @@ rec {
optional = true; optional = true;
features = [ "io-util" "macros" ]; features = [ "io-util" "macros" ];
} }
{
name = "tracing";
packageId = "tracing";
}
]; ];
devDependencies = [ devDependencies = [
{ {
@ -9062,6 +9066,11 @@ rec {
name = "pin-project-lite"; name = "pin-project-lite";
packageId = "pin-project-lite"; packageId = "pin-project-lite";
} }
{
name = "tracing-attributes";
packageId = "tracing-attributes";
optional = true;
}
{ {
name = "tracing-core"; name = "tracing-core";
packageId = "tracing-core"; packageId = "tracing-core";
@ -9077,7 +9086,37 @@ rec {
"tracing-attributes" = [ "dep:tracing-attributes" ]; "tracing-attributes" = [ "dep:tracing-attributes" ];
"valuable" = [ "tracing-core/valuable" ]; "valuable" = [ "tracing-core/valuable" ];
}; };
resolvedDefaultFeatures = [ "std" ]; resolvedDefaultFeatures = [ "attributes" "default" "std" "tracing-attributes" ];
};
"tracing-attributes" = rec {
crateName = "tracing-attributes";
version = "0.1.27";
edition = "2018";
sha256 = "1rvb5dn9z6d0xdj14r403z0af0bbaqhg02hq4jc97g5wds6lqw1l";
procMacro = true;
libName = "tracing_attributes";
authors = [
"Tokio Contributors <team@tokio.rs>"
"Eliza Weisman <eliza@buoyant.io>"
"David Barsky <dbarsky@amazon.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.39";
usesDefaultFeatures = false;
features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ];
}
];
features = { };
}; };
"tracing-core" = rec { "tracing-core" = rec {
crateName = "tracing-core"; crateName = "tracing-core";

View file

@ -970,6 +970,7 @@ dependencies = [
"sha2", "sha2",
"thiserror", "thiserror",
"tokio", "tokio",
"tracing",
] ]
[[package]] [[package]]
@ -1872,6 +1873,37 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "tracing"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.39",
]
[[package]]
name = "tracing-core"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
]
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.17.0" version = "1.17.0"

View file

@ -2852,6 +2852,10 @@ rec {
optional = true; optional = true;
features = [ "io-util" "macros" ]; features = [ "io-util" "macros" ];
} }
{
name = "tracing";
packageId = "tracing";
}
]; ];
devDependencies = [ devDependencies = [
{ {
@ -6370,6 +6374,96 @@ rec {
}; };
resolvedDefaultFeatures = [ "default" "io" "io-util" ]; resolvedDefaultFeatures = [ "default" "io" "io-util" ];
}; };
"tracing" = rec {
crateName = "tracing";
version = "0.1.40";
edition = "2018";
sha256 = "1vv48dac9zgj9650pg2b4d0j3w6f3x9gbggf43scq5hrlysklln3";
authors = [
"Eliza Weisman <eliza@buoyant.io>"
"Tokio Contributors <team@tokio.rs>"
];
dependencies = [
{
name = "pin-project-lite";
packageId = "pin-project-lite";
}
{
name = "tracing-attributes";
packageId = "tracing-attributes";
optional = true;
}
{
name = "tracing-core";
packageId = "tracing-core";
usesDefaultFeatures = false;
}
];
features = {
"attributes" = [ "tracing-attributes" ];
"default" = [ "std" "attributes" ];
"log" = [ "dep:log" ];
"log-always" = [ "log" ];
"std" = [ "tracing-core/std" ];
"tracing-attributes" = [ "dep:tracing-attributes" ];
"valuable" = [ "tracing-core/valuable" ];
};
resolvedDefaultFeatures = [ "attributes" "default" "std" "tracing-attributes" ];
};
"tracing-attributes" = rec {
crateName = "tracing-attributes";
version = "0.1.27";
edition = "2018";
sha256 = "1rvb5dn9z6d0xdj14r403z0af0bbaqhg02hq4jc97g5wds6lqw1l";
procMacro = true;
libName = "tracing_attributes";
authors = [
"Tokio Contributors <team@tokio.rs>"
"Eliza Weisman <eliza@buoyant.io>"
"David Barsky <dbarsky@amazon.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.39";
usesDefaultFeatures = false;
features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ];
}
];
features = { };
};
"tracing-core" = rec {
crateName = "tracing-core";
version = "0.1.32";
edition = "2018";
sha256 = "0m5aglin3cdwxpvbg6kz0r9r0k31j48n0kcfwsp6l49z26k3svf0";
libName = "tracing_core";
authors = [
"Tokio Contributors <team@tokio.rs>"
];
dependencies = [
{
name = "once_cell";
packageId = "once_cell";
optional = true;
}
];
features = {
"default" = [ "std" "valuable/std" ];
"once_cell" = [ "dep:once_cell" ];
"std" = [ "once_cell" ];
"valuable" = [ "dep:valuable" ];
};
resolvedDefaultFeatures = [ "once_cell" "std" ];
};
"typenum" = rec { "typenum" = rec {
crateName = "typenum"; crateName = "typenum";
version = "1.17.0"; version = "1.17.0";

View file

@ -941,6 +941,7 @@ dependencies = [
"sha2", "sha2",
"thiserror", "thiserror",
"tokio", "tokio",
"tracing",
] ]
[[package]] [[package]]
@ -1876,6 +1877,37 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "tracing"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.48",
]
[[package]]
name = "tracing-core"
version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
dependencies = [
"once_cell",
]
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.17.0" version = "1.17.0"

View file

@ -2758,6 +2758,10 @@ rec {
optional = true; optional = true;
features = [ "io-util" "macros" ]; features = [ "io-util" "macros" ];
} }
{
name = "tracing";
packageId = "tracing";
}
]; ];
devDependencies = [ devDependencies = [
{ {
@ -6321,6 +6325,96 @@ rec {
}; };
resolvedDefaultFeatures = [ "default" "io" "io-util" ]; resolvedDefaultFeatures = [ "default" "io" "io-util" ];
}; };
"tracing" = rec {
crateName = "tracing";
version = "0.1.40";
edition = "2018";
sha256 = "1vv48dac9zgj9650pg2b4d0j3w6f3x9gbggf43scq5hrlysklln3";
authors = [
"Eliza Weisman <eliza@buoyant.io>"
"Tokio Contributors <team@tokio.rs>"
];
dependencies = [
{
name = "pin-project-lite";
packageId = "pin-project-lite";
}
{
name = "tracing-attributes";
packageId = "tracing-attributes";
optional = true;
}
{
name = "tracing-core";
packageId = "tracing-core";
usesDefaultFeatures = false;
}
];
features = {
"attributes" = [ "tracing-attributes" ];
"default" = [ "std" "attributes" ];
"log" = [ "dep:log" ];
"log-always" = [ "log" ];
"std" = [ "tracing-core/std" ];
"tracing-attributes" = [ "dep:tracing-attributes" ];
"valuable" = [ "tracing-core/valuable" ];
};
resolvedDefaultFeatures = [ "attributes" "default" "std" "tracing-attributes" ];
};
"tracing-attributes" = rec {
crateName = "tracing-attributes";
version = "0.1.27";
edition = "2018";
sha256 = "1rvb5dn9z6d0xdj14r403z0af0bbaqhg02hq4jc97g5wds6lqw1l";
procMacro = true;
libName = "tracing_attributes";
authors = [
"Tokio Contributors <team@tokio.rs>"
"Eliza Weisman <eliza@buoyant.io>"
"David Barsky <dbarsky@amazon.com>"
];
dependencies = [
{
name = "proc-macro2";
packageId = "proc-macro2";
}
{
name = "quote";
packageId = "quote";
}
{
name = "syn";
packageId = "syn 2.0.48";
usesDefaultFeatures = false;
features = [ "full" "parsing" "printing" "visit-mut" "clone-impls" "extra-traits" "proc-macro" ];
}
];
features = { };
};
"tracing-core" = rec {
crateName = "tracing-core";
version = "0.1.32";
edition = "2018";
sha256 = "0m5aglin3cdwxpvbg6kz0r9r0k31j48n0kcfwsp6l49z26k3svf0";
libName = "tracing_core";
authors = [
"Tokio Contributors <team@tokio.rs>"
];
dependencies = [
{
name = "once_cell";
packageId = "once_cell";
optional = true;
}
];
features = {
"default" = [ "std" "valuable/std" ];
"once_cell" = [ "dep:once_cell" ];
"std" = [ "once_cell" ];
"valuable" = [ "dep:valuable" ];
};
resolvedDefaultFeatures = [ "once_cell" "std" ];
};
"typenum" = rec { "typenum" = rec {
crateName = "typenum"; crateName = "typenum";
version = "1.17.0"; version = "1.17.0";

View file

@ -331,9 +331,9 @@ dependencies = [
[[package]] [[package]]
name = "data-encoding" name = "data-encoding"
version = "2.5.0" version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2"
[[package]] [[package]]
name = "der" name = "der"
@ -658,6 +658,16 @@ version = "0.2.153"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libmimalloc-sys"
version = "0.1.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44"
dependencies = [
"cc",
"libc",
]
[[package]] [[package]]
name = "litrs" name = "litrs"
version = "0.4.1" version = "0.4.1"
@ -692,6 +702,15 @@ version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "mimalloc"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633"
dependencies = [
"libmimalloc-sys",
]
[[package]] [[package]]
name = "mime" name = "mime"
version = "0.3.17" version = "0.3.17"
@ -746,6 +765,7 @@ dependencies = [
"ed25519-dalek", "ed25519-dalek",
"enum-primitive-derive", "enum-primitive-derive",
"glob", "glob",
"mimalloc",
"nom", "nom",
"num-traits", "num-traits",
"pin-project-lite", "pin-project-lite",
@ -754,6 +774,7 @@ dependencies = [
"sha2", "sha2",
"thiserror", "thiserror",
"tokio", "tokio",
"tracing",
] ]
[[package]] [[package]]

View file

@ -1,4 +1,4 @@
# This file was @generated by crate2nix 0.13.0 with the command: # This file was @generated by crate2nix 0.14.1 with the command:
# "generate" "--all-features" # "generate" "--all-features"
# See https://github.com/kolloch/crate2nix for more info. # See https://github.com/kolloch/crate2nix for more info.
@ -13,6 +13,8 @@
, rootFeatures ? [ "default" ] , rootFeatures ? [ "default" ]
# If true, throw errors instead of issueing deprecation warnings. # If true, throw errors instead of issueing deprecation warnings.
, strictDeprecation ? false , strictDeprecation ? false
# Elements to add to the `-C target-feature=` argument passed to `rustc`
# (separated by `,`, prefixed with `+`).
# Used for conditional compilation based on CPU feature detection. # Used for conditional compilation based on CPU feature detection.
, targetFeatures ? [ ] , targetFeatures ? [ ]
# Whether to perform release builds: longer compile times, faster binaries. # Whether to perform release builds: longer compile times, faster binaries.
@ -181,6 +183,7 @@ rec {
version = "0.2.3"; version = "0.2.3";
edition = "2021"; edition = "2021";
sha256 = "134jhzrz89labrdwxxnjxqjdg06qvaflj1wkfnmyapwyldfwcnn7"; sha256 = "134jhzrz89labrdwxxnjxqjdg06qvaflj1wkfnmyapwyldfwcnn7";
libName = "anstyle_parse";
dependencies = [ dependencies = [
{ {
name = "utf8parse"; name = "utf8parse";
@ -200,6 +203,7 @@ rec {
version = "1.0.2"; version = "1.0.2";
edition = "2021"; edition = "2021";
sha256 = "0j3na4b1nma39g4x7cwvj009awxckjf3z2vkwhldgka44hqj72g2"; sha256 = "0j3na4b1nma39g4x7cwvj009awxckjf3z2vkwhldgka44hqj72g2";
libName = "anstyle_query";
dependencies = [ dependencies = [
{ {
name = "windows-sys"; name = "windows-sys";
@ -215,6 +219,7 @@ rec {
version = "3.0.2"; version = "3.0.2";
edition = "2021"; edition = "2021";
sha256 = "19v0fv400bmp4niqpzxnhg83vz12mmqv7l2l8vi80qcdxj0lpm8w"; sha256 = "19v0fv400bmp4niqpzxnhg83vz12mmqv7l2l8vi80qcdxj0lpm8w";
libName = "anstyle_wincon";
dependencies = [ dependencies = [
{ {
name = "anstyle"; name = "anstyle";
@ -234,6 +239,7 @@ rec {
version = "0.3.5"; version = "0.3.5";
edition = "2018"; edition = "2018";
sha256 = "0l8sjq1rylkb1ak0pdyjn83b3k6x36j22myngl4sqqgg7whdsmnd"; sha256 = "0l8sjq1rylkb1ak0pdyjn83b3k6x36j22myngl4sqqgg7whdsmnd";
libName = "async_stream";
authors = [ authors = [
"Carl Lerche <me@carllerche.com>" "Carl Lerche <me@carllerche.com>"
]; ];
@ -259,6 +265,7 @@ rec {
edition = "2018"; edition = "2018";
sha256 = "14q179j4y8p2z1d0ic6aqgy9fhwz8p9cai1ia8kpw4bw7q12mrhn"; sha256 = "14q179j4y8p2z1d0ic6aqgy9fhwz8p9cai1ia8kpw4bw7q12mrhn";
procMacro = true; procMacro = true;
libName = "async_stream_impl";
authors = [ authors = [
"Carl Lerche <me@carllerche.com>" "Carl Lerche <me@carllerche.com>"
]; ];
@ -285,6 +292,7 @@ rec {
edition = "2021"; edition = "2021";
sha256 = "1adf1jh2yg39rkpmqjqyr9xyd6849p0d95425i6imgbhx0syx069"; sha256 = "1adf1jh2yg39rkpmqjqyr9xyd6849p0d95425i6imgbhx0syx069";
procMacro = true; procMacro = true;
libName = "async_trait";
authors = [ authors = [
"David Tolnay <dtolnay@gmail.com>" "David Tolnay <dtolnay@gmail.com>"
]; ];
@ -497,6 +505,7 @@ rec {
version = "0.4.3"; version = "0.4.3";
edition = "2021"; edition = "2021";
sha256 = "1qx28wg4j6qdcdrisqwyaavlzc0zvbsrcwa99zf9456lfbyn6p51"; sha256 = "1qx28wg4j6qdcdrisqwyaavlzc0zvbsrcwa99zf9456lfbyn6p51";
libName = "axum_core";
dependencies = [ dependencies = [
{ {
name = "async-trait"; name = "async-trait";
@ -682,6 +691,7 @@ rec {
version = "0.10.4"; version = "0.10.4";
edition = "2018"; edition = "2018";
sha256 = "0w9sa2ypmrsqqvc20nhwr75wbb5cjr4kkyhpjm1z1lv2kdicfy1h"; sha256 = "0w9sa2ypmrsqqvc20nhwr75wbb5cjr4kkyhpjm1z1lv2kdicfy1h";
libName = "block_buffer";
authors = [ authors = [
"RustCrypto Developers" "RustCrypto Developers"
]; ];
@ -764,6 +774,7 @@ rec {
version = "1.0.0"; version = "1.0.0";
edition = "2018"; edition = "2018";
sha256 = "1za0vb97n4brpzpv8lsbnzmq5r8f2b0cpqqr0sy8h5bn751xxwds"; sha256 = "1za0vb97n4brpzpv8lsbnzmq5r8f2b0cpqqr0sy8h5bn751xxwds";
libName = "cfg_if";
authors = [ authors = [
"Alex Crichton <alex@alexcrichton.com>" "Alex Crichton <alex@alexcrichton.com>"
]; ];
@ -902,6 +913,7 @@ rec {
version = "0.9.6"; version = "0.9.6";
edition = "2021"; edition = "2021";
sha256 = "1y0jnqaq7p2wvspnx7qj76m7hjcqpz73qzvr9l2p9n2s51vr6if2"; sha256 = "1y0jnqaq7p2wvspnx7qj76m7hjcqpz73qzvr9l2p9n2s51vr6if2";
libName = "const_oid";
authors = [ authors = [
"RustCrypto Developers" "RustCrypto Developers"
]; ];
@ -921,7 +933,7 @@ rec {
{ {
name = "libc"; name = "libc";
packageId = "libc"; packageId = "libc";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-linux-android"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "aarch64-linux-android");
} }
{ {
name = "libc"; name = "libc";
@ -946,6 +958,7 @@ rec {
version = "0.1.6"; version = "0.1.6";
edition = "2018"; edition = "2018";
sha256 = "1cvby95a6xg7kxdz5ln3rl9xh66nz66w46mm3g56ri1z5x815yqv"; sha256 = "1cvby95a6xg7kxdz5ln3rl9xh66nz66w46mm3g56ri1z5x815yqv";
libName = "crypto_common";
authors = [ authors = [
"RustCrypto Developers" "RustCrypto Developers"
]; ];
@ -971,6 +984,7 @@ rec {
version = "4.1.2"; version = "4.1.2";
edition = "2021"; edition = "2021";
sha256 = "0j7kqchcgycs4a11gvlda93h9w2jr05nn4hjpfyh2kn94a4pnrqa"; sha256 = "0j7kqchcgycs4a11gvlda93h9w2jr05nn4hjpfyh2kn94a4pnrqa";
libName = "curve25519_dalek";
authors = [ authors = [
"Isis Lovecruft <isis@patternsinthevoid.net>" "Isis Lovecruft <isis@patternsinthevoid.net>"
"Henry de Valence <hdevalence@hdevalence.ca>" "Henry de Valence <hdevalence@hdevalence.ca>"
@ -1043,6 +1057,7 @@ rec {
edition = "2021"; edition = "2021";
sha256 = "1cry71xxrr0mcy5my3fb502cwfxy6822k4pm19cwrilrg7hq4s7l"; sha256 = "1cry71xxrr0mcy5my3fb502cwfxy6822k4pm19cwrilrg7hq4s7l";
procMacro = true; procMacro = true;
libName = "curve25519_dalek_derive";
dependencies = [ dependencies = [
{ {
name = "proc-macro2"; name = "proc-macro2";
@ -1062,9 +1077,10 @@ rec {
}; };
"data-encoding" = rec { "data-encoding" = rec {
crateName = "data-encoding"; crateName = "data-encoding";
version = "2.5.0"; version = "2.6.0";
edition = "2018"; edition = "2018";
sha256 = "1rcbnwfmfxhlshzbn3r7srm3azqha3mn33yxyqxkzz2wpqcjm5ky"; sha256 = "1qnn68n4vragxaxlkqcb1r28d3hhj43wch67lm4rpxlw89wnjmp8";
libName = "data_encoding";
authors = [ authors = [
"Julien Cretin <git@ia0.eu>" "Julien Cretin <git@ia0.eu>"
]; ];
@ -1149,6 +1165,7 @@ rec {
edition = "2018"; edition = "2018";
sha256 = "15cvgxqngxslgllz15m8aban6wqfgsi6nlhr0g25yfsnd6nq4lpg"; sha256 = "15cvgxqngxslgllz15m8aban6wqfgsi6nlhr0g25yfsnd6nq4lpg";
procMacro = true; procMacro = true;
libName = "document_features";
libPath = "lib.rs"; libPath = "lib.rs";
authors = [ authors = [
"Slint Developers <info@slint-ui.com>" "Slint Developers <info@slint-ui.com>"
@ -1200,6 +1217,7 @@ rec {
version = "2.1.1"; version = "2.1.1";
edition = "2021"; edition = "2021";
sha256 = "0w88cafwglg9hjizldbmlza0ns3hls81zk1bcih3m5m3h67algaa"; sha256 = "0w88cafwglg9hjizldbmlza0ns3hls81zk1bcih3m5m3h67algaa";
libName = "ed25519_dalek";
authors = [ authors = [
"isis lovecruft <isis@patternsinthevoid.net>" "isis lovecruft <isis@patternsinthevoid.net>"
"Tony Arcieri <bascule@gmail.com>" "Tony Arcieri <bascule@gmail.com>"
@ -1278,6 +1296,7 @@ rec {
edition = "2018"; edition = "2018";
sha256 = "0k6wcf58h5kh64yq5nfq71va53kaya0kzxwsjwbgwm2n2zd9axxs"; sha256 = "0k6wcf58h5kh64yq5nfq71va53kaya0kzxwsjwbgwm2n2zd9axxs";
procMacro = true; procMacro = true;
libName = "enum_primitive_derive";
authors = [ authors = [
"Doug Goldstein <cardoe@cardoe.com>" "Doug Goldstein <cardoe@cardoe.com>"
]; ];
@ -1310,6 +1329,7 @@ rec {
version = "0.2.6"; version = "0.2.6";
edition = "2018"; edition = "2018";
sha256 = "10hkkkjynhibvchznkxx81gwxqarn9i5sgz40d6xxb8xzhsz8xhn"; sha256 = "10hkkkjynhibvchznkxx81gwxqarn9i5sgz40d6xxb8xzhsz8xhn";
libName = "fiat_crypto";
authors = [ authors = [
"Fiat Crypto library authors <jgross@mit.edu>" "Fiat Crypto library authors <jgross@mit.edu>"
]; ];
@ -1358,6 +1378,7 @@ rec {
version = "0.3.30"; version = "0.3.30";
edition = "2018"; edition = "2018";
sha256 = "0y6b7xxqdjm9hlcjpakcg41qfl7lihf6gavk8fyqijsxhvbzgj7a"; sha256 = "0y6b7xxqdjm9hlcjpakcg41qfl7lihf6gavk8fyqijsxhvbzgj7a";
libName = "futures_channel";
dependencies = [ dependencies = [
{ {
name = "futures-core"; name = "futures-core";
@ -1379,6 +1400,7 @@ rec {
version = "0.3.30"; version = "0.3.30";
edition = "2018"; edition = "2018";
sha256 = "07aslayrn3lbggj54kci0ishmd1pr367fp7iks7adia1p05miinz"; sha256 = "07aslayrn3lbggj54kci0ishmd1pr367fp7iks7adia1p05miinz";
libName = "futures_core";
features = { features = {
"default" = [ "std" ]; "default" = [ "std" ];
"portable-atomic" = [ "dep:portable-atomic" ]; "portable-atomic" = [ "dep:portable-atomic" ];
@ -1392,6 +1414,7 @@ rec {
edition = "2018"; edition = "2018";
sha256 = "1b49qh9d402y8nka4q6wvvj0c88qq91wbr192mdn5h54nzs0qxc7"; sha256 = "1b49qh9d402y8nka4q6wvvj0c88qq91wbr192mdn5h54nzs0qxc7";
procMacro = true; procMacro = true;
libName = "futures_macro";
dependencies = [ dependencies = [
{ {
name = "proc-macro2"; name = "proc-macro2";
@ -1414,6 +1437,7 @@ rec {
version = "0.3.30"; version = "0.3.30";
edition = "2018"; edition = "2018";
sha256 = "1dag8xyyaya8n8mh8smx7x6w2dpmafg2din145v973a3hw7f1f4z"; sha256 = "1dag8xyyaya8n8mh8smx7x6w2dpmafg2din145v973a3hw7f1f4z";
libName = "futures_sink";
features = { features = {
"default" = [ "std" ]; "default" = [ "std" ];
"std" = [ "alloc" ]; "std" = [ "alloc" ];
@ -1425,6 +1449,7 @@ rec {
version = "0.3.30"; version = "0.3.30";
edition = "2018"; edition = "2018";
sha256 = "013h1724454hj8qczp8vvs10qfiqrxr937qsrv6rhii68ahlzn1q"; sha256 = "013h1724454hj8qczp8vvs10qfiqrxr937qsrv6rhii68ahlzn1q";
libName = "futures_task";
features = { features = {
"default" = [ "std" ]; "default" = [ "std" ];
"std" = [ "alloc" ]; "std" = [ "alloc" ];
@ -1436,6 +1461,7 @@ rec {
version = "0.3.30"; version = "0.3.30";
edition = "2018"; edition = "2018";
sha256 = "0j0xqhcir1zf2dcbpd421kgw6wvsk0rpxflylcysn1rlp3g02r1x"; sha256 = "0j0xqhcir1zf2dcbpd421kgw6wvsk0rpxflylcysn1rlp3g02r1x";
libName = "futures_util";
dependencies = [ dependencies = [
{ {
name = "futures-core"; name = "futures-core";
@ -1690,6 +1716,7 @@ rec {
version = "0.3.9"; version = "0.3.9";
edition = "2021"; edition = "2021";
sha256 = "092hxjbjnq5fmz66grd9plxd0sh6ssg5fhgwwwqbrzgzkjwdycfj"; sha256 = "092hxjbjnq5fmz66grd9plxd0sh6ssg5fhgwwwqbrzgzkjwdycfj";
libName = "hermit_abi";
authors = [ authors = [
"Stefan Lankes" "Stefan Lankes"
]; ];
@ -1735,6 +1762,7 @@ rec {
version = "1.0.0"; version = "1.0.0";
edition = "2018"; edition = "2018";
sha256 = "0hyn8n3iadrbwq8y0p1rl1275s4nm49bllw5wji29g4aa3dqbb0w"; sha256 = "0hyn8n3iadrbwq8y0p1rl1275s4nm49bllw5wji29g4aa3dqbb0w";
libName = "http_body";
authors = [ authors = [
"Carl Lerche <me@carllerche.com>" "Carl Lerche <me@carllerche.com>"
"Lucio Franco <luciofranco14@gmail.com>" "Lucio Franco <luciofranco14@gmail.com>"
@ -1757,6 +1785,7 @@ rec {
version = "0.1.1"; version = "0.1.1";
edition = "2018"; edition = "2018";
sha256 = "07agldas2qgcfc05ckiarlmf9vzragbda823nqhrqrc6mjrghx84"; sha256 = "07agldas2qgcfc05ckiarlmf9vzragbda823nqhrqrc6mjrghx84";
libName = "http_body_util";
authors = [ authors = [
"Carl Lerche <me@carllerche.com>" "Carl Lerche <me@carllerche.com>"
"Lucio Franco <luciofranco14@gmail.com>" "Lucio Franco <luciofranco14@gmail.com>"
@ -1912,6 +1941,7 @@ rec {
version = "0.1.3"; version = "0.1.3";
edition = "2021"; edition = "2021";
sha256 = "1akngan7j0n2n0wd25c6952mvqbkj9gp1lcwzyxjc0d37l8yyf6a"; sha256 = "1akngan7j0n2n0wd25c6952mvqbkj9gp1lcwzyxjc0d37l8yyf6a";
libName = "hyper_util";
authors = [ authors = [
"Sean McArthur <sean@seanmonstar.com>" "Sean McArthur <sean@seanmonstar.com>"
]; ];
@ -2053,6 +2083,33 @@ rec {
}; };
resolvedDefaultFeatures = [ "default" "extra_traits" "std" ]; resolvedDefaultFeatures = [ "default" "extra_traits" "std" ];
}; };
"libmimalloc-sys" = rec {
crateName = "libmimalloc-sys";
version = "0.1.39";
edition = "2018";
links = "mimalloc";
sha256 = "0i3b0dzz7cp0ik7ys66q92r16va78gwlbrnxhj5fnkdxsc8niai3";
libName = "libmimalloc_sys";
authors = [
"Octavian Oncescu <octavonce@gmail.com>"
];
dependencies = [
{
name = "libc";
packageId = "libc";
}
];
buildDependencies = [
{
name = "cc";
packageId = "cc";
}
];
features = {
"cty" = [ "dep:cty" ];
"extended" = [ "cty" ];
};
};
"litrs" = rec { "litrs" = rec {
crateName = "litrs"; crateName = "litrs";
version = "0.4.1"; version = "0.4.1";
@ -2150,6 +2207,34 @@ rec {
}; };
resolvedDefaultFeatures = [ "alloc" "default" "std" ]; resolvedDefaultFeatures = [ "alloc" "default" "std" ];
}; };
"mimalloc" = rec {
crateName = "mimalloc";
version = "0.1.43";
edition = "2018";
sha256 = "0csnyrxc16i592gm5ffham07jyj2w98qsh9jyy1rv59lmr8474b8";
authors = [
"Octavian Oncescu <octavonce@gmail.com>"
"Vincent Rouillé <vincent@speedy37.fr>"
"Thom Chiovoloni <chiovolonit@gmail.com>"
];
dependencies = [
{
name = "libmimalloc-sys";
packageId = "libmimalloc-sys";
usesDefaultFeatures = false;
}
];
features = {
"debug" = [ "libmimalloc-sys/debug" ];
"debug_in_debug" = [ "libmimalloc-sys/debug_in_debug" ];
"extended" = [ "libmimalloc-sys/extended" ];
"local_dynamic_tls" = [ "libmimalloc-sys/local_dynamic_tls" ];
"no_thp" = [ "libmimalloc-sys/no_thp" ];
"override" = [ "libmimalloc-sys/override" ];
"secure" = [ "libmimalloc-sys/secure" ];
};
resolvedDefaultFeatures = [ "default" ];
};
"mime" = rec { "mime" = rec {
crateName = "mime"; crateName = "mime";
version = "0.3.17"; version = "0.3.17";
@ -2165,6 +2250,7 @@ rec {
version = "0.2.1"; version = "0.2.1";
edition = "2018"; edition = "2018";
sha256 = "16ppc5g84aijpri4jzv14rvcnslvlpphbszc7zzp6vfkddf4qdb8"; sha256 = "16ppc5g84aijpri4jzv14rvcnslvlpphbszc7zzp6vfkddf4qdb8";
libName = "minimal_lexical";
authors = [ authors = [
"Alex Huszagh <ahuszagh@gmail.com>" "Alex Huszagh <ahuszagh@gmail.com>"
]; ];
@ -2286,12 +2372,8 @@ rec {
version = "0.1.0"; version = "0.1.0";
edition = "2021"; edition = "2021";
crateBin = [ ]; crateBin = [ ];
# We can't filter paths with references in Nix 2.4 src = lib.cleanSourceWith { filter = sourceFilter; src = ../../../tvix/nix-compat; };
# See https://github.com/NixOS/nix/issues/5410 libName = "nix_compat";
src =
if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
then lib.cleanSourceWith { filter = sourceFilter; src = ../../../tvix/nix-compat; }
else ../../../tvix/nix-compat;
dependencies = [ dependencies = [
{ {
name = "bitflags"; name = "bitflags";
@ -2322,6 +2404,10 @@ rec {
name = "glob"; name = "glob";
packageId = "glob"; packageId = "glob";
} }
{
name = "mimalloc";
packageId = "mimalloc";
}
{ {
name = "nom"; name = "nom";
packageId = "nom"; packageId = "nom";
@ -2358,8 +2444,16 @@ rec {
optional = true; optional = true;
features = [ "io-util" "macros" ]; features = [ "io-util" "macros" ];
} }
{
name = "tracing";
packageId = "tracing";
}
]; ];
devDependencies = [ devDependencies = [
{
name = "mimalloc";
packageId = "mimalloc";
}
{ {
name = "serde_json"; name = "serde_json";
packageId = "serde_json"; packageId = "serde_json";
@ -2367,11 +2461,12 @@ rec {
]; ];
features = { features = {
"async" = [ "tokio" ]; "async" = [ "tokio" ];
"default" = [ "async" "wire" ];
"pin-project-lite" = [ "dep:pin-project-lite" ]; "pin-project-lite" = [ "dep:pin-project-lite" ];
"tokio" = [ "dep:tokio" ]; "tokio" = [ "dep:tokio" ];
"wire" = [ "tokio" "pin-project-lite" ]; "wire" = [ "tokio" "pin-project-lite" ];
}; };
resolvedDefaultFeatures = [ "pin-project-lite" "tokio" "wire" ]; resolvedDefaultFeatures = [ "async" "default" "pin-project-lite" "tokio" "wire" ];
}; };
"nom" = rec { "nom" = rec {
crateName = "nom"; crateName = "nom";
@ -2404,6 +2499,7 @@ rec {
version = "0.46.0"; version = "0.46.0";
edition = "2018"; edition = "2018";
sha256 = "115sywxh53p190lyw97alm14nc004qj5jm5lvdj608z84rbida3p"; sha256 = "115sywxh53p190lyw97alm14nc004qj5jm5lvdj608z84rbida3p";
libName = "nu_ansi_term";
authors = [ authors = [
"ogham@bsago.me" "ogham@bsago.me"
"Ryan Scheel (Havvy) <ryan.havvy@gmail.com>" "Ryan Scheel (Havvy) <ryan.havvy@gmail.com>"
@ -2432,6 +2528,7 @@ rec {
version = "0.2.18"; version = "0.2.18";
edition = "2018"; edition = "2018";
sha256 = "0yjib8p2p9kzmaz48xwhs69w5dh1wipph9jgnillzd2x33jz03fs"; sha256 = "0yjib8p2p9kzmaz48xwhs69w5dh1wipph9jgnillzd2x33jz03fs";
libName = "num_traits";
authors = [ authors = [
"The Rust Project Developers" "The Rust Project Developers"
]; ];
@ -2602,6 +2699,7 @@ rec {
version = "2.3.1"; version = "2.3.1";
edition = "2018"; edition = "2018";
sha256 = "0gi8wgx0dcy8rnv1kywdv98lwcx67hz0a0zwpib5v2i08r88y573"; sha256 = "0gi8wgx0dcy8rnv1kywdv98lwcx67hz0a0zwpib5v2i08r88y573";
libName = "percent_encoding";
authors = [ authors = [
"The rust-url developers" "The rust-url developers"
]; ];
@ -2616,6 +2714,7 @@ rec {
version = "1.1.5"; version = "1.1.5";
edition = "2021"; edition = "2021";
sha256 = "1cxl146x0q7lawp0m1826wsgj8mmmfs6ja8q7m6f7ff5j6vl7gxn"; sha256 = "1cxl146x0q7lawp0m1826wsgj8mmmfs6ja8q7m6f7ff5j6vl7gxn";
libName = "pin_project";
dependencies = [ dependencies = [
{ {
name = "pin-project-internal"; name = "pin-project-internal";
@ -2630,6 +2729,7 @@ rec {
edition = "2021"; edition = "2021";
sha256 = "0r9r4ivwiyqf45sv6b30l1dx282lxaax2f6gl84jwa3q590s8f1g"; sha256 = "0r9r4ivwiyqf45sv6b30l1dx282lxaax2f6gl84jwa3q590s8f1g";
procMacro = true; procMacro = true;
libName = "pin_project_internal";
dependencies = [ dependencies = [
{ {
name = "proc-macro2"; name = "proc-macro2";
@ -2652,6 +2752,7 @@ rec {
version = "0.2.13"; version = "0.2.13";
edition = "2018"; edition = "2018";
sha256 = "0n0bwr5qxlf0mhn2xkl36sy55118s9qmvx2yl5f3ixkb007lbywa"; sha256 = "0n0bwr5qxlf0mhn2xkl36sy55118s9qmvx2yl5f3ixkb007lbywa";
libName = "pin_project_lite";
}; };
"pin-utils" = rec { "pin-utils" = rec {
@ -2659,6 +2760,7 @@ rec {
version = "0.1.0"; version = "0.1.0";
edition = "2018"; edition = "2018";
sha256 = "117ir7vslsl2z1a7qzhws4pd01cg2d3338c47swjyvqv2n60v1wb"; sha256 = "117ir7vslsl2z1a7qzhws4pd01cg2d3338c47swjyvqv2n60v1wb";
libName = "pin_utils";
authors = [ authors = [
"Josef Brandl <mail@josefbrandl.de>" "Josef Brandl <mail@josefbrandl.de>"
]; ];
@ -2718,6 +2820,7 @@ rec {
version = "1.0.79"; version = "1.0.79";
edition = "2021"; edition = "2021";
sha256 = "0bn004ybzdqid81cqppr5c9jrvqsxv50x60sxc41cwpmk0igydg8"; sha256 = "0bn004ybzdqid81cqppr5c9jrvqsxv50x60sxc41cwpmk0igydg8";
libName = "proc_macro2";
authors = [ authors = [
"David Tolnay <dtolnay@gmail.com>" "David Tolnay <dtolnay@gmail.com>"
"Alex Crichton <alex@alexcrichton.com>" "Alex Crichton <alex@alexcrichton.com>"
@ -2803,6 +2906,7 @@ rec {
version = "0.4.6"; version = "0.4.6";
edition = "2021"; edition = "2021";
sha256 = "1spaq7y4im7s56d1gxa2hi4hzf6dwswb1bv8xyavzya7k25kpf46"; sha256 = "1spaq7y4im7s56d1gxa2hi4hzf6dwswb1bv8xyavzya7k25kpf46";
libName = "regex_automata";
authors = [ authors = [
"The Rust Project Developers" "The Rust Project Developers"
"Andrew Gallant <jamslam@gmail.com>" "Andrew Gallant <jamslam@gmail.com>"
@ -2843,6 +2947,7 @@ rec {
version = "0.1.23"; version = "0.1.23";
edition = "2015"; edition = "2015";
sha256 = "0xnbk2bmyzshacjm2g1kd4zzv2y2az14bw3sjccq5qkpmsfvn9nn"; sha256 = "0xnbk2bmyzshacjm2g1kd4zzv2y2az14bw3sjccq5qkpmsfvn9nn";
libName = "rustc_demangle";
authors = [ authors = [
"Alex Crichton <alex@alexcrichton.com>" "Alex Crichton <alex@alexcrichton.com>"
]; ];
@ -3119,6 +3224,7 @@ rec {
version = "0.1.7"; version = "0.1.7";
edition = "2018"; edition = "2018";
sha256 = "1xipjr4nqsgw34k7a2cgj9zaasl2ds6jwn89886kww93d32a637l"; sha256 = "1xipjr4nqsgw34k7a2cgj9zaasl2ds6jwn89886kww93d32a637l";
libName = "sharded_slab";
authors = [ authors = [
"Eliza Weisman <eliza@buoyant.io>" "Eliza Weisman <eliza@buoyant.io>"
]; ];
@ -3137,6 +3243,7 @@ rec {
version = "1.4.1"; version = "1.4.1";
edition = "2015"; edition = "2015";
sha256 = "18crkkw5k82bvcx088xlf5g4n3772m24qhzgfan80nda7d3rn8nq"; sha256 = "18crkkw5k82bvcx088xlf5g4n3772m24qhzgfan80nda7d3rn8nq";
libName = "signal_hook_registry";
authors = [ authors = [
"Michal 'vorner' Vaner <vorner@vorner.cz>" "Michal 'vorner' Vaner <vorner@vorner.cz>"
"Masaki Hara <ackie.h.gmai@gmail.com>" "Masaki Hara <ackie.h.gmai@gmail.com>"
@ -3359,6 +3466,7 @@ rec {
edition = "2021"; edition = "2021";
sha256 = "1xylyqcb8rv5yh2yf97hg4n4kg27qccc0ijafr1zqklrhahkn7y6"; sha256 = "1xylyqcb8rv5yh2yf97hg4n4kg27qccc0ijafr1zqklrhahkn7y6";
procMacro = true; procMacro = true;
libName = "thiserror_impl";
authors = [ authors = [
"David Tolnay <dtolnay@gmail.com>" "David Tolnay <dtolnay@gmail.com>"
]; ];
@ -3513,6 +3621,7 @@ rec {
version = "0.3.2"; version = "0.3.2";
edition = "2021"; edition = "2021";
sha256 = "00vkr1cywd2agn8jbkzwwf7y4ps3cfjm8l9ab697px2cgc97wdln"; sha256 = "00vkr1cywd2agn8jbkzwwf7y4ps3cfjm8l9ab697px2cgc97wdln";
libName = "tokio_listener";
dependencies = [ dependencies = [
{ {
name = "axum"; name = "axum";
@ -3598,6 +3707,7 @@ rec {
edition = "2021"; edition = "2021";
sha256 = "0fwjy4vdx1h9pi4g2nml72wi0fr27b5m954p13ji9anyy8l1x2jv"; sha256 = "0fwjy4vdx1h9pi4g2nml72wi0fr27b5m954p13ji9anyy8l1x2jv";
procMacro = true; procMacro = true;
libName = "tokio_macros";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -3623,6 +3733,7 @@ rec {
version = "0.1.14"; version = "0.1.14";
edition = "2021"; edition = "2021";
sha256 = "0hi8hcwavh5sdi1ivc9qc4yvyr32f153c212dpd7sb366y6rhz1r"; sha256 = "0hi8hcwavh5sdi1ivc9qc4yvyr32f153c212dpd7sb366y6rhz1r";
libName = "tokio_stream";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -3666,6 +3777,7 @@ rec {
version = "0.4.4"; version = "0.4.4";
edition = "2021"; edition = "2021";
sha256 = "1xzri2m3dg8nzdyznm77nymvil9cyh1gfdfrbnska51iqfmvls14"; sha256 = "1xzri2m3dg8nzdyznm77nymvil9cyh1gfdfrbnska51iqfmvls14";
libName = "tokio_test";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -3706,6 +3818,7 @@ rec {
version = "0.7.10"; version = "0.7.10";
edition = "2021"; edition = "2021";
sha256 = "058y6x4mf0fsqji9rfyb77qbfyc50y4pk2spqgj6xsyr693z66al"; sha256 = "058y6x4mf0fsqji9rfyb77qbfyc50y4pk2spqgj6xsyr693z66al";
libName = "tokio_util";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -3867,6 +3980,7 @@ rec {
version = "0.3.2"; version = "0.3.2";
edition = "2018"; edition = "2018";
sha256 = "1l7i17k9vlssrdg4s3b0ia5jjkmmxsvv8s9y9ih0jfi8ssz8s362"; sha256 = "1l7i17k9vlssrdg4s3b0ia5jjkmmxsvv8s9y9ih0jfi8ssz8s362";
libName = "tower_layer";
authors = [ authors = [
"Tower Maintainers <team@tower-rs.com>" "Tower Maintainers <team@tower-rs.com>"
]; ];
@ -3877,6 +3991,7 @@ rec {
version = "0.3.2"; version = "0.3.2";
edition = "2018"; edition = "2018";
sha256 = "0lmfzmmvid2yp2l36mbavhmqgsvzqf7r2wiwz73ml4xmwaf1rg5n"; sha256 = "0lmfzmmvid2yp2l36mbavhmqgsvzqf7r2wiwz73ml4xmwaf1rg5n";
libName = "tower_service";
authors = [ authors = [
"Tower Maintainers <team@tower-rs.com>" "Tower Maintainers <team@tower-rs.com>"
]; ];
@ -3935,6 +4050,7 @@ rec {
edition = "2018"; edition = "2018";
sha256 = "1rvb5dn9z6d0xdj14r403z0af0bbaqhg02hq4jc97g5wds6lqw1l"; sha256 = "1rvb5dn9z6d0xdj14r403z0af0bbaqhg02hq4jc97g5wds6lqw1l";
procMacro = true; procMacro = true;
libName = "tracing_attributes";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
"Eliza Weisman <eliza@buoyant.io>" "Eliza Weisman <eliza@buoyant.io>"
@ -3963,6 +4079,7 @@ rec {
version = "0.1.32"; version = "0.1.32";
edition = "2018"; edition = "2018";
sha256 = "0m5aglin3cdwxpvbg6kz0r9r0k31j48n0kcfwsp6l49z26k3svf0"; sha256 = "0m5aglin3cdwxpvbg6kz0r9r0k31j48n0kcfwsp6l49z26k3svf0";
libName = "tracing_core";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -3993,6 +4110,7 @@ rec {
version = "0.2.0"; version = "0.2.0";
edition = "2018"; edition = "2018";
sha256 = "1hs77z026k730ij1a9dhahzrl0s073gfa2hm5p0fbl0b80gmz1gf"; sha256 = "1hs77z026k730ij1a9dhahzrl0s073gfa2hm5p0fbl0b80gmz1gf";
libName = "tracing_log";
authors = [ authors = [
"Tokio Contributors <team@tokio.rs>" "Tokio Contributors <team@tokio.rs>"
]; ];
@ -4024,6 +4142,7 @@ rec {
version = "0.3.18"; version = "0.3.18";
edition = "2018"; edition = "2018";
sha256 = "12vs1bwk4kig1l2qqjbbn2nm5amwiqmkcmnznylzmnfvjy6083xd"; sha256 = "12vs1bwk4kig1l2qqjbbn2nm5amwiqmkcmnznylzmnfvjy6083xd";
libName = "tracing_subscriber";
authors = [ authors = [
"Eliza Weisman <eliza@buoyant.io>" "Eliza Weisman <eliza@buoyant.io>"
"David Barsky <me@davidbarsky.com>" "David Barsky <me@davidbarsky.com>"
@ -4110,12 +4229,7 @@ rec {
requiredFeatures = [ ]; requiredFeatures = [ ];
} }
]; ];
# We can't filter paths with references in Nix 2.4 src = lib.cleanSourceWith { filter = sourceFilter; src = ./.; };
# See https://github.com/NixOS/nix/issues/5410
src =
if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion))
then lib.cleanSourceWith { filter = sourceFilter; src = ./.; }
else ./.;
dependencies = [ dependencies = [
{ {
name = "clap"; name = "clap";
@ -4173,6 +4287,7 @@ rec {
version = "1.0.12"; version = "1.0.12";
edition = "2018"; edition = "2018";
sha256 = "0jzf1znfpb2gx8nr8mvmyqs1crnv79l57nxnbiszc7xf7ynbjm1k"; sha256 = "0jzf1znfpb2gx8nr8mvmyqs1crnv79l57nxnbiszc7xf7ynbjm1k";
libName = "unicode_ident";
authors = [ authors = [
"David Tolnay <dtolnay@gmail.com>" "David Tolnay <dtolnay@gmail.com>"
]; ];
@ -4242,12 +4357,12 @@ rec {
{ {
name = "winapi-i686-pc-windows-gnu"; name = "winapi-i686-pc-windows-gnu";
packageId = "winapi-i686-pc-windows-gnu"; packageId = "winapi-i686-pc-windows-gnu";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "i686-pc-windows-gnu"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "i686-pc-windows-gnu");
} }
{ {
name = "winapi-x86_64-pc-windows-gnu"; name = "winapi-x86_64-pc-windows-gnu";
packageId = "winapi-x86_64-pc-windows-gnu"; packageId = "winapi-x86_64-pc-windows-gnu";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnu"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnu");
} }
]; ];
features = { features = {
@ -4260,6 +4375,7 @@ rec {
version = "0.4.0"; version = "0.4.0";
edition = "2015"; edition = "2015";
sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc"; sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc";
libName = "winapi_i686_pc_windows_gnu";
authors = [ authors = [
"Peter Atashian <retep998@gmail.com>" "Peter Atashian <retep998@gmail.com>"
]; ];
@ -4270,6 +4386,7 @@ rec {
version = "0.4.0"; version = "0.4.0";
edition = "2015"; edition = "2015";
sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki"; sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki";
libName = "winapi_x86_64_pc_windows_gnu";
authors = [ authors = [
"Peter Atashian <retep998@gmail.com>" "Peter Atashian <retep998@gmail.com>"
]; ];
@ -4280,6 +4397,7 @@ rec {
version = "0.48.0"; version = "0.48.0";
edition = "2018"; edition = "2018";
sha256 = "1aan23v5gs7gya1lc46hqn9mdh8yph3fhxmhxlw36pn6pqc28zb7"; sha256 = "1aan23v5gs7gya1lc46hqn9mdh8yph3fhxmhxlw36pn6pqc28zb7";
libName = "windows_sys";
authors = [ authors = [
"Microsoft" "Microsoft"
]; ];
@ -4573,6 +4691,7 @@ rec {
version = "0.52.0"; version = "0.52.0";
edition = "2021"; edition = "2021";
sha256 = "0gd3v4ji88490zgb6b5mq5zgbvwv7zx1ibn8v3x83rwcdbryaar8"; sha256 = "0gd3v4ji88490zgb6b5mq5zgbvwv7zx1ibn8v3x83rwcdbryaar8";
libName = "windows_sys";
authors = [ authors = [
"Microsoft" "Microsoft"
]; ];
@ -4820,6 +4939,7 @@ rec {
version = "0.48.5"; version = "0.48.5";
edition = "2018"; edition = "2018";
sha256 = "034ljxqshifs1lan89xwpcy1hp0lhdh4b5n0d2z4fwjx2piacbws"; sha256 = "034ljxqshifs1lan89xwpcy1hp0lhdh4b5n0d2z4fwjx2piacbws";
libName = "windows_targets";
authors = [ authors = [
"Microsoft" "Microsoft"
]; ];
@ -4827,7 +4947,7 @@ rec {
{ {
name = "windows_aarch64_gnullvm"; name = "windows_aarch64_gnullvm";
packageId = "windows_aarch64_gnullvm 0.48.5"; packageId = "windows_aarch64_gnullvm 0.48.5";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-pc-windows-gnullvm"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "aarch64-pc-windows-gnullvm");
} }
{ {
name = "windows_aarch64_msvc"; name = "windows_aarch64_msvc";
@ -4852,7 +4972,7 @@ rec {
{ {
name = "windows_x86_64_gnullvm"; name = "windows_x86_64_gnullvm";
packageId = "windows_x86_64_gnullvm 0.48.5"; packageId = "windows_x86_64_gnullvm 0.48.5";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnullvm"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnullvm");
} }
{ {
name = "windows_x86_64_msvc"; name = "windows_x86_64_msvc";
@ -4867,6 +4987,7 @@ rec {
version = "0.52.4"; version = "0.52.4";
edition = "2021"; edition = "2021";
sha256 = "06sdd7fin3dj9cmlg6n1dw0n1l10jhn9b8ckz1cqf0drb9z7plvx"; sha256 = "06sdd7fin3dj9cmlg6n1dw0n1l10jhn9b8ckz1cqf0drb9z7plvx";
libName = "windows_targets";
authors = [ authors = [
"Microsoft" "Microsoft"
]; ];
@ -4874,7 +4995,7 @@ rec {
{ {
name = "windows_aarch64_gnullvm"; name = "windows_aarch64_gnullvm";
packageId = "windows_aarch64_gnullvm 0.52.4"; packageId = "windows_aarch64_gnullvm 0.52.4";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "aarch64-pc-windows-gnullvm"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "aarch64-pc-windows-gnullvm");
} }
{ {
name = "windows_aarch64_msvc"; name = "windows_aarch64_msvc";
@ -4899,7 +5020,7 @@ rec {
{ {
name = "windows_x86_64_gnullvm"; name = "windows_x86_64_gnullvm";
packageId = "windows_x86_64_gnullvm 0.52.4"; packageId = "windows_x86_64_gnullvm 0.52.4";
target = { target, features }: (pkgs.rust.lib.toRustTarget stdenv.hostPlatform == "x86_64-pc-windows-gnullvm"); target = { target, features }: (stdenv.hostPlatform.rust.rustcTarget == "x86_64-pc-windows-gnullvm");
} }
{ {
name = "windows_x86_64_msvc"; name = "windows_x86_64_msvc";
@ -5081,14 +5202,11 @@ rec {
fuchsia = true; fuchsia = true;
test = false; test = false;
/* We are choosing an arbitrary rust version to grab `lib` from, inherit (platform.rust.platform)
which is unfortunate, but `lib` has been version-agnostic the arch
whole time so this is good enough for now. os
*/ vendor;
os = pkgs.rust.lib.toTargetOs platform; family = platform.rust.platform.target-family;
arch = pkgs.rust.lib.toTargetArch platform;
family = pkgs.rust.lib.toTargetFamily platform;
vendor = pkgs.rust.lib.toTargetVendor platform;
env = "gnu"; env = "gnu";
endian = endian =
if platform.parsed.cpu.significantByte.name == "littleEndian" if platform.parsed.cpu.significantByte.name == "littleEndian"
@ -5178,30 +5296,19 @@ rec {
testPostRun testPostRun
]); ]);
in in
pkgs.runCommand "run-tests-${testCrate.name}" pkgs.stdenvNoCC.mkDerivation {
{ name = "run-tests-${testCrate.name}";
inherit (crate) src;
inherit testCrateFlags; inherit testCrateFlags;
buildInputs = testInputs; buildInputs = testInputs;
} ''
buildPhase = ''
set -e set -e
export RUST_BACKTRACE=1 export RUST_BACKTRACE=1
# recreate a file hierarchy as when running tests with cargo
# the source for test data
# It's necessary to locate the source in $NIX_BUILD_TOP/source/
# instead of $NIX_BUILD_TOP/
# because we compiled those test binaries in the former and not the latter.
# So all paths will expect source tree to be there and not in the build top directly.
# For example: $NIX_BUILD_TOP := /build in general, if you ask yourself.
# TODO(raitobezarius): I believe there could be more edge cases if `crate.sourceRoot`
# do exist but it's very hard to reason about them, so let's wait until the first bug report.
mkdir -p source/
cd source/
${pkgs.buildPackages.xorg.lndir}/bin/lndir ${crate.src}
# build outputs # build outputs
testRoot=target/debug testRoot=target/debug
mkdir -p $testRoot mkdir -p $testRoot
@ -5223,6 +5330,7 @@ rec {
${testCommand} ${testCommand}
done done
''; '';
};
in in
pkgs.runCommand "${crate.name}-linked" pkgs.runCommand "${crate.name}-linked"
{ {
@ -5331,7 +5439,7 @@ rec {
let let
self = { self = {
crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs; crates = lib.mapAttrs (packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId) crateConfigs;
target = makeTarget pkgs.stdenv.hostPlatform; target = makeTarget stdenv.hostPlatform;
build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; build = mkBuiltByPackageIdByPkgs pkgs.buildPackages;
}; };
in in
@ -5406,8 +5514,6 @@ rec {
buildRustCrateForPkgsFunc pkgs buildRustCrateForPkgsFunc pkgs
( (
crateConfig // { crateConfig // {
# https://github.com/NixOS/nixpkgs/issues/218712
dontStrip = stdenv.hostPlatform.isDarwin;
src = crateConfig.src or ( src = crateConfig.src or (
pkgs.fetchurl rec { pkgs.fetchurl rec {
name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz";