eza-community / eza

A modern alternative to ls
https://eza.rocks
European Union Public License 1.2
11.41k stars 205 forks source link

Warnings went building eza v0.18.11 with cargo #942

Open clavelm opened 5 months ago

clavelm commented 5 months ago

I’m not sure where to put this as it’s not a bug, nor a compilation error.

When building eza v0.18.11 with cargo with cargo, I’m getting warnings. I am in a local git repo, in detached head on the commit corresponding to the tag v0.18.11.

❯ git switch -d v0.18.11
Previous HEAD position was 75f1f8cf chore: release eza v0.18.10
HEAD is now at 99562e3a chore: release eza v0.18.11
❯ cargo install --path .
 Installing eza v0.18.11 (/root/eza)
    Updating crates.io index
[OMITTED FOR BREVITY]
   Compiling git2 v0.18.3
warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp_opt`: use `DateTime::from_timestamp` instead
   --> src/fs/file.rs:740:24
    |
740 |         NaiveDateTime::from_timestamp_opt(self.metadata.ctime(), self.metadata.ctime_nsec() as u32)
    |                        ^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: `eza` (lib) generated 1 warning
warning: unused imports: `DisplayWidth`, `TextCellContents`, `TextCell`
 --> src/output/mod.rs:2:22
  |
2 | pub use self::cell::{DisplayWidth, TextCell, TextCellContents};
  |                      ^^^^^^^^^^^^  ^^^^^^^^  ^^^^^^^^^^^^^^^^
  |
note: the lint level is defined here
 --> src/main.rs:7:9
  |
7 | #![warn(unused)]
  |         ^^^^^^
  = note: `#[warn(unused_imports)]` implied by `#[warn(unused)]`

^[warning: `eza` (bin "eza") generated 2 warnings (1 duplicate) (run `cargo fix --bin "eza"` to apply 1 suggestion)
    Finished release [optimized] target(s) in 7m 35s
   Replacing /root/.cargo/bin/eza
    Replaced package `eza v0.18.10 (/root/eza)` with `eza v0.18.11 (/root/eza)` (executable `eza`)
MartinFillon commented 5 months ago

Hey thanks for bringing up attention to this, we will have a look at them asap

MartinFillon commented 5 months ago

could you tell me your os and rust version please.

clavelm commented 5 months ago

Rust was not updated when I submitted this issue, and the unused imports warning came from that.

I’m building on an ubuntu running in a docker container.

❯ uname -a
Linux a9f4dea95e00 4.4.302+ #69057 SMP Fri Jan 12 17:02:28 CST 2024 x86_64 x86_64 x86_64 GNU/Linux

❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy

In ~:

❯ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)

In my local eza repo, overridden by './rust-toolchain.toml':

❯ rustc --version
rustc 1.70.0 (90c541806 2023-05-31)
❯ cargo install --path .
  Installing eza v0.18.11 (/root/eza)
    Updating crates.io index
warning: use of deprecated associated function `chrono::NaiveDateTime::from_timestamp_opt`: use `DateTime::from_timestamp` instead
   --> src/fs/file.rs:740:24
    |
740 |         NaiveDateTime::from_timestamp_opt(self.metadata.ctime(), self.metadata.ctime_nsec() as u32)
    |                        ^^^^^^^^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default

warning: `eza` (lib) generated 1 warning
warning: `eza` (bin "eza") generated 1 warning (1 duplicate)
    Finished release [optimized] target(s) in 7.21s
   Replacing /root/.cargo/bin/eza
    Replaced package `eza v0.18.11 (/root/eza)` with `eza v0.18.11 (/root/eza)` (executable `eza`)