Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Add lang_tester framework for Miri tests #38

Closed

Conversation

jacob-hughes
Copy link
Collaborator

Unfortunately this is a bit brittle because of limitations of the
cargo-miri binary 1. To mitigate this, we create a temp directory and
rsync over the src files to compile a separate gcmalloc target with miri
flags. We then copy over the tests one at a time in order to run them
under Miri.

Unfortunately this is a bit brittle because of limitations of the
cargo-miri binary [1]. To mitigate this, we create a temp directory and
rsync over the src files to compile a separate gcmalloc target with miri
flags. We then copy over the tests one at a time in order to run them
under Miri.

[1]: rust-lang/miri#1173
# Miri deps cause breakages when used with non-miri targets. So we copy gcmalloc
# sources over to a tempdir to compile with miri flags so we can nuke it
# afterwards.
rsync -a --partial --info=progress2 --exclude .git --exclude target --exclude gc_tests $PROJECTDIR/ $TMPDIR
Copy link
Member

Choose a reason for hiding this comment

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

rsync?!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This could probably be cp now. I used rsync while developing because there was a lot of trial-and-error testing and I wanted to speed up transfer of targets. I'm curious, is the "?!" a comment on the overkill or poor platform compatibility. If the latter, I'm afraid there's plenty more where that came from with this approach to getting Miri running.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, cp is more portable than rsync, and given that we copy to a fresh directory each time, I think cp is sufficient.

binsd.push("src");
binsd.push("bin");

let mut setup = Command::new("./gc_tests/miri_test_setup.sh")
Copy link
Member

Choose a reason for hiding this comment

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

I wondered if it would be better to inline what miri_test_setup.sh does into Rust? But perhaps that's overkill.

@jacob-hughes
Copy link
Collaborator Author

There is a subtle bug with this where things break occasionally when compiled alongside the other gc_tests. It will take some time to investigate but since this isn't going to be used just yet I am going to put it on hold.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants