The ELFs included in the repo are binary files and cannot be versioned "as a diff". Git stores a copy of every elf in history and the repository grows rapidly.
The binaries are needed for some tests, which execute guest programs. In theory they shouldn't change a lot, but in practice, most of them change every PR. In my opinion, it's better to build the binaries automatically on demand (via build.rs).
This PR:
removes all ELF binaries from the repo,
adds build.rs files to core and runner, where tests need the binaries
Little explanation is needed about how the build.rs files work. We don't want to build the binaries every time when a crate is compiled, but only for tests. A build.rs is missing an easy way to detect that cargo is building tests. To detect it, I added a feature flag unittests which is enabled for tests via a self-pointing dev-dependency:
The ELFs included in the repo are binary files and cannot be versioned "as a diff". Git stores a copy of every elf in history and the repository grows rapidly.
The binaries are needed for some tests, which execute guest programs. In theory they shouldn't change a lot, but in practice, most of them change every PR. In my opinion, it's better to build the binaries automatically on demand (via build.rs).
This PR:
core
andrunner
, where tests need the binariesLittle explanation is needed about how the build.rs files work. We don't want to build the binaries every time when a crate is compiled, but only for tests. A
build.rs
is missing an easy way to detect that cargo is building tests. To detect it, I added a feature flagunittests
which is enabled for tests via a self-pointing dev-dependency: