1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

chore: update nix crate (#26422)

Dedupes nix dependency, since `rustyline` depends on a newer version
that what we currently use
This commit is contained in:
Leo Kettmeir 2024-10-19 14:59:39 -07:00 committed by GitHub
parent 85709c70ab
commit 473e3069de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 17 additions and 37 deletions

39
Cargo.lock generated
View file

@ -769,7 +769,7 @@ dependencies = [
"http-body-util", "http-body-util",
"hyper 1.4.1", "hyper 1.4.1",
"hyper-util", "hyper-util",
"nix 0.26.2", "nix",
"once_cell", "once_cell",
"os_pipe", "os_pipe",
"pretty_assertions", "pretty_assertions",
@ -1223,7 +1223,7 @@ dependencies = [
"memmem", "memmem",
"monch", "monch",
"napi_sym", "napi_sym",
"nix 0.26.2", "nix",
"node_resolver", "node_resolver",
"notify", "notify",
"once_cell", "once_cell",
@ -1438,7 +1438,7 @@ dependencies = [
"deno_unsync", "deno_unsync",
"futures", "futures",
"libc", "libc",
"memoffset 0.9.1", "memoffset",
"parking_lot", "parking_lot",
"percent-encoding", "percent-encoding",
"pin-project", "pin-project",
@ -1599,7 +1599,7 @@ dependencies = [
"filetime", "filetime",
"junction", "junction",
"libc", "libc",
"nix 0.26.2", "nix",
"rand", "rand",
"rayon", "rayon",
"serde", "serde",
@ -2035,7 +2035,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"netif", "netif",
"nix 0.26.2", "nix",
"node_resolver", "node_resolver",
"notify", "notify",
"ntapi", "ntapi",
@ -4397,15 +4397,6 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15" checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15"
[[package]]
name = "memoffset"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "memoffset" name = "memoffset"
version = "0.9.1" version = "0.9.1"
@ -4563,20 +4554,6 @@ dependencies = [
"smallvec", "smallvec",
] ]
[[package]]
name = "nix"
version = "0.26.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a"
dependencies = [
"bitflags 1.3.2",
"cfg-if",
"libc",
"memoffset 0.7.1",
"pin-utils",
"static_assertions",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.27.1" version = "0.27.1"
@ -5776,7 +5753,7 @@ checksum = "32a58fa8a7ccff2aec4f39cc45bf5f985cec7125ab271cf681c279fd00192b49"
dependencies = [ dependencies = [
"countme", "countme",
"hashbrown", "hashbrown",
"memoffset 0.9.1", "memoffset",
"rustc-hash 1.1.0", "rustc-hash 1.1.0",
"text-size", "text-size",
] ]
@ -5984,7 +5961,7 @@ dependencies = [
"libc", "libc",
"log", "log",
"memchr", "memchr",
"nix 0.27.1", "nix",
"radix_trie", "radix_trie",
"unicode-segmentation", "unicode-segmentation",
"unicode-width", "unicode-width",
@ -7187,7 +7164,7 @@ dependencies = [
"libc", "libc",
"lsp-types", "lsp-types",
"monch", "monch",
"nix 0.26.2", "nix",
"once_cell", "once_cell",
"os_pipe", "os_pipe",
"parking_lot", "parking_lot",

View file

@ -221,7 +221,7 @@ quote = "1"
syn = { version = "2", features = ["full", "extra-traits"] } syn = { version = "2", features = ["full", "extra-traits"] }
# unix # unix
nix = "=0.26.2" nix = "=0.27.1"
# windows deps # windows deps
junction = "=0.2.0" junction = "=0.2.0"

View file

@ -31,7 +31,7 @@ serde.workspace = true
thiserror.workspace = true thiserror.workspace = true
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]
nix.workspace = true nix = { workspace = true, features = ["user"] }
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = ["winbase"] } winapi = { workspace = true, features = ["winbase"] }

View file

@ -244,7 +244,8 @@ fn op_set_raw(
let tty_mode_store = state.borrow::<TtyModeStore>().clone(); let tty_mode_store = state.borrow::<TtyModeStore>().clone();
let previous_mode = tty_mode_store.get(rid); let previous_mode = tty_mode_store.get(rid);
let raw_fd = handle_or_fd; // SAFETY: Nix crate requires value to implement the AsFd trait
let raw_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(handle_or_fd) };
if is_raw { if is_raw {
let mut raw = match previous_mode { let mut raw = match previous_mode {

View file

@ -35,7 +35,7 @@ lazy-regex.workspace = true
libc.workspace = true libc.workspace = true
lsp-types.workspace = true lsp-types.workspace = true
monch.workspace = true monch.workspace = true
nix.workspace = true nix = { workspace = true, features = ["fs", "term", "signal"] }
once_cell.workspace = true once_cell.workspace = true
os_pipe.workspace = true os_pipe.workspace = true
parking_lot.workspace = true parking_lot.workspace = true

View file

@ -297,10 +297,12 @@ fn setup_pty(fd: i32) {
use nix::sys::termios::tcsetattr; use nix::sys::termios::tcsetattr;
use nix::sys::termios::SetArg; use nix::sys::termios::SetArg;
let mut term = tcgetattr(fd).unwrap(); // SAFETY: Nix crate requires value to implement the AsFd trait
let as_fd = unsafe { std::os::fd::BorrowedFd::borrow_raw(fd) };
let mut term = tcgetattr(as_fd).unwrap();
// disable cooked mode // disable cooked mode
term.local_flags.remove(termios::LocalFlags::ICANON); term.local_flags.remove(termios::LocalFlags::ICANON);
tcsetattr(fd, SetArg::TCSANOW, &term).unwrap(); tcsetattr(as_fd, SetArg::TCSANOW, &term).unwrap();
// turn on non-blocking mode so we get timeouts // turn on non-blocking mode so we get timeouts
let flags = fcntl(fd, FcntlArg::F_GETFL).unwrap(); let flags = fcntl(fd, FcntlArg::F_GETFL).unwrap();