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

Reduce accidental dependency duplication #8060

Open
sholderbach opened this issue Feb 12, 2023 · 5 comments
Open

Reduce accidental dependency duplication #8060

sholderbach opened this issue Feb 12, 2023 · 5 comments
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed upstream problem with upstream dependency

Comments

@sholderbach
Copy link
Member

sholderbach commented Feb 12, 2023

Problem

We currently have a number of dependencies for which we pull in different versions of the same crate as dependencies in our cargo tree have conflicting semver requirements. This causes multiple compilation runs, slows down linking, and causes binary bloat.

This is on top of crates that functionally duplicate the solution to the same problem (e.g. multiple crates responsible for ANSI coloring or wrappers around the system e.g. for libc or windows system calls)

Aims

As a first goal we should strive to reduce this version duplication by taking a hard look at dependencies or semver-specs in our crates that cause them.\nEither we eliminate them, choose better versions on our side (as long as this doesn't preclude important bugfixes), or be good stewards and try to contribute upstream version bumps.

Output of cargo tree -d

This returns dependencies which appear with multiple versions and their dependency tree. Also check the Cargo.lock
(last updated 2024-03-11 with --depth 3)

arrayvec v0.5.2
└── vte v0.10.1
    └── ansitok v0.2.0
        ├── ansi-str v0.8.0
        ├── papergrid v0.10.0
        └── tabled v0.14.0

arrayvec v0.7.4
├── num-format v0.4.4
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command)
│   │   └── nu v0.91.1 (/home/stefan/nushell)
│   ├── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol)
│   │   ├── nu v0.91.1 (/home/stefan/nushell)
│   │   ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli)
│   │   ├── nu-cmd-base v0.91.1 (/home/stefan/nushell/crates/nu-cmd-base)
│   │   ├── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra)
│   │   ├── nu-cmd-lang v0.91.1 (/home/stefan/nushell/crates/nu-cmd-lang)
│   │   ├── nu-color-config v0.91.1 (/home/stefan/nushell/crates/nu-color-config)
│   │   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   │   ├── nu-engine v0.91.1 (/home/stefan/nushell/crates/nu-engine)
│   │   ├── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore)
│   │   ├── nu-lsp v0.91.1 (/home/stefan/nushell/crates/nu-lsp)
│   │   ├── nu-parser v0.91.1 (/home/stefan/nushell/crates/nu-parser)
│   │   ├── nu-plugin v0.91.1 (/home/stefan/nushell/crates/nu-plugin)
│   │   ├── nu-std v0.91.1 (/home/stefan/nushell/crates/nu-std)
│   │   └── nu-table v0.91.1 (/home/stefan/nushell/crates/nu-table)
│   ├── nu-test-support v0.91.1 (/home/stefan/nushell/crates/nu-test-support)
│   │   [dev-dependencies]
│   │   └── nu v0.91.1 (/home/stefan/nushell)
│   └── nu-utils v0.91.1 (/home/stefan/nushell/crates/nu-utils)
│       ├── nu v0.91.1 (/home/stefan/nushell)
│       ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│       ├── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra) (*)
│       ├── nu-cmd-lang v0.91.1 (/home/stefan/nushell/crates/nu-cmd-lang) (*)
│       ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│       ├── nu-engine v0.91.1 (/home/stefan/nushell/crates/nu-engine) (*)
│       ├── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore) (*)
│       ├── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
│       ├── nu-table v0.91.1 (/home/stefan/nushell/crates/nu-table) (*)
│       ├── nu-term-grid v0.91.1 (/home/stefan/nushell/crates/nu-term-grid)
│       └── nu-test-support v0.91.1 (/home/stefan/nushell/crates/nu-test-support) (*)
└── rust_decimal v1.33.1
    ├── byte-unit v5.1.4
    │   └── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
    └── dtparse v2.0.0
        └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)

bitflags v1.3.2
├── inotify v0.9.6
│   └── notify v6.1.1
│       └── notify-debouncer-full v0.3.1
├── lsp-types v0.95.0
│   └── nu-lsp v0.91.1 (/home/stefan/nushell/crates/nu-lsp) (*)
└── nix v0.26.4
    ├── wl-clipboard-rs v0.8.0
    │   └── arboard v3.3.0
    ├── x11rb v0.12.0
    │   └── arboard v3.3.0 (*)
    └── x11rb-protocol v0.12.0
        └── x11rb v0.12.0 (*)

bitflags v2.4.2
├── crossterm v0.27.0
│   ├── nu v0.91.1 (/home/stefan/nushell)
│   ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   ├── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore) (*)
│   ├── ratatui v0.26.0
│   │   └── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore) (*)
│   └── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127)
│       ├── nu v0.91.1 (/home/stefan/nushell)
│       ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│       └── nu-lsp v0.91.1 (/home/stefan/nushell/crates/nu-lsp) (*)
├── nix v0.27.1
│   ├── ctrlc v3.4.2
│   │   └── nu v0.91.1 (/home/stefan/nushell)
│   ├── nu v0.91.1 (/home/stefan/nushell)
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   ├── nu-system v0.91.1 (/home/stefan/nushell/crates/nu-system)
│   │   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   │   └── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
│   └── uucore v0.0.24
│       ├── uu_cp v0.0.23
│       ├── uu_mkdir v0.0.23
│       ├── uu_mktemp v0.0.23
│       ├── uu_mv v0.0.23
│       └── uu_whoami v0.0.23
├── openssl v0.10.63
│   └── native-tls v0.2.11
│       ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│       └── ureq v2.9.1
├── procfs v0.16.0
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── nu-system v0.91.1 (/home/stefan/nushell/crates/nu-system) (*)
├── procfs-core v0.16.0
│   └── procfs v0.16.0 (*)
├── ratatui v0.26.0 (*)
├── rusqlite v0.31.0
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
├── rustix v0.38.31
│   ├── fd-lock v3.0.13
│   │   └── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
│   ├── procfs v0.16.0 (*)
│   ├── tempfile v3.10.0
│   │   ├── nu-test-support v0.91.1 (/home/stefan/nushell/crates/nu-test-support) (*)
│   │   ├── uu_mktemp v0.0.23 (*)
│   │   └── wl-clipboard-rs v0.8.0 (*)
│   │   [dev-dependencies]
│   │   └── nu v0.91.1 (/home/stefan/nushell)
│   ├── terminal_size v0.3.0
│   │   ├── clap_builder v4.4.18
│   │   ├── miette v7.1.0
│   │   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   │   └── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore) (*)
│   ├── wayland-backend v0.3.3
│   │   ├── wayland-client v0.31.2
│   │   ├── wayland-protocols v0.31.2
│   │   ├── wayland-protocols-wlr v0.2.0
│   │   └── wl-clipboard-rs v0.8.0 (*)
│   ├── wayland-client v0.31.2 (*)
│   ├── which v6.0.0
│   │   ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│   │   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   │   └── nu-test-support v0.91.1 (/home/stefan/nushell/crates/nu-test-support) (*)
│   └── xattr v1.3.1
│       └── uu_cp v0.0.23 (*)
├── wayland-client v0.31.2 (*)
├── wayland-protocols v0.31.2 (*)
└── wayland-protocols-wlr v0.2.0 (*)

itertools v0.11.0
└── wax v0.6.0
    └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)

itertools v0.12.0
├── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra) (*)
├── nu-cmd-lang v0.91.1 (/home/stefan/nushell/crates/nu-cmd-lang) (*)
├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
├── nu-parser v0.91.1 (/home/stefan/nushell/crates/nu-parser) (*)
├── ratatui v0.26.0 (*)
└── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)

libc v0.2.152
├── backtrace v0.3.69
│   ├── backtrace-ext v0.2.1
│   │   └── miette v7.1.0 (*)
│   └── miette v7.1.0 (*)
├── console v0.15.8
│   ├── dialoguer v0.11.0
│   │   └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── indicatif v0.17.7
│       ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│       ├── uu_cp v0.0.23 (*)
│       └── uu_mv v0.0.23 (*)
├── crossterm v0.27.0 (*)
├── dirs-sys-next v0.1.2
│   └── dirs-next v2.0.0
│       └── nu-path v0.91.1 (/home/stefan/nushell/crates/nu-path)
├── divan v0.1.14
│   [dev-dependencies]
│   └── nu v0.91.1 (/home/stefan/nushell)
├── filetime v0.2.23
│   ├── notify v6.1.1 (*)
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── uu_cp v0.0.23 (*)
├── gethostname v0.3.0
│   └── x11rb v0.12.0 (*)
├── getrandom v0.2.12
│   ├── rand_core v0.6.4
│   │   ├── rand v0.8.5
│   │   └── rand_chacha v0.3.1
│   └── uuid v1.7.0
│       ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│       └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
├── inotify v0.9.6 (*)
├── inotify-sys v0.1.5
│   └── inotify v0.9.6 (*)
├── libmimalloc-sys v0.1.35
│   └── mimalloc v0.1.39
│       └── nu v0.91.1 (/home/stefan/nushell)
├── mio v0.8.11
│   ├── crossterm v0.27.0 (*)
│   ├── notify v6.1.1 (*)
│   └── signal-hook-mio v0.2.3
│       └── crossterm v0.27.0 (*)
├── nix v0.26.4 (*)
├── nix v0.27.1 (*)
├── notify v6.1.1 (*)
├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
├── nu-system v0.91.1 (/home/stefan/nushell/crates/nu-system) (*)
├── open v5.1.1
│   └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
├── openssl v0.10.63 (*)
├── openssl-sys v0.9.99
│   ├── native-tls v0.2.11 (*)
│   └── openssl v0.10.63 (*)
├── os_pipe v1.1.5
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── wl-clipboard-rs v0.8.0 (*)
├── parking_lot_core v0.9.9
│   ├── dashmap v5.5.3
│   │   └── serial_test v3.0.0
│   │       [dev-dependencies]
│   └── parking_lot v0.12.1
│       ├── arboard v3.3.0 (*)
│       ├── crossterm v0.27.0 (*)
│       ├── notify-debouncer-full v0.3.1 (*)
│       └── serial_test v3.0.0 (*)
├── pwd v1.4.0
│   └── nu-path v0.91.1 (/home/stefan/nushell/crates/nu-path) (*)
├── rand v0.8.5 (*)
├── signal-hook v0.3.17
│   ├── crossterm v0.27.0 (*)
│   └── signal-hook-mio v0.2.3 (*)
├── signal-hook-mio v0.2.3 (*)
├── signal-hook-registry v1.4.1
│   └── signal-hook v0.3.17 (*)
├── sysinfo v0.30.5
│   ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
│   ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│   └── nu-system v0.91.1 (/home/stefan/nushell/crates/nu-system) (*)
├── time v0.3.31
│   ├── nu v0.91.1 (/home/stefan/nushell)
│   └── simplelog v0.12.1
│       └── nu v0.91.1 (/home/stefan/nushell)
├── trash v3.3.1
│   └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
├── uu_cp v0.0.23 (*)
├── uu_whoami v0.0.23 (*)
├── uucore v0.0.24 (*)
├── wait-timeout v0.2.0
│   └── assert_cmd v2.0.13
│       [dev-dependencies]
│       └── nu v0.91.1 (/home/stefan/nushell)
└── wl-clipboard-rs v0.8.0 (*)

libc v0.2.152
├── cc v1.0.83
│   [build-dependencies]
│   ├── backtrace v0.3.69 (*)
│   ├── libmimalloc-sys v0.1.35 (*)
│   ├── libsqlite3-sys v0.28.0
│   │   └── rusqlite v0.31.0 (*)
│   ├── openssl-sys v0.9.99 (*)
│   └── wayland-backend v0.3.3 (*)
└── time v0.3.31
    └── shadow-rs v0.26.1
        └── nu-cmd-lang v0.91.1 (/home/stefan/nushell/crates/nu-cmd-lang) (*)
        [build-dependencies]
        └── nu-cmd-lang v0.91.1 (/home/stefan/nushell/crates/nu-cmd-lang) (*)

nix v0.26.4 (*)

nix v0.27.1 (*)

quick-xml v0.31.0
└── wayland-scanner v0.31.1 (proc-macro)
    ├── wayland-client v0.31.2 (*)
    ├── wayland-protocols v0.31.2 (*)
    └── wayland-protocols-wlr v0.2.0 (*)

quick-xml v0.31.0
├── calamine v0.24.0
│   └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
└── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)

rand v0.8.5 (*)

rand v0.8.5
└── phf_generator v0.11.2
    └── phf_codegen v0.11.2
        └── chrono-tz-build v0.2.1
            [build-dependencies]

rand_core v0.6.4
└── rand v0.8.5 (*)

rand_core v0.6.4 (*)

regex-automata v0.4.5
├── bstr v1.9.0
│   └── assert_cmd v2.0.13 (*)
└── fancy-regex v0.13.0
    ├── nu-cli v0.91.1 (/home/stefan/nushell/crates/nu-cli) (*)
    ├── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra) (*)
    ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
    ├── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
    └── nu-table v0.91.1 (/home/stefan/nushell/crates/nu-table) (*)

regex-automata v0.4.5
└── regex v1.10.3
    ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
    ├── parse-zoneinfo v0.3.0
    │   └── chrono-tz-build v0.2.1 (*)
    ├── rstest_macros v0.18.2 (proc-macro)
    │   └── rstest v0.18.2
    │       [dev-dependencies]
    ├── titlecase v2.2.1
    │   └── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
    └── wax v0.6.0 (*)

syn v1.0.109
├── derive-new v0.5.9 (proc-macro)
│   └── wl-clipboard-rs v0.8.0 (*)
└── stability v0.1.1 (proc-macro)
    └── ratatui v0.26.0 (*)

syn v2.0.48
├── divan-macros v0.1.14 (proc-macro)
│   └── divan v0.1.14 (*)
├── miette-derive v7.1.0 (proc-macro)
│   └── miette v7.1.0 (*)
├── openssl-macros v0.1.1 (proc-macro)
│   └── openssl v0.10.63 (*)
├── pest_generator v2.7.6
│   └── pest_derive v2.7.6 (proc-macro)
│       └── human-date-parser v0.1.1
├── rstest_macros v0.18.2 (proc-macro) (*)
├── rust-embed-impl v8.2.0 (proc-macro)
│   └── rust-embed v8.2.0
│       └── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra) (*)
├── serde_derive v1.0.196 (proc-macro)
│   └── serde v1.0.196
│       ├── bincode v1.3.3
│       ├── bitflags v2.4.2 (*)
│       ├── byte-unit v5.1.4 (*)
│       ├── calamine v0.24.0 (*)
│       ├── chrono v0.4.35
│       ├── crossterm v0.27.0 (*)
│       ├── csv v1.3.0
│       ├── erased-serde v0.4.2
│       ├── linked-hash-map v0.5.6
│       ├── lsp-server v0.7.6
│       ├── lsp-types v0.95.0 (*)
│       ├── nu-cmd-extra v0.91.1 (/home/stefan/nushell/crates/nu-cmd-extra) (*)
│       ├── nu-color-config v0.91.1 (/home/stefan/nushell/crates/nu-color-config) (*)
│       ├── nu-command v0.91.1 (/home/stefan/nushell/crates/nu-command) (*)
│       ├── nu-json v0.91.1 (/home/stefan/nushell/crates/nu-json)
│       ├── nu-lsp v0.91.1 (/home/stefan/nushell/crates/nu-lsp) (*)
│       ├── nu-plugin v0.91.1 (/home/stefan/nushell/crates/nu-plugin) (*)
│       ├── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
│       ├── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
│       ├── rmp-serde v1.1.2
│       ├── serde_json v1.0.112
│       ├── serde_spanned v0.6.5
│       ├── serde_urlencoded v0.7.1
│       ├── serde_yaml v0.9.30
│       ├── toml v0.8.8
│       ├── toml_datetime v0.6.5
│       ├── toml_edit v0.21.0
│       ├── typetag v0.2.15
│       ├── ureq v2.9.1 (*)
│       └── url v2.5.0
├── serde_repr v0.1.18 (proc-macro)
│   └── lsp-types v0.95.0 (*)
├── serial_test_derive v3.0.0 (proc-macro)
│   └── serial_test v3.0.0 (*)
├── strum_macros v0.26.1 (proc-macro)
│   ├── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
│   └── strum v0.26.1
│       ├── ratatui v0.26.0 (*)
│       └── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
├── thiserror-impl v1.0.56 (proc-macro)
│   └── thiserror v1.0.56
│       ├── arboard v3.3.0 (*)
│       ├── dialoguer v0.11.0 (*)
│       ├── human-date-parser v0.1.1 (*)
│       ├── miette v7.1.0 (*)
│       ├── nu-protocol v0.91.1 (/home/stefan/nushell/crates/nu-protocol) (*)
│       ├── pest v2.7.6
│       ├── pwd v1.4.0 (*)
│       ├── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
│       ├── umask v2.1.0
│       ├── wax v0.6.0 (*)
│       └── wl-clipboard-rs v0.8.0 (*)
└── typetag-impl v0.2.15 (proc-macro)
    └── typetag v0.2.15 (*)

time v0.3.31 (*)

time v0.3.31 (*)

vte v0.10.1 (*)

vte v0.11.1
└── strip-ansi-escapes v0.2.0
    ├── nu-explore v0.91.1 (/home/stefan/nushell/crates/nu-explore) (*)
    ├── nu-utils v0.91.1 (/home/stefan/nushell/crates/nu-utils) (*)
    └── reedline v0.30.0 (https://github.com/nushell/reedline?branch=main#06987127) (*)
@sholderbach sholderbach added dependencies Pull requests that update a dependency file help wanted Extra attention is needed upstream problem with upstream dependency labels Feb 12, 2023
@sholderbach sholderbach pinned this issue Feb 12, 2023
@sholderbach
Copy link
Member Author

@zhiburt would there be any potential breaking changes bumping ansi-str to the newest version in papergrid and tabled? Right now we are duplicating there in nu-explore

@zhiburt
Copy link
Contributor

zhiburt commented Feb 13, 2023

@zhiburt would there be any potential breaking changes bumping ansi-str to the newest version in papergrid and tabled? Right now we are duplicating there in nu-explore

As I remember there will be small ones;
But I do think the next release must wait for a bit

@WindSoilder
Copy link
Collaborator

After running cargo deny check ban, found that some dependency's Cargo.toml can be updated easily. Submitted some prs to update them:

  1. (cfg-if) Dependency change: update cfg-if to version 1.0 deprecrated/net2-rs#114
  2. (quick-xml) Dependency: update quick-xml to 0.27 tafia/calamine#293
  3. (toml) Dependency: update toml to 0.7 mxre/winres#45
  4. (quick-error) Update quick-error to 2.0 AltSysrq/rusty-fork#14 Someone is already create a pr
  5. (users) https://gitlab.com/caralice/is-root/-/merge_requests/1

And some dependencies already updated:

  1. base64 -- need to update reqwest version
  2. itoa -- need to update csv version

rgwood pushed a commit that referenced this issue Feb 22, 2023
# Description

Relative: #8060

While investigating, I found we need to update notify, which is a good
step to remove some duplicate dependencies.

As title, here are some goods and bads after updating:

## Good
keep dependency up to date, and remove duplidate dependency(cfg-if,
winapi) in Cargo.lock.

## Bad
Introduce some breaking changes:
After updating to notify v5, I found that we have to remove `Rename`
events.

But I've testing under notify v4, and it doesn't work good if we running
the following command on MacOS:
```
touch a
mv a b
```
It fires file create event, but no file rename event. So `rename` event
is not really reliable, so I think it's ok for us to remove `Rename`
events.

The reason to remove `--debounce-ms` flag:
It's not provided by defualt file watcher, we can use
[PollWatcher](https://docs.rs/notify/latest/notify/poll/struct.PollWatcher.html),
but it scans filesystem, which is really expensive. So I just remove the
flag.

# User-Facing Changes

1. `--debounce-ms` flag is removed
2. no longer watch `Rename` event.

# 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` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

# 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.
@sholderbach sholderbach unpinned this issue Mar 14, 2023
fdncred pushed a commit that referenced this issue Apr 26, 2023
close? #8060

Quite a bit of refactoring took place.
I believe a few improvements to collapse/expand were made.

I've tried to track any performance regressions and seems like it is
fine.

I've noticed something different now with default configuration path or
something in this regard?
So I might missed something while testing because of this.

Requires some oversight.

---------

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
sholderbach added a commit to sholderbach/nushell that referenced this issue Jul 10, 2023
Apart from `polars` (only used with `--features dataframe`) and the
dev-dependencies our deps use `indexmap 2.0`.
Thus the default or `extra` `cargo build` will reduce deps.
This also will help deduplicating `hashbrown` and `ahash`.

For nushell#8060
sholderbach added a commit that referenced this issue Jul 10, 2023
# Description
Apart from `polars` (only used with `--features dataframe`) and the
dev-dependencies our deps use `indexmap 2.0`.
Thus the default or `extra` `cargo build` will reduce deps.
This also will help deduplicating `hashbrown` and `ahash`.

For #8060

- Bump `indexmap` to 2.0
- Remove unneeded `serde` feature from `indexmap`

# User-Facing Changes
None
fdncred pushed a commit that referenced this issue Jan 5, 2024
# Description
Simplify the dependencies. There are two different versions of
`terminal_size` that nushell directly depends on.

Related: #8060
fdncred pushed a commit that referenced this issue Jan 22, 2024
# Description

`which` 5.0.0 is already in the dependency tree, so remove v4.4.2

Related: #8060
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this issue Feb 20, 2024
# Description
Simplify the dependencies. There are two different versions of
`terminal_size` that nushell directly depends on.

Related: nushell#8060
dmatos2012 pushed a commit to dmatos2012/nushell that referenced this issue Feb 20, 2024
# Description

`which` 5.0.0 is already in the dependency tree, so remove v4.4.2

Related: nushell#8060
@sholderbach sholderbach pinned this issue Mar 11, 2024
@YizhePKU
Copy link
Contributor

YizhePKU commented May 1, 2024

Windows FFI

There're three major crates for Windows FFI that we're using:

  • windows v0.54.0 (the lastest version is v0.56.0)
  • windows-sys v0.52.0
  • winapi v0.3.9

The windows crate takes a very long time to build (1~2 minutes depending on features).
The other two crates builds much faster, though still noticeable. I think we should avoid duplicating the windows crate at all times.

windows v0.44.0
└── trash v3.3.1

windows v0.52.0
└── sysinfo v0.30.11 (*)

windows-sys v0.48.0
├── file-id v0.2.1
├── notify v6.1.1 (*)
├── nu-ansi-term v0.50.0
├── terminal_size v0.3.0
├── uu_whoami v0.0.25 (*)
├── uucore v0.0.25 (*)
└── winreg v0.52.0

Once the upstream have updated to v0.56.0, we can update as well. Now we wait for upstream to publish their update.

The windows-sys crate seems stuck between v0.48.0 and v0.52.0. Given that it's a really small crate with only headers, it's probably fine. The winapi crate is built twice (probably because of resolver v2) but otherwise has no version duplication.

@sholderbach
Copy link
Member Author

Thanks for the upstream work @YizhePKU !

Agreed that the situation around windows/windows-sys/winapi is generally a bit unfortunate. winapi is stale in development (unclear when that could really impact us) but most crates that use it agree on the latest version at this point, while the competitor in windows-sys sees relatively frequent updates leading to duplication at times. With the windows wrapper it may be a case by case decision if it makes sense to rely on it and enable extra features or if we can justify the raw windows-sys with unsafe bindings. If I saw that right the trash crate pulls in a COM API that is only possible to manage with windows? But getting us to one version should at least make the pain less bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file help wanted Extra attention is needed upstream problem with upstream dependency
Projects
None yet
Development

No branches or pull requests

4 participants