Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation from source broken in nu-utils #9957

Closed
cgranade opened this issue Aug 8, 2023 · 3 comments · Fixed by #9958
Closed

Compilation from source broken in nu-utils #9957

cgranade opened this issue Aug 8, 2023 · 3 comments · Fixed by #9958
Labels
upstream problem with upstream dependency
Milestone

Comments

@cgranade
Copy link

cgranade commented Aug 8, 2023

Describe the bug

When compiling nu from source with cargo install nu --features dataframe, a type error is returned as shown in snippet below.

How to reproduce

  1. Run cargo install nu --features dataframe.

Expected behavior

Successful compilation of nu.exe.

Screenshots

error[E0308]: mismatched types
  --> ...\.cargo\registry\src\github.com-1ecc6299db9ec823\nu-utils-0.83.1\src\deansi.rs:16:16
   |
16 |         if let Ok(stripped) = strip_ansi_escapes::strip(string) {
   |                ^^^^^^^^^^^^   --------------------------------- this expression has type `Vec<u8>`
   |                |
   |                expected `Vec<u8>`, found `Result<_, _>`
   |
   = note: expected struct `Vec<u8>`
                found enum `Result<_, _>`

error[E0308]: mismatched types
  --> ...\.cargo\registry\src\github.com-1ecc6299db9ec823\nu-utils-0.83.1\src\deansi.rs:37:12
   |
37 |     if let Ok(stripped) = strip_ansi_escapes::strip(string) {
   |            ^^^^^^^^^^^^   --------------------------------- this expression has type `Vec<u8>`
   |            |
   |            expected `Vec<u8>`, found `Result<_, _>`
   |
   = note: expected struct `Vec<u8>`
                found enum `Result<_, _>`

error[E0308]: mismatched types
  --> ...\.cargo\registry\src\github.com-1ecc6299db9ec823\nu-utils-0.83.1\src\deansi.rs:63:16
   |
63 |         if let Ok(stripped) = strip_ansi_escapes::strip(&string) {
   |                ^^^^^^^^^^^^   ---------------------------------- this expression has type `Vec<u8>`
   |                |
   |                expected `Vec<u8>`, found `Result<_, _>`
   |
   = note: expected struct `Vec<u8>`
                found enum `Result<_, _>`

error[E0308]: mismatched types
  --> ...\.cargo\registry\src\github.com-1ecc6299db9ec823\nu-utils-0.83.1\src\deansi.rs:84:12
   |
84 |     if let Ok(stripped) = strip_ansi_escapes::strip(&string) {
   |            ^^^^^^^^^^^^   ---------------------------------- this expression has type `Vec<u8>`
   |            |
   |            expected `Vec<u8>`, found `Result<_, _>`
   |
   = note: expected struct `Vec<u8>`
                found enum `Result<_, _>`

Configuration

key value
version 0.81.0
branch
commit_hash
build_os windows-x86_64
build_target x86_64-pc-windows-msvc
rust_version rustc 1.69.0 (84c898d65 2023-04-16)
rust_channel stable-x86_64-pc-windows-msvc
cargo_version cargo 1.69.0 (6e9a83356 2023-04-12)
build_time 2023-06-18 10:34:38 -07:00
build_rust_channel release
features dataframe, default, sqlite, trash, which, zip
installed_plugins [[redacted]]

Additional context

Root cause appears to be luser/strip-ansi-escapes#17.

@cgranade cgranade added the needs-triage An issue that hasn't had any proper look label Aug 8, 2023
@cgranade
Copy link
Author

cgranade commented Aug 8, 2023

I recognize this is an upstream bug, but wanted to report here as it affects nushell, and to provide context in the upstream bug as to what other crates were broken by this change. Apologies for the additional triage load as a result.

@sholderbach
Copy link
Member

Thanks for referencing the issue! We hope there is a resolution soon. With nushell/reedline#617 we patched it for reedline, we could do the same for nushell if this takes a bit longer.

You can run with --locked for now.

@sholderbach sholderbach added upstream problem with upstream dependency and removed needs-triage An issue that hasn't had any proper look labels Aug 8, 2023
@fdncred
Copy link
Collaborator

fdncred commented Aug 8, 2023

Hopefully #9958 fixes this problem here too.

fdncred added a commit that referenced this issue Aug 8, 2023
# Description

This PR updates `strip-ansi-escapes` to support their new API. This also
updates nushell to the latest reedline after the same fix
nushell/reedline#617

closes #9957 

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
@hustcer hustcer added this to the v0.84.0 milestone Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream problem with upstream dependency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants