Skip to content

Commit d4e3bc4

Browse files
committed
build(nix): add cross-compilation for windows
1 parent d5f5719 commit d4e3bc4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
sysdig-lsp-linux-arm64 = pkgsCross.aarch64-multiplatform.pkgsStatic.sysdig-lsp;
3333
sysdig-lsp-darwin-amd64 = pkgsCross.x86_64-darwin.sysdig-lsp;
3434
sysdig-lsp-darwin-arm64 = pkgsCross.aarch64-darwin.sysdig-lsp;
35+
sysdig-lsp-windows-amd64 = pkgsCross.mingwW64.sysdig-lsp;
3536
};
3637

3738
devShells.default =

src/infra/scanner_binary_manager.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
#![allow(dead_code)] // FIXME: to be removed later, when this is used
22

3-
use std::{
4-
os::unix::fs::PermissionsExt,
5-
path::{Path, PathBuf},
6-
};
7-
83
use regex::Regex;
94
use semver::Version;
5+
#[cfg(unix)]
6+
use std::os::unix::fs::PermissionsExt;
7+
use std::path::{Path, PathBuf};
108
use thiserror::Error;
119
use tokio::process::Command;
1210

@@ -169,7 +167,7 @@ impl ScannerBinaryManager {
169167

170168
#[cfg(windows)]
171169
{
172-
if let Some(ext) = self.binary_path().extension() {
170+
if let Some(ext) = binary_path.extension() {
173171
matches!(ext.to_str(), Some("exe") | Some("bat") | Some("cmd"))
174172
} else {
175173
false

0 commit comments

Comments
 (0)