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

Make the dependency filetime optional #277

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Jan 7, 2022

  1. Configuration menu
    Copy the full SHA
    7bcb855 View commit details
    Browse the repository at this point in the history
  2. Split Builder functionality into a feature

    Or, “the outworking of making libc optional in order to reach zero
    dependencies, even though you almost certainly depend on libc by some
    other path already”.
    
    This one is rather more extreme, but I was curious and it happened, and
    frankly I think the end result is pretty decent, so that if I were
    maintaining this crate I’d ship it. There are plenty of people who won’t
    use Builder functionality, being able to turn it off is a fairly trivial
    nice thing. And yeah, I just like being able to have no dependencies
    sometimes.
    
    Along the way I noticed wasm32 has a big ol’ unimplemented!() on
    Header::fill_platform_from. I should learn what WASI does for a file
    system. Probably there should be a simple fallback implementation that
    only knows about files, directories and symlinks.
    chris-morgan committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    2fb7496 View commit details
    Browse the repository at this point in the history
  3. Fix Builder on cfg(not(any(unix, windows)))

    - cfg(target_arch = "wasm32") would panic if you tried to do any std::fs
      Builder stuff, which was fine for wasm32-unknown-unknown and
      wasm32-unknown-emscripten, but not good for wasm32-wasi, which has a
      file system.
    
      (Might still want a specialised implementation for wasm32-wasi:
      std::os::wasi::fs::FileTypeExt is currently unstable, but offers
      is_block_device, is_character_device, is_socket_dgram and
      is_socket_stream. But this one is good to start with.)
    
    - cfg(not(any(unix, windows, target_arch = "wasm32"))) would fail to
      compile (… unless you disabled the builder feature, since my previous
      commit).
    
    Now it all works pretty decently.
    chris-morgan committed Jan 7, 2022
    Configuration menu
    Copy the full SHA
    b031dee View commit details
    Browse the repository at this point in the history