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

Bump tabled to 0.17 #14415

Merged
merged 15 commits into from
Dec 28, 2024
Merged

Bump tabled to 0.17 #14415

merged 15 commits into from
Dec 28, 2024

Conversation

zhiburt
Copy link
Contributor

@zhiburt zhiburt commented Nov 22, 2024

With this comes a new unicode-width as I remember there was some issue with ratatui.

And a bit of refactorings which are ment to reduce code lines while not breaking anything.
Not yet complete, I think I'll try to improve some more places,
just wanted to trigger CI 😄

And yessssssssss we have a new unicode-width but I sort of doubtful,
I mean the original issue with emojie.
I think it may require an additional "clean" call.
I am just saying I was not testing it with that case of complex emojies.

With this comes a new unicode-width.
And a bit of refactorings

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
@fdncred
Copy link
Collaborator

fdncred commented Nov 23, 2024

Glad to see that you got some help from josh triplett to update tabled. Anxious to see this go green so we can use the latest version.

@fdncred fdncred marked this pull request as draft November 23, 2024 21:32
@zhiburt
Copy link
Contributor Author

zhiburt commented Nov 23, 2024

Allthough CI is green,

I still hold a desire to work a little bit more on refactoring.
So yes I guess a few more days it may take.

@fdncred
Copy link
Collaborator

fdncred commented Nov 23, 2024

@zhiburt no worries. Just ping me when you're ready for review.

@fdncred
Copy link
Collaborator

fdncred commented Dec 7, 2024

How's this PR coming?

@zhiburt
Copy link
Contributor Author

zhiburt commented Dec 8, 2024

It always surprises how time is flies.....

I'd say there's quite a room for improvement still and I'd love to get it finished,
I try spend more time on this this week.
I am hoping to reduce amount a code rather then to add.

So yes a little more time please 😄

If I won't be finished by this week,
We can just update the version and call it a day 😃

PS: Maybe it was a mistake to do unrelated refactorings with a version update in the same PR to begin with 😅

@fdncred
Copy link
Collaborator

fdncred commented Dec 9, 2024

No worries. My ping was just a gentle reminder and hoping you were still able to work on it. Sounds like you are. We appreciate all your help.

@zhiburt
Copy link
Contributor Author

zhiburt commented Dec 17, 2024

Well I haven't managed to reduce the lines 😅 but IMHO reduced boiler plate quite a bit.

I think it's good to go.
But maybe I'd test it, just in case there's some performance regressions or whatever.
No logic changes were supposed to be done.

Self Notes - work could be done:

  • I found that there's a small improvement could be made with connection to tabled. Basically there's 1 unnecessary pass through all the rows, currently, which could be removed Add a way to create Builder/Table in place from Vec<Vec<_>>> or VecRecords<_> zhiburt/tabled#471. (small performance improvement) (Will try to release this year hopefully).
  • TableOpts must be removed somehow or squashed just too big
  • inspect table build process simplification...
  • It must be possible to remove recursion from table -e, I've tried....but failed...but seems like possible and it must bring some performance gains and allow bigger tables.
  • Noticed that there's no test for file links and table rendering (basically ls test)

@zhiburt zhiburt changed the title [DRAFT] Bump tabled to 0.17 Bump tabled to 0.17 Dec 17, 2024
@fdncred
Copy link
Collaborator

fdncred commented Dec 17, 2024

Thanks @zhiburt for all your work on this. I think it's too close to our release to land it now but I'll tag it for later.

@fdncred fdncred added tabled Issues about our new table renderer (tabled) wait-until-after-nushell-release labels Dec 17, 2024
@fdncred
Copy link
Collaborator

fdncred commented Dec 25, 2024

when you have time, can you fix the conflicts?

@zhiburt
Copy link
Contributor Author

zhiburt commented Dec 27, 2024

Seems like done; though as I said I'd run it just in case 😄

@fdncred fdncred marked this pull request as ready for review December 28, 2024 14:19
@fdncred
Copy link
Collaborator

fdncred commented Dec 28, 2024

Seems to be working. Let's give it a try and see if we can break it.

@fdncred fdncred merged commit 4401924 into nushell:main Dec 28, 2024
16 checks passed
@github-actions github-actions bot added this to the v0.102.0 milestone Dec 28, 2024
@fdncred
Copy link
Collaborator

fdncred commented Dec 30, 2024

@zhiburt I'm experiencing weird problems this morning with nushell. I git bisected it down to this PR. If I type help commands, scope commands, scope aliases, help aliases it hangs in the release version on the latest main branch commit. Would you have time to look into this please?

In a debug version, it panics.

❯ scope aliases
Error:
  × Main thread panicked.
  ├─▶ at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/peekable.rs:1000:20
  ╰─▶ attempt to subtract with overflow
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

Here's a full backtrace

❯ scope aliases                                                                                                    0823  09:18:55 AM
Error:
  × Main thread panicked.
  ├─▶ at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/peekable.rs:1000:20
  ╰─▶ attempt to subtract with overflow
         0: 0x1072c5724 - rust_begin_unwind
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665
         1: 0x10735dc98 - core::panicking::panic_fmt::ha4b80a05b9fff47a
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74
         2: 0x10735e2c0 - core::panicking::panic_const::panic_const_sub_overflow::h05d804c1002dbbac
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:181
         3: 0x1059e5928 - papergrid::grid::peekable::grid_not_spanned::calculate_indent::h39857686051de43b
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/
      peekable.rs:1000
         4: 0x10599fc00 - papergrid::grid::peekable::grid_not_spanned::print_line::h8a17c415d30929ba
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/
      peekable.rs:920
         5: 0x1059a251c - papergrid::grid::peekable::grid_not_spanned::print_cell_line::hec5123ecb349a285
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/
      peekable.rs:890
         6: 0x10599eb0c - papergrid::grid::peekable::grid_not_spanned::build_grid::h51407d72e2d61950
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/
      peekable.rs:606
         7: 0x10599cf68 - papergrid::grid::peekable::print_grid::h1e320d3241db3ee9
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/
      peekable.rs:116
         8: 0x1059a45f0 - papergrid::grid::peekable::PeekableGrid<R,G,D,C>::build::h3da2969c8a2a9bc7
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/papergrid-0.13.0/src/grid/peekable.rs:65
         9: 0x1059a614c - tabled::tables::table::print_grid::h3f8e280435b39e50
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tabled-0.17.0/src/tables/table.rs:611
        10: 0x1059a5804 - <tabled::tables::table::Table as core::fmt::Display>::fmt::h5f589f56e4c48868
                      at /Users/fdncred/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tabled-0.17.0/src/tables/table.rs:443
        11: 0x10599b664 - <T as alloc::string::ToString>::to_string::h241118060a7ccae2
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/string.rs:2565
        12: 0x10592fc78 - nu_table::table::table_to_string::hde6317c2d197a7d3
                      at /Users/fdncred/src/nushell/crates/nu-table/src/table.rs:381
        13: 0x10592ef2c - nu_table::table::draw_table::hbeb53baf9745f34f
                      at /Users/fdncred/src/nushell/crates/nu-table/src/table.rs:291
        14: 0x10592ea58 - nu_table::table::build_table::hec8468349121f4a9
                      at /Users/fdncred/src/nushell/crates/nu-table/src/table.rs:254
        15: 0x10592e640 - nu_table::table::NuTable::draw::he6af03899934f6c1
                      at /Users/fdncred/src/nushell/crates/nu-table/src/table.rs:185
        16: 0x105912d68 - nu_table::types::general::list_table::hfd72b718778f594f
                      at /Users/fdncred/src/nushell/crates/nu-table/src/types/general.rs:38
        17: 0x105912a5c - nu_table::types::general::JustTable::table::hd4f5e4c31a81553e
                      at /Users/fdncred/src/nushell/crates/nu-table/src/types/general.rs:19
        18: 0x104d77e18 - nu_command::viewers::table::build_table_batch::hc2ae76e7270d66e8
                      at /Users/fdncred/src/nushell/crates/nu-command/src/viewers/table.rs:634
        19: 0x104d78b84 - nu_command::viewers::table::PagingTableCreator::build_table::h970b01b7a546be50
                      at /Users/fdncred/src/nushell/crates/nu-command/src/viewers/table.rs:832
        20: 0x104d78e50 - <nu_command::viewers::table::PagingTableCreator as
      core::iter::traits::iterator::Iterator>::next::h7852b61b445963c8
                      at /Users/fdncred/src/nushell/crates/nu-command/src/viewers/table.rs:894
        21: 0x104ec88b4 - <nu_protocol::pipeline::byte_stream::ReadResultIterator<I,T> as std::io::Read>::read::h3f7581d7a4af9f35
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/byte_stream.rs:688
        22: 0x10522730c - std::io::Read::read_buf::{{closure}}::hdf4792186711afb3
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/mod.rs:973
        23: 0x105212620 - std::io::default_read_buf::hb8538b88aa032a99
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/mod.rs:574
        24: 0x104ed8670 - std::io::Read::read_buf::h5b51a992b9533a5c
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/mod.rs:973
        25: 0x1069714b4 - std::io::impls::<impl std::io::Read for alloc::boxed::Box<R>>::read_buf::h086bb30cd6d9f4c6
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/impls.rs:132
        26: 0x1069461f4 - std::io::copy::stack_buffer_copy::he0d4adaef43d3ddb
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/copy.rs:278
        27: 0x10692de24 - <W as std::io::copy::BufferedWriterSpec>::copy_from::h48b06529aa281e41
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/copy.rs:202
        28: 0x106943138 - std::io::copy::generic_copy::h668b8071f89c7fda
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/copy.rs:89
        29: 0x106947280 - std::io::copy::copy::hdef9e2facffe796c
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/io/copy.rs:70
        30: 0x106b9b470 - nu_protocol::pipeline::byte_stream::copy_with_signals::h6ae6ae8c6f77ebd6
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/byte_stream.rs:1136
        31: 0x106b992fc - nu_protocol::pipeline::byte_stream::ByteStream::write_to::h4b078b06cbcca403
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/byte_stream.rs:608
        32: 0x106acd2c8 - nu_protocol::pipeline::byte_stream::ByteStream::print::h8ffb468048fb3fa1
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/byte_stream.rs:598
        33: 0x106a675d0 - nu_protocol::pipeline::pipeline_data::PipelineData::write_all_and_flush::hfe247571f2b65c5d
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/pipeline_data.rs:608
        34: 0x106a671e0 - nu_protocol::pipeline::pipeline_data::PipelineData::print_raw::hec6f6fad72b9deeb
                      at /Users/fdncred/src/nushell/crates/nu-protocol/src/pipeline/pipeline_data.rs:596
        35: 0x105c72c20 - nu_cli::util::print_pipeline::h919281d628d6d0f9
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/util.rs:228
        36: 0x105c739e8 - nu_cli::util::evaluate_source::ha3078657a7294919
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/util.rs:319
        37: 0x105c72e3c - nu_cli::util::eval_source::h547982f94a5dd462
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/util.rs:245
        38: 0x105d0964c - nu_cli::repl::do_run_cmd::h26b1a0bebc80f456
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/repl.rs:956
        39: 0x105d068f4 - nu_cli::repl::loop_iteration::h703db1c2e27a927a
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/repl.rs:614
        40: 0x105cf26bc - nu_cli::repl::evaluate_repl::{{closure}}::h06e9d21145b106bc
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/repl.rs:192
        41: 0x105c4b67c - <core::panic::unwind_safe::AssertUnwindSafe<F> as
      core::ops::function::FnOnce<()>>::call_once::h1e77299a8f28cd15
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panic/unwind_safe.rs:272
        42: 0x105cfd3a8 - std::panicking::try::do_call::h4fa35d002e550774
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:557
        43: 0x105cd1634 - ___rust_try
        44: 0x105cd1580 - std::panicking::try::h617993beea084cd3
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:521
                       - std::panic::catch_unwind::hdf1b32066861db97
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panic.rs:350
        45: 0x105cff54c - nu_cli::repl::evaluate_repl::hc175d4ec6d5b7066
                      at /Users/fdncred/src/nushell/crates/nu-cli/src/repl.rs:191
        46: 0x1048afac0 - nu::run::run_repl::he5551db3c88c2578
                      at /Users/fdncred/src/nushell/src/run.rs:207
        47: 0x1048b93b4 - nu::main::h6813497a684c540d
                      at /Users/fdncred/src/nushell/src/main.rs:510
        48: 0x1048cf728 - core::ops::function::FnOnce::call_once::h8d515aa2fb013111
                      at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/ops/function.rs:250
  help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.

copied to a new issue #14701

@zhiburt
Copy link
Contributor Author

zhiburt commented Dec 30, 2024

😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tabled Issues about our new table renderer (tabled) wait-until-after-nushell-release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants