-
Notifications
You must be signed in to change notification settings - Fork 15
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
Rewrite scubainit in Rust #232
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Test Results 5 files 5 suites 1m 32s ⏱️ Results for commit a29a850. ♻️ This comment has been updated with latest results. |
JonathonReinhart
force-pushed
the
scubainit-rust
branch
6 times, most recently
from
December 18, 2023 06:25
2736605
to
e857f86
Compare
JonathonReinhart
force-pushed
the
scubainit-rust
branch
from
December 18, 2023 08:31
e857f86
to
5edf071
Compare
JonathonReinhart
force-pushed
the
scubainit-rust
branch
3 times, most recently
from
December 27, 2023 22:53
d6c7efb
to
f73cf7d
Compare
This was referenced Dec 27, 2023
JonathonReinhart
force-pushed
the
scubainit-rust
branch
from
December 27, 2023 23:26
f73cf7d
to
eae0d08
Compare
Yeah sure, I can take a look next week when when I’m back at a computer |
jammiess
reviewed
Dec 28, 2023
JonathonReinhart
force-pushed
the
scubainit-rust
branch
3 times, most recently
from
December 30, 2023 04:53
3e13c85
to
1adca37
Compare
This was referenced Dec 30, 2023
jammiess
reviewed
Dec 31, 2023
JonathonReinhart
force-pushed
the
scubainit-rust
branch
2 times, most recently
from
December 31, 2023 19:55
98a25bf
to
4646e48
Compare
We need to set some special flags for static builds were are as small as reasonably possible. Ideally we'd handle this with only cargo, but: - Cargo only supports a subset of rustc options, so we have to set RUSTFLAGS somewhere. - The top-level Makefile shouldn't need to know about cargo This also runs 'rustup add target' as a dependent command, for simplicity. This adds ~100 ms after the initial setup.
Set USE_SCUBAINIT_RUST=1 to use the new scubainit-rs.
Previously, the code would simply skip invalid entries. Now, we pass these errors up from the iterator to let the caller handle this as desired. This follows the pattern of std::fs::ReadDir whose Iterator impl has Item = Result<...>. scubainit main handles this in the most conservative way by aborting on any invalid entry.
This reduces duplication and improves readability of the from_line() implementations.
Rather than use lifetimes on the EntFileReader and EntFileWriter structs, we can implement the common into_inner() convention. This consumes the outer object returning the inner wrapped object, which in this case is the File which we want to reuse. This matches e.g. `std::io::BufReader::into_inner()`. Note that this also requires changing the way the reader is iterated: We use `for x in &mut reader` which avoids moving the `reader` object into the loop, allowing `into_inner()` to be subsequently called. See the discussion here: #239 (comment).
This adds several psuedo-targets as listed in the help. The goal here is to allow "make all" without requiring checks, which is useful during debugging.
This runs tests, lints, and checks code formatting.
JonathonReinhart
force-pushed
the
scubainit-rust
branch
from
January 2, 2024 04:35
4646e48
to
a29a850
Compare
JonathonReinhart
added
the
scubainit
Relating to the scubainit binary which runs at container startup
label
Jan 2, 2024
JonathonReinhart
added a commit
that referenced
this pull request
Mar 24, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR rewrites scubainit -- previously implemented in C -- in Rust.
Rust provides stronger type- and memory-safety guarantees, and additional capabilities via a rich stdlib and crate ecosystem.