mesalock-linux / mesabox

A collection of core system utilities written in Rust for Unix-like systems (and now Windows)
BSD 3-Clause "New" or "Revised" License
137 stars 19 forks source link

Add support for Windows (for some utilities) #35

Closed Arcterus closed 6 years ago

Arcterus commented 6 years ago

Not sure if we really care about this, so I'm making it a pull request. I have essentially abstracted RawFd into RawObject, which is a RawFd on Unix and a RawHandle on Windows (I may add support for RawSocket as well, as I am thinking about implementing UtilRead and UtilWrite for TcpStream).

Note that a few tests still fail for cat and head on Windows. It may just have been because git replaced the line endings for the fixtures though.

Arcterus commented 6 years ago

Note that this is only failing due to cargo fmt. I’d like feedback before I fix that issue.

codecov[bot] commented 6 years ago

Codecov Report

Merging #35 into master will decrease coverage by 0.41%. The diff coverage is 2.2%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
- Coverage    15.5%   15.08%   -0.42%     
==========================================
  Files          36       41       +5     
  Lines        3592     3698     +106     
  Branches      925      926       +1     
==========================================
+ Hits          557      558       +1     
- Misses       2766     2870     +104     
- Partials      269      270       +1
Impacted Files Coverage Δ
src/util.rs 57.77% <ø> (+12.39%) :arrow_up:
src/posix/sh/ast.rs 0% <0%> (ø) :arrow_up:
src/posix/chmod/mod.rs 35.52% <0%> (ø) :arrow_up:
src/posix/sh/builtin/cd.rs 0% <0%> (ø) :arrow_up:
src/posix/sh/env.rs 0% <0%> (ø) :arrow_up:
src/posix/sh/command.rs 0% <0%> (ø) :arrow_up:
src/posix/sh/types/scoped_map.rs 0% <0%> (ø)
src/posix/echo/mod.rs 57.4% <0%> (-1.86%) :arrow_down:
src/posix/sh/types/scoped_array.rs 0% <0%> (ø)
src/posix/sh/mod.rs 0% <0%> (ø) :arrow_up:
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7729fb6...581694a. Read the comment docs.

Arcterus commented 6 years ago

This is temporarily broken on Windows due to changes I've made without access to a Windows laptop.

Arcterus commented 6 years ago

If no one objects I am inclined to just merge this (or close this pull request and just push my code to master) as it no longer is just changes related to adding Windows support.

mssun commented 6 years ago

I'm OK with the Windows support.