athenavm / athena

Athena monorepo
https://www.athenavm.org/
Apache License 2.0
21 stars 2 forks source link

remove example programs' elfs #159

Closed poszu closed 1 month ago

poszu commented 1 month ago

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:

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:

[features]
unittest = []

[dev-dependencies]
athena-core = { path = ".", features = ["unittest"] }