Misc cleanup

This commit is contained in:
Zhaofeng Li 2023-05-22 16:00:34 -06:00
parent cbf329f087
commit 0cd6c9c059
6 changed files with 25 additions and 18 deletions

3
.cargo/config Normal file
View file

@ -0,0 +1,3 @@
# For -Zbuild-std
[target.aarch64-unknown-linux-musl]
rustflags = ["-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"]

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
.direnv
result*
/target
key.txt

1
Cargo.lock generated
View file

@ -737,7 +737,6 @@ dependencies = [
"clap",
"daemonize",
"gha-cache",
"rand",
"serde",
"serde_json",
"thiserror",

View file

@ -56,34 +56,39 @@ let
src = nix-gitignore.gitignoreSource [] ./.;
buildInputs = with pkgs; []
commonArgs = {
inherit (crateName) pname version;
inherit src;
buildInputs = with pkgs; []
++ lib.optionals pkgs.stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
# The Rust toolchain from rust-overlay has a dynamic libiconv in depsTargetTargetPropagated
# Our static libiconv needs to take precedence
nativeBuildInputs = with pkgs; []
nativeBuildInputs = with pkgs; []
# The Rust toolchain from rust-overlay has a dynamic libiconv in depsTargetTargetPropagated
# Our static libiconv needs to take precedence
++ lib.optionals pkgs.stdenv.isDarwin [
(libiconv.override { enableStatic = true; enableShared = false; })
];
cargoExtraArgs = "--target ${crossPlatform.rustTargetSpec}";
cargoExtraArgs = "--target ${crossPlatform.rustTargetSpec}";
cargoArtifacts = craneLib.buildDepsOnly ({
inherit (crateName) pname version;
inherit src buildInputs nativeBuildInputs cargoExtraArgs;
cargoVendorDir = craneLib.vendorMultipleCargoDeps {
inherit (craneLib.findCargoFiles src) cargoConfigs;
cargoLockList = [
./Cargo.lock
"${rustNightly.passthru.availableComponents.rust-src}/lib/rustlib/src/rust/Cargo.lock"
];
};
} // crossPlatform.env;
doCheck = false;
} // crossPlatform.env);
crate = craneLib.buildPackage ({
inherit (crateName) pname version;
inherit src buildInputs nativeBuildInputs cargoExtraArgs;
inherit cargoArtifacts;
crate = craneLib.buildPackage (commonArgs // {
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
# The resulting executable must be standalone
allowedRequisites = [];
} // crossPlatform.env);
});
in crate;
in {
inherit crossPlatforms cargoTargets cargoCrossEnvs;

View file

@ -19,7 +19,6 @@ serde_json = "1.0.96"
thiserror = "1.0.40"
tokio-stream = "0.1.14"
tokio-util = { version = "0.7.8", features = ["io"] }
rand = "0.8.5"
daemonize = "0.5.0"
[dependencies.tokio]

View file

@ -4,7 +4,7 @@
use std::net::SocketAddr;
use axum::{extract::Extension, routing::post, http::uri::Uri, Json, Router};
use axum::{extract::Extension, http::uri::Uri, routing::post, Json, Router};
use axum_macros::debug_handler;
use serde::Serialize;