Skip to content

Conversation

@dpaoliello
Copy link

I'd like to move all dependency of Cargo to the latest windows-sys since older versions don't support Arm64EC.

@fdncred
Copy link

fdncred commented Aug 26, 2025

What would this bump our MSRV to? We currently support 1.62.1.

@dpaoliello
Copy link
Author

No change in Rust version. 0.60.2 has an MSRV of 1.60.

@fdncred
Copy link

fdncred commented Aug 28, 2025

When I try to build this PR with the nu-ansi-term MSRV 1.62.1 I get errors.

❯ cargo +1.62.1 build
info: syncing channel updates for '1.62.1-x86_64-pc-windows-msvc'
info: latest update on 2022-07-19, rust version 1.62.1 (e092d0b6b 2022-07-16)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
    Updating crates.io index
  Downloaded windows-targets v0.53.3
  Downloaded windows_x86_64_msvc v0.53.0
  Downloaded windows-sys v0.60.2
  Downloaded 3 crates (3.4 MB) in 0.91s (largest was `windows-sys` at 2.5 MB)
   Compiling windows_x86_64_msvc v0.53.0
   Compiling windows-targets v0.53.3
   Compiling windows-sys v0.60.2
   Compiling nu-ansi-term v0.50.2 (C:\Users\username\source\repos\forks\nu-ansi-term)
error[E0277]: the trait bound `*mut c_void: Default` is not satisfied
  --> src\windows.rs:32:13
   |
25 |         let console_handle = CreateFileW(
   |                              ----------- required by a bound introduced by this call
...
32 |             Default::default(), // hTemplateFile: HANDLE
   |             ^^^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `*mut c_void`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `nu-ansi-term` due to previous error
Error: nu::shell::non_zero_exit_code

  × External command had a non-zero exit code
   ╭─[entry #15:1:1]
 1 │ cargo +1.62.1 build
   · ──┬──
   ·   ╰── exited with code 101
   ╰────

@dpaoliello
Copy link
Author

When I try to build this PR with the nu-ansi-term MSRV 1.62.1 I get errors.

Good catch: I forgot that Default was only implemented for raw pointers recently. Updated the PR with a fix.

@fdncred fdncred merged commit f659d23 into nushell:main Sep 8, 2025
2 checks passed
@fdncred
Copy link

fdncred commented Sep 8, 2025

Thanks

fdncred pushed a commit that referenced this pull request Sep 8, 2025
#66 updated the `windows-sys` dependency to `0.60.0` to allow for
ARM64EC support, but ARM64EC support was originally introduced in
`0.59.0`. Since both `windows-sys` and `nu-ansi-term` are both widely
used, it's good to have a larger dependency range to avoid duplicate
dependencies in user's buildgraphs (and triggering
`clippy::multiple-crate-versions`). There's precedent for doing this in
many crates:

* https://lib.rs/crates/windows-sys/rev
* https://lib.rs/crates/windows/rev
@dpaoliello dpaoliello deleted the windowssys branch September 8, 2025 23:51
@fdncred
Copy link

fdncred commented Sep 26, 2025

It seems like a new rust version maybe is required.
image

I'm not sure if we want to bump to 1.71
#70

/cc @cptpiepmatz

Update: oh wait, maybe windows-sys should be 0.60 vs 0.61?

@dpaoliello
Copy link
Author

Update: oh wait, maybe this is 1.60 vs 1.61?

Yep, windows-sys 0.61 requires Rust 1.71 because it uses the raw-dylib feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants