From: Fabian Grünbichler Date: Tue, 16 Dec 2025 10:45:36 +0000 (+0100) Subject: Enable file locking support for Hurd X-Git-Tag: archive/raspbian/1.91.1+dfsg1-1+rpi1~1^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8d464b1498b945fbf011d011ae98a593c1104cf6;p=rustc.git Enable file locking support for Hurd like Illumos in #148322, Hurd was missed when originally introducing locking gates per target OS in #132977. building rustc on Hurd was broken as a result since 1.91. Signed-off-by: Fabian Grünbichler Gbp-Pq: Topic upstream Gbp-Pq: Name Enable-file-locking-support-for-Hurd.patch --- diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index c4e56bc891..2fa02dab26 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -226,6 +226,7 @@ fn file_test_io_seek_and_write() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -251,6 +252,7 @@ fn file_lock_multiple_shared() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -277,6 +279,7 @@ fn file_lock_blocking() { #[cfg(any( windows, target_os = "freebsd", + target_is = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", @@ -300,6 +303,7 @@ fn file_lock_drop() { #[cfg(any( windows, target_os = "freebsd", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "solaris", diff --git a/library/std/src/sys/fs/unix.rs b/library/std/src/sys/fs/unix.rs index af8b297186..84f997154a 100644 --- a/library/std/src/sys/fs/unix.rs +++ b/library/std/src/sys/fs/unix.rs @@ -1282,6 +1282,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1306,6 +1307,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1321,6 +1323,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1345,6 +1348,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1360,6 +1364,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1400,6 +1405,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1418,6 +1424,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1458,6 +1465,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1476,6 +1484,7 @@ impl File { #[cfg(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd", @@ -1500,6 +1509,7 @@ impl File { #[cfg(not(any( target_os = "freebsd", target_os = "fuchsia", + target_os = "hurd", target_os = "linux", target_os = "netbsd", target_os = "openbsd",