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

Split up utils module #138

Merged
merged 2 commits into from
Aug 21, 2021
Merged

Split up utils module #138

merged 2 commits into from
Aug 21, 2021

Conversation

mkroening
Copy link
Member

@mkroening mkroening commented Jul 11, 2021

Binaries get a much smaller bin_utils and other helper functions are
replaced/moved.

@mkroening mkroening self-assigned this Jul 11, 2021
This was referenced Jul 12, 2021
@mkroening
Copy link
Member Author

Rebased on latest master.

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

Merging #138 (6715a30) into master (22632af) will decrease coverage by 0.96%.
The diff coverage is 25.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #138      +/-   ##
==========================================
- Coverage   33.51%   32.55%   -0.97%     
==========================================
  Files          16       16              
  Lines        3932     3831     -101     
==========================================
- Hits         1318     1247      -71     
+ Misses       2614     2584      -30     
Impacted Files Coverage Δ
src/bin/uhyve.rs 0.45% <0.00%> (+<0.01%) ⬆️
src/error.rs 16.66% <ø> (ø)
src/gdb_parser.rs 64.77% <0.00%> (-0.34%) ⬇️
src/linux/gdb.rs 0.00% <ø> (ø)
src/utils.rs 49.09% <44.44%> (-13.90%) ⬇️

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 22632af...6715a30. Read the comment docs.

@mkroening mkroening force-pushed the utils branch 2 times, most recently from 1a47dfc to 2a412a4 Compare July 14, 2021 12:11
@mkroening mkroening changed the title [DO NOT MERGE] Rework utils module [DO NOT MERGE] Split up utils module Jul 23, 2021
@mkroening mkroening force-pushed the utils branch 2 times, most recently from 558f88e to dab5aec Compare July 28, 2021 13:19
@mkroening mkroening changed the title [DO NOT MERGE] Split up utils module Split up utils module Jul 28, 2021
@mkroening
Copy link
Member Author

This is ready for review now.

@mkroening mkroening marked this pull request as ready for review July 28, 2021 13:20
echo "ERROR: doc wasn't build exiting"
exit -1
fi
# Checks if doctests were actually built - currently we don't have any though
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I've now read the comment.
I don't know if we should rather:

  • remove doctests (seriously, we won't have any in the near to middle future)
  • keep the code

Copy link
Member Author

Choose a reason for hiding this comment

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

If you want, I can remove this code, but I'd rather keep it. That would make this coverage config more complete.

src/bin_utils.rs Outdated Show resolved Hide resolved
@jounathaen
Copy link
Member

In general LGTM!
One minor thing: If we only have src/bin_utils.rs now, why not keep the name src/utils.rs?

@mkroening
Copy link
Member Author

If we only have src/bin_utils.rs now, why not keep the name src/utils.rs?

That name came up naturally. Before, we just put all kind of utility functions in utils, even though some were used by the frontend only and some were used in different places in the library. I moved the utilities for the binary to bin_utils. The utility functions for the library turned out not to be needed in a central place and could be moved to different places.

So I would like to distinguish between bin_utils and utils but there just don't happen to be any utils left now.

@jounathaen
Copy link
Member

Hmm, for me util feels more natural. Now I wonder, which bin you are talking about.
But not that this is a blocker.
Let's wait a few days if @stlankes has something to add, otherwise I'll merge this.

@mkroening
Copy link
Member Author

Hmm, for me util feels more natural. Now I wonder, which bin you are talking about.

Well we could also make this a module which only lives in the binary and not in the library (src/bin/uhyve/utils.rs). But since we plan with the possibility of having multiple frontends, sharing this via the library might make sense. But making clear, that this is only used by the frontend and does not matter to the backend is important, I think.

@jounathaen
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Aug 20, 2021
138: Split up utils module r=jounathaen a=mkroening

Binaries get a much smaller bin_utils and other helper functions are
replaced/moved.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
Binaries get a much smaller bin_utils and other helper functions are
replaced/moved.
@bors
Copy link
Contributor

bors bot commented Aug 20, 2021

Canceled.

@jounathaen
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Aug 20, 2021
138: Split up utils module r=jounathaen a=mkroening

Binaries get a much smaller bin_utils and other helper functions are
replaced/moved.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
@bors
Copy link
Contributor

bors bot commented Aug 20, 2021

Timed out.

@jounathaen
Copy link
Member

#@$%! 🤬🤬🤬

bors r+

bors bot added a commit that referenced this pull request Aug 20, 2021
138: Split up utils module r=jounathaen a=mkroening

Binaries get a much smaller bin_utils and other helper functions are
replaced/moved.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
@bors
Copy link
Contributor

bors bot commented Aug 20, 2021

Build failed:

@mkroening
Copy link
Member Author

bors retry

@bors bors bot merged commit 956dbcd into hermit-os:master Aug 21, 2021
@mkroening mkroening deleted the utils branch August 21, 2021 12:22
bors bot added a commit that referenced this pull request Aug 21, 2021
140: Rework error types r=jounathaen a=mkroening

Depends on #138.

This heavily reworks the error handling, introducing finer separate error types instead of one uber-error.

Co-authored-by: Martin Kröning <mkroening@posteo.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants