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

scripts/pdg.sh: also run analysis #974

Closed
wants to merge 1 commit into from
Closed

Conversation

fw-immunant
Copy link
Contributor

This is fairly hacky and best-effort, but until c2rust-analyze is a rustc wrapper for cargo, it's hard to do better, and this avoids duplicating the work of figuring out these hacks.

To see it in action: ./scripts/pdg.sh analysis/tests/minimal

scripts/pdg.sh Outdated Show resolved Hide resolved
scripts/pdg.sh Outdated Show resolved Hide resolved
scripts/pdg.sh Outdated Show resolved Hide resolved
Comment on lines +101 to +96
"-C" \
"metadata=4095517b1921578c" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this? What's that hash for? It looks fragile.

"-C" \
"metadata=4095517b1921578c" \
"-L" "dependency=${deps_dir}" \
"--extern" "libc=${libc_dep}" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

What is this meant to run end-to-end on? lighttpd-minimal? lighttpd-rust-amalgamated? Or the c2rust-analyze tests (which aren't full crates)? Anything else?

Copy link
Contributor

@kkysen kkysen left a comment

Choose a reason for hiding this comment

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

I think it would be better to move these additions to Rust code in c2rust_pdg::tests rather than adding to this shell script, even if that's not their eventual location once c2rust-analyze gets cargo-wrapped. Right now, that's the canonical invocation of c2rust-instrument that is run in CI tests. scripts/pdg.sh isn't used regularly anymore and I'm not sure if it's fully up-to-date (I'd prefer to remove it entirely). This way, this end-to-end static + runtime analysis will be tested in CI.

this is fairly hacky and best-effort, but until c2rust-analyze is a rustc wrapper for cargo, it's hard to do better, and this avoids duplicating the work of figuring out these hacks
@fw-immunant
Copy link
Contributor Author

Superseded by #1069.

@fw-immunant fw-immunant closed this Apr 2, 2024
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.

2 participants