rust-datetime / datetime

Dates and times library for Rust.
MIT License
15 stars 9 forks source link

[2 in 1] datetime/exa issues #14

Closed MagaTailor closed 8 years ago

MagaTailor commented 8 years ago

I've managed to compile exa on ARM using rust 1.5 and --no-default-features but first had to fix this by casting to i64:

Compiling datetime v0.4.2
/tmp/.cargo/registry/src/github.com-48ad6e4054423464/datetime-0.4.2/src/system.rs:38:6: 38:15 error: mismatched types:
 expected `i64`,
    found `i32`
(expected i64,
    found i32) [E0308]
/tmp/.cargo/registry/src/github.com-48ad6e4054423464/datetime-0.4.2/src/system.rs:38     (tv.tv_sec, (tv.tv_nsec / 1000) as i16)
                                                                                          ^~~~~~~~~
/tmp/.cargo/registry/src/github.com-48ad6e4054423464/datetime-0.4.2/src/system.rs:38:6: 38:15 help: run `rustc --explain E0308` to see a detailed explanation
error: aborting due to previous error
Could not compile `datetime`.

only to find -l option doesn't work:

$  ~/exa-20160211 -l
thread '<main>' panicked at 'Unable to determine time zone', src/libcore/option.rs:334
stack backtrace:
   1: 0xb6ddf9df - sys::backtrace::tracing::imp::write::h86e39446169e67d0Wnt
   2: 0xb6de2513 - panicking::log_panic::_<closure>::closure.39676
   3: 0xb6de1f47 - panicking::log_panic::h7e0ce1e7485944fbUpx
   4: 0xb6dd1b87 - sys_common::unwind::begin_unwind_inner::h1d39a3f983dfda740gs
   5: 0xb6dd2507 - sys_common::unwind::begin_unwind_fmt::h2f77b9962e7023ac6fs
   6: 0xb6ddf053 - rust_begin_unwind
   7: 0xb6def38f - panicking::panic_fmt::h48301c5acd531c5bZEK
   8: 0xb6d1580b - option::_<impl>::expect::expect::h2570453751442068436
                at src/libcore/macros.rs:28
   9: 0xb6d150bf - output::details::_<impl>::default::h8a8ad7389276de4aFic
                at src/output/details.rs:171
  10: 0xb6d19297 - output::details::_<impl>::view::h4851bbe4ecd53aaakjc
                at src/output/details.rs:191
  11: 0xb6d58303 - _<impl>::print_files::h4dce2bbed8c81fe4ZRe
                at src/main.rs:137
  12: 0xb6d592ab - _<impl>::print_dirs::hd6db41078e88377a1Me
                at src/main.rs:129
  13: 0xb6d572db - _<impl>::run::h8dfb0d815e94decaZJe
                at src/main.rs:77
  14: 0xb6d5a23b - main::ha86e656adc12d327HSe
                at src/main.rs:151

Is it related or maybe 1.5 is already too old?

MagaTailor commented 8 years ago

BTW, I remember remarking about ARM vs x86 binary size a few months ago - why is it so much bigger now on ARM even without git support?

884456   Oct  2 03:16 /home/odroid/exa
674512   Nov  3 20:24 /usr/local/bin/exa
2734920  Feb 11 15:04 /home/odroid/exa-20160211
ogham commented 8 years ago

Hmmm, I'm not sure. I've been adding more and more libraries to exa, and some of them (zoneinfo-data, for example) can get pretty big. I need to make some of them optional again.

ogham commented 8 years ago

Thanks for the backtrace. It checks /etc/localtime to try to determine the time zone; do you have this file?

ogham commented 8 years ago

Wait a minute, I thought I wrote that function to print out an error if it can't figure out which time zone to use, but I guess expect doesn't print out the error case. Let me fix...

MagaTailor commented 8 years ago

Yes, my system is set to local time but it seems the file contains some garbage! Probably the result of power outage and writeback journalling.

ogham commented 8 years ago

OK, I make sure we print out the error (in ogham/exa@252eba484476369bb966fb1af7f739732b968fc0) when it can't determine what the time zone is.

The file in /etc/garbage is a compiled binary file. exa tests if it's a symlink and tries to work out the time zone that way; otherwise, it tries to parse the file; otherwise, it fails with that error.

MagaTailor commented 8 years ago

Ah, ok! Let me try the patch. I'll close if everything is fine again.

ogham commented 8 years ago

:+1:

MagaTailor commented 8 years ago

What's the situation on the LFS front?

ogham commented 8 years ago

Large File Support? There's current a pull request for it that trades struct fields for accessors that should fix the file size problem.

MagaTailor commented 8 years ago

Wow, a mere 16 hours ago ;)

MagaTailor commented 8 years ago

Did you forget to push the updated crate to crates.io? It looks like it.

ogham commented 8 years ago

Argh

ogham commented 8 years ago

Pushed. What are the odds I'll forget for the next version too? Place your bets now.

MagaTailor commented 8 years ago

One in an i64? ;)