From 7008e1653bc1bc858cddc8be81862c60824bff57 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 10 Dec 2023 14:06:36 +0100 Subject: [PATCH] Got windows build working within a shell, with no features enabled --- default.nix | 15 ++++++--------- flake.lock | 4 ++-- src/rpc/system.rs | 6 ++++++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/default.nix b/default.nix index a1f6b891..76702a7c 100644 --- a/default.nix +++ b/default.nix @@ -40,10 +40,10 @@ let "x86_64-windows" = newBuildTarget { nixPkgsSystem = "x86_64-w64-mingw32"; rustTarget = "x86_64-pc-windows-gnu"; - depsBuildBuild = pkgsCross: [ - pkgsCross.stdenv.cc - pkgsCross.windows.pthreads - ]; + #depsBuildBuild = pkgsCross: [ + # pkgsCross.stdenv.cc + # pkgsCross.windows.pthreads + #]; }; }; @@ -123,7 +123,6 @@ let "garage/kubernetes-discovery" "garage/metrics" "garage/telemetry-otlp" - "garage/lmdb" "garage/sqlite" ] else [ ] ) @@ -147,6 +146,8 @@ let nativeBuildInputs = (buildTarget.depsBuildBuild pkgsCross) ++ [ toolchain pkgs.protobuf + #pkgsCross.stdenv.cc + #pkgsCross.windows.pthreads ]; buildInputs = [ @@ -154,10 +155,6 @@ let pkgsCross.windows.pthreads ]; - OPENSSL_STATIC = "1"; - OPENSSL_LIB_DIR = "${pkgsCross.pkgsStatic.openssl.out}/lib"; - OPENSSL_INCLUDE_DIR = "${pkgsCross.pkgsStatic.openssl.dev}/include"; - SODIUM_LIB_DIR = "${libsodium}/lib"; # Required because ring crate is special. This also seems to have diff --git a/flake.lock b/flake.lock index 8de99c3e..48c20355 100644 --- a/flake.lock +++ b/flake.lock @@ -80,10 +80,10 @@ "nixpkgs": { "locked": { "lastModified": 1682109806, - "narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=", + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2362848adf8def2866fabbffc50462e929d7fffb", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", "type": "github" }, "original": { diff --git a/src/rpc/system.rs b/src/rpc/system.rs index 17348623..56d9c894 100644 --- a/src/rpc/system.rs +++ b/src/rpc/system.rs @@ -978,6 +978,7 @@ impl NodeStatus { } } +#[cfg(not(windows))] fn get_default_ip() -> Option { pnet_datalink::interfaces() .iter() @@ -986,6 +987,11 @@ fn get_default_ip() -> Option { .map(|a| a.ip()) } +#[cfg(windows)] +fn get_default_ip() -> Option { + None +} + async fn resolve_peers(peers: &[String]) -> Vec<(NodeID, SocketAddr)> { let mut ret = vec![];