Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cargo/util/flock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ mod sys {
// For targets in which they are the same, the duplicate pattern causes a warning.
#[allow(unreachable_patterns)]
Some(libc::ENOTSUP | libc::EOPNOTSUPP) => true,
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "android"))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable. Though I don't know why treating Linux differently. It seems that Windows and macOS get that errno as well. ENOSYS is also a POSIX.1-2001 standard. #3666 added this specifically for Linux. Maybe we can blow the constraint away and treat all platform the same?

(just rumbling, not your fault)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I think it should be safe to just remove the cfg. I did a scan, and the only targets that don't have ENOSYS are ones that Cargo doesn't run on AFAIK:

aarch64-apple-tvos
aarch64-nintendo-switch-freestanding
aarch64-unknown-hermit
aarch64-unknown-none
aarch64-unknown-none-softfloat
aarch64-unknown-uefi
armebv7r-none-eabi
armebv7r-none-eabihf
armv7a-none-eabi
armv7a-none-eabihf
armv7r-none-eabi
armv7r-none-eabihf
avr-unknown-gnu-atmega328
bpfeb-unknown-none
bpfel-unknown-none
i686-unknown-uefi
mipsel-sony-psp
mipsel-unknown-none
msp430-none-elf
nvptx64-nvidia-cuda
riscv32i-unknown-none-elf
riscv32im-unknown-none-elf
riscv32imac-unknown-none-elf
riscv32imac-unknown-xous-elf
riscv32imc-unknown-none-elf
riscv64gc-unknown-none-elf
riscv64imac-unknown-none-elf
thumbv4t-none-eabi
thumbv6m-none-eabi
thumbv7em-none-eabi
thumbv7em-none-eabihf
thumbv7m-none-eabi
thumbv8m.base-none-eabi
thumbv8m.main-none-eabi
thumbv8m.main-none-eabihf
wasm32-unknown-unknown
wasm64-unknown-unknown
x86_64-apple-tvos
x86_64-fortanix-unknown-sgx
x86_64-unknown-hermit
x86_64-unknown-none
x86_64-unknown-none-linuxkernel
x86_64-unknown-uefi

Some(libc::ENOSYS) => true,
_ => false,
}
Expand Down