rerun icon indicating copy to clipboard operation
rerun copied to clipboard

Unify time handling around `jiff`

Open teh-cmc opened this issue 9 months ago • 5 comments

We have 3 time libraries right now (maybe more, actually?), and we know how that ends.

TODO:

  • Ban chrono
  • Ban time
  • Use jiff everywhere

  • Related: https://github.com/rerun-io/dataplatform/issues/419

teh-cmc avatar Mar 19 '25 09:03 teh-cmc

Hey @teh-cmc, I'd like to work on this! But also want to know, what is the related issue, as it is "404-Not found"

NiharP31 avatar Apr 01 '25 17:04 NiharP31

@NiharP31 Awesome that you want to contribute! :) The linked issue is the same issue mirrored on our upcoming closed-source/commercial product so same story and just linked for convenience for Rerun employees. A good start would to get a sense of all usages of chrono and time each, for starters just direct dependencies of Rerun crates. That should already go in one or more separate PRs. Once you're through with that you can have a look at the entire tree using cargo tree and see if we can get rid of transitives and then finally adjust cargo.deny accordingly, if need to be with some exceptions.

Wumpf avatar Apr 01 '25 18:04 Wumpf

@Wumpf got your point. Would attach a PR soon.

NiharP31 avatar Apr 02 '25 18:04 NiharP31

Hey @Wumpf, I migrated files from Time to Jiff. Test runs fine.

But, while building from root, I get Persistent Web Viewer Build Error After Migration

Context: Migrated dependency from time to jiff crate. Followed build instructions but still get:

thread 'main' panicked at build.rs:11:9:  
Web viewer not found, run `pixi run rerun-build-web` to build it!

Steps Taken:

  1. Ran pixi run rerun-build-web successfully:
    • ✅ Created rerun/web_viewer/re_viewer_bg.wasm (1.8s build)
    • ✅ Generated JS bindings (rerun/web_viewer/e_viewer.js)
  2. Verified files exist in \rerun\web_viewer\
  3. Ran cargo build → Same panic about missing web viewer

Key Contradiction:

Build system claims web viewer is missing
But files exist at expected path:
rerun/web_viewer/{re_viewer.js, re_viewer_bg.wasm}
Noticed that crates/viewer/re_web_viewer_server/build.rs has paths setup

Also, I cleaned and rebuild from scratch, but same error occurs. Are the paths needs to be modified? Can you guide me here

Error Snippet

Image

NiharP31 avatar Apr 03 '25 17:04 NiharP31

@NiharP31 maybe the symlink at crates/viewer/re_web_viewer_server/web_viewer is broken? Symlinks in git used to be a problem on Windows, but nowadays it mostly just works. But maybe your git install isn't configured correctly, see https://stackoverflow.com/questions/5917249/git-symbolic-links-in-windows/59761201#59761201 The check that gives you that error is looking for ./crates/viewer/re_web_viewer_server/web_viewer/re_viewer.js which should redirect to ./web_viewer/re_viewer.js. Might be worth removing the link and running git restore on re_web_viewer_server then

Wumpf avatar Apr 03 '25 18:04 Wumpf