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 the lighttpd.rs in #727 into a currently working and full version #728

Open
2 of 3 tasks
kkysen opened this issue Nov 16, 2022 · 2 comments
Open
2 of 3 tasks
Assignees

Comments

@kkysen
Copy link
Contributor

kkysen commented Nov 16, 2022

Split the lighttpd.rs in #727 into a currently working and full version.

That is, we should have 3 versions:

Remaining parts:

kkysen added a commit that referenced this issue Nov 19, 2022
Provide an initial stubbed `lighttpd` connection path.

This will continue to be split out into multiple versions as described in #728.  It'll also be moved to a separate crate (not the existing `analysis/test`), tested for no UB with `miri`, and a script added to run `c2rust-analyze` on it/them).
@aneksteind
Copy link
Contributor

Could you help me understand why the third option is useful? Are you envisioning a workflow where we take the most recent currently-working file and add features from the version containing all the code to play with locally, without accidentally committing changes to the former?

@kkysen
Copy link
Contributor Author

kkysen commented Nov 20, 2022

We can see as we go, but I imagined a 3rd version that could be anything in-between could be useful. If ends up not being, we can remove it. I do think we need it at least at the very beginning, though, as I want to split out the min version from it, and split out the max version from it, but without changing itself at all. So that'll leave us with 3 versions, and if we realize the 3rd middle one isn't useful at all, we can get rid of it.

aneksteind added a commit that referenced this issue Nov 23, 2022
…ts (#729)

This moves `analysis/test` to `analysis/tests/misc` to prepare for more
tests. This is in preparation for #728, where I'll add separate
`lighttpd` tests.

In order to stay as close as possible to the original transpiled
`lighttpd` code, we'll need to put duplicate `#[no_mangle]` functions in
separate crates, which will be created as directories in
`analysis/tests`. I think putting them in separate crates is a good idea
regardless of the `#[no_mangle]` issue, as when we later want to test
everything with dynamic analysis (`c2rust-instrument`), too, it operates
on crates, and eventually, I think we'd like for `c2rust-analyze` to do
so, too.
aneksteind added a commit that referenced this issue Nov 23, 2022
…tests/lighttpd` (#730)

This moves `analysis/tests/misc/lighttpd.rs` into its own crate:
`analysis/tests/lighttpd`.

This is in preparation for #728.

This PR simply creates the `lighttpd` test crate and moves the existing
`lighttpd.rs` file there as is. It also duplicates its `main.rs` from
`analysis/tests/misc/main.rs` as much as possible. Any other changes I
might add I'll save for another PR, as I want the diff in this one to
simply be a move of `lighttpd.rs`.

We can also now easily check that the `lighttpd` test crate is UB-free
according to `cargo miri run` (it is).
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

No branches or pull requests

2 participants