Skip to content

Rewrote shadow's main function in rust#1633

Merged
stevenengler merged 3 commits intoshadow:mainfrom
stevenengler:rust-main
Sep 13, 2021
Merged

Rewrote shadow's main function in rust#1633
stevenengler merged 3 commits intoshadow:mainfrom
stevenengler:rust-main

Conversation

@stevenengler
Copy link
Copy Markdown
Contributor

@stevenengler stevenengler commented Sep 9, 2021

Most of the changed lines are just bindings. The main change is the rewriting of main_runShadow() in core::main::run_shadow(). The general flow should be the same, but a few things have been re-organized.

A few parts that can't easily be converted to rust (for example checking the glib version) remain in the C code, but the rest has moved to rust.

This is currently using an unreleased version of nix for get/setrlimit support, so it either needs to wait for a new release, or needs a workaround. Using libc for now.

@stevenengler stevenengler changed the title Rewrote shadow main function in rust Rewrote shadow's main function in rust Sep 9, 2021
@github-actions github-actions bot added Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable labels Sep 9, 2021
@stevenengler stevenengler marked this pull request as draft September 9, 2021 18:42
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 9, 2021

Codecov Report

Merging #1633 (b2c9c12) into main (a3bc14f) will increase coverage by 0.02%.
The diff coverage is 70.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1633      +/-   ##
==========================================
+ Coverage   54.72%   54.75%   +0.02%     
==========================================
  Files         141      140       -1     
  Lines       18587    18468     -119     
  Branches     4466     4436      -30     
==========================================
- Hits        10172    10112      -60     
+ Misses       5744     5707      -37     
+ Partials     2671     2649      -22     
Flag Coverage Δ
tests 54.75% <70.83%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/core/main.c 62.50% <66.66%> (+9.55%) ⬆️
src/main/core/controller.c 72.50% <100.00%> (ø)
src/main/core/manager.c 70.10% <100.00%> (ø)
src/main/main.c 100.00% <100.00%> (ø)
src/main/utility/tagged_ptr.c 54.54% <0.00%> (-9.10%) ⬇️
src/main/host/network_interface.c 72.46% <0.00%> (-0.58%) ⬇️
src/main/host/syscall/unistd.c 57.80% <0.00%> (-0.58%) ⬇️
src/main/core/scheduler/scheduler.c 74.34% <0.00%> (-0.53%) ⬇️
src/main/host/syscall_condition.c 77.72% <0.00%> (-0.48%) ⬇️
src/test/tcp/test_tcp.c 33.95% <0.00%> (ø)
... and 6 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 a3bc14f...b2c9c12. Read the comment docs.

@stevenengler stevenengler force-pushed the rust-main branch 3 times, most recently from 0e830ae to ecd3d92 Compare September 10, 2021 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Build Build/install tools and dependencies Component: Main Composing the core Shadow executable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants