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

Windows SPFS Build #829

Merged
merged 5 commits into from
Aug 5, 2023
Merged

Windows SPFS Build #829

merged 5 commits into from
Aug 5, 2023

Conversation

rydrman
Copy link
Collaborator

@rydrman rydrman commented Aug 4, 2023

This allows spfs to build via cross, but produces a binary that will panic because of missing implementations. The goal at this point is to build for windows in CI to avoid any regressions moving forward as we work to add support and fill in the stubbed-out functionality

For the most part, I've taken to adding *_win.rs modules alongside the existing unix ones with stub-functions. There's obviously a chance that the actual implementation differs and we do something else but this seemed like the best place to start in terms of getting the build to complete and clearly showing the main pieces that we need to work on adding implementations for.

In terms of permissions, I've taken the same route as git which is to say that all files are committed with the same 644 permissions and we don't deal with permissions at all when rendering. We will need to likely do something about tracking executable bits and handling diffs in existing environments, but as far as I can tell there's no simple way to translate from the windows security model. We could look at the owner/current user and try to do a mapping but I'm not sure that there's a good reason to try.

@rydrman rydrman added the windows label Aug 4, 2023
@rydrman rydrman added this to the Windows Support milestone Aug 4, 2023
@rydrman rydrman force-pushed the windows-build branch 3 times, most recently from 876feed to 4b089d3 Compare August 4, 2023 01:26
Comment on lines -229 to +231
let display_total: String = if num_digits > DIGITS_LIMIT {
format!("{total:5.4e}").replace('e', " x 10^")
} else {
// TODO: it would be nice to format these large numbers using
// something like the num-format crate, but the bignum's
// (rug::Integer) used to hold the large numbers in these
// calculations would need to support or be wrapped to
// implement num-format's required traits.
total.to_string()
};
use num_format::ToFormattedString;
let display_total = total.to_formatted_string(&num_format::Locale::en);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this change, since BigUint does not support the scientific notation formatting (yet - see below), but it does support the use of the num-format crate which was our plan anyway, it seems.

rust-num/num-bigint#6

@rydrman rydrman force-pushed the windows-build branch 2 times, most recently from 9ea296a to b06bff1 Compare August 4, 2023 01:37
@rydrman rydrman self-assigned this Aug 4, 2023
@rydrman rydrman force-pushed the windows-build branch 2 times, most recently from 79c3687 to 97372e4 Compare August 4, 2023 15:35
@rydrman rydrman changed the title Draft: Windows SPFS Build Windows SPFS Build Aug 4, 2023
This allows spfs to build via cross, but produces a binary that will
panic because of missing implementations. The goal at this point is to
build for windows in CI to avoid any regressions moving forward as we
work to add support.

Signed-off-by: Ryan Bottriell <[email protected]>
@rydrman rydrman requested a review from jrray August 4, 2023 16:34
Base automatically changed from file-mode-crate to main August 5, 2023 02:36
@rydrman rydrman merged commit f96dc3f into main Aug 5, 2023
@rydrman rydrman deleted the windows-build branch August 5, 2023 02:38
@rydrman rydrman mentioned this pull request Nov 1, 2023
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants