Reduce duplicate dependencies on the windows crate (#14105)

Nushell currently depends on three different versions of the `windows`
crate: `0.44.0`, `0.52.0`, and `0.54.0`. This PR bumps several
dependencies so that the `nu` binary only depends on `0.56.0`.

On my machine, this PR makes `cargo build` about 10% faster.

The polars plugin still uses its own version of the `windows` crate
though, which is not ideal. We'll need to bump the `polars` crate to fix
that, but it breaks a lot of our code. (`polars 1.0` release anyone?)
This commit is contained in:
YizhePKU
2024-10-18 01:12:45 +08:00
committed by sholderbach
parent 7c5dcbb3fc
commit 740fe942c1
3 changed files with 69 additions and 109 deletions

View File

@ -101,7 +101,7 @@ fn all_columns(span: Span) -> Value {
let environment = {
let mut env_rec = Record::new();
for val in p.environ() {
if let Some((key, value)) = val.split_once('=') {
if let Some((key, value)) = val.to_string_lossy().split_once('=') {
let is_env_var_a_list = {
{
#[cfg(target_family = "windows")]
@ -146,8 +146,8 @@ fn all_columns(span: Span) -> Value {
"root" => root,
"cwd" => cwd,
"exe_path" => exe_path,
"command" => Value::string(p.cmd().join(" "), span),
"name" => Value::string(p.name(), span),
"command" => Value::string(p.cmd().join(std::ffi::OsStr::new(" ")).to_string_lossy(), span),
"name" => Value::string(p.name().to_string_lossy(), span),
"environment" => environment,
},
span,