Skip to content

Commit 13ff198

Browse files
committed
Only use landlock on Linux
1 parent ecb10d2 commit 13ff198

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

build_system/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ path = "main.rs"
1111
unstable-features = [] # for rust-analyzer
1212

1313
# Do not add any dependencies
14-
[dependencies]
14+
[target.'cfg(target_os = "linux")'.dependencies]
1515
landlock = "0.4"
1616

1717
[profile.dev]

build_system/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ mod bench;
1212
mod build_backend;
1313
mod build_sysroot;
1414
mod config;
15+
#[cfg(target_os = "linux")]
1516
mod landlock;
1617
mod path;
1718
mod prepare;
@@ -143,6 +144,7 @@ fn main() {
143144

144145
path::RelPath::DOWNLOAD.ensure_exists(&dirs);
145146

147+
#[cfg(target_os = "linux")]
146148
landlock::lock_fetch();
147149

148150
prepare::prepare(&dirs);
@@ -195,6 +197,7 @@ fn main() {
195197
path::RelPath::BUILD.ensure_exists(&dirs);
196198
path::RelPath::DIST.ensure_exists(&dirs);
197199

200+
#[cfg(target_os = "linux")]
198201
landlock::lock_build(&bootstrap_host_compiler.cargo, frozen);
199202

200203
{

0 commit comments

Comments
 (0)