Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build_system/abi_cafe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ static ABI_CAFE_REPO: GitRepo = GitRepo::github(
"Gankra",
"abi-cafe",
"94d38030419eb00a1ba80e5e2b4d763dcee58db4",
&[],
"6efb4457893c8670",
"abi-cafe",
);
Expand Down
1 change: 1 addition & 0 deletions build_system/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github(
"ebobby",
"simple-raytracer",
"804a7a21b9e673a482797aa289a18ed480e4d813",
&[],
"ad6f59a2331a3f56",
"<none>",
);
Expand Down
21 changes: 19 additions & 2 deletions build_system/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ pub(crate) fn prepare(dirs: &Dirs) {
std::fs::create_dir_all(&dirs.download_dir).unwrap();
crate::tests::RAND_REPO.fetch(dirs);
crate::tests::REGEX_REPO.fetch(dirs);
crate::tests::GRAVIOLA_REPO.fetch(dirs);
}

pub(crate) struct GitRepo {
url: GitRepoUrl,
rev: &'static str,
submodules: &'static [&'static str],
content_hash: &'static str,
patch_name: &'static str,
}
Expand Down Expand Up @@ -71,10 +73,17 @@ impl GitRepo {
user: &'static str,
repo: &'static str,
rev: &'static str,
submodules: &'static [&'static str],
content_hash: &'static str,
patch_name: &'static str,
) -> GitRepo {
GitRepo { url: GitRepoUrl::Github { user, repo }, rev, content_hash, patch_name }
GitRepo {
url: GitRepoUrl::Github { user, repo },
rev,
submodules,
content_hash,
patch_name,
}
}

fn download_dir(&self, dirs: &Dirs) -> PathBuf {
Expand Down Expand Up @@ -132,6 +141,7 @@ impl GitRepo {
&download_dir,
&format!("https://github.com/{}/{}.git", user, repo),
self.rev,
self.submodules,
);
}
}
Expand Down Expand Up @@ -160,7 +170,7 @@ impl GitRepo {
}
}

fn clone_repo(download_dir: &Path, repo: &str, rev: &str) {
fn clone_repo(download_dir: &Path, repo: &str, rev: &str, submodules: &[&str]) {
eprintln!("[CLONE] {}", repo);

match fs::remove_dir_all(download_dir) {
Expand All @@ -180,6 +190,13 @@ fn clone_repo(download_dir: &Path, repo: &str, rev: &str) {
checkout_cmd.arg("-q").arg(rev);
spawn_and_wait(checkout_cmd);

if !submodules.is_empty() {
let mut submodule_cmd = git_command(download_dir, "submodule");
submodule_cmd.arg("update").arg("--init");
submodule_cmd.args(submodules);
spawn_and_wait(submodule_cmd);
}

std::fs::remove_dir_all(download_dir.join(".git")).unwrap();
}

Expand Down
51 changes: 51 additions & 0 deletions build_system/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
"rust-random",
"rand",
"1f4507a8e1cf8050e4ceef95eeda8f64645b6719",
&[],
"981f8bf489338978",
"rand",
);
Expand All @@ -135,12 +136,24 @@ pub(crate) static REGEX_REPO: GitRepo = GitRepo::github(
"rust-lang",
"regex",
"061ee815ef2c44101dba7b0b124600fcb03c1912",
&[],
"dc26aefbeeac03ca",
"regex",
);

static REGEX: CargoProject = CargoProject::new(REGEX_REPO.source_dir(), "regex_target");

pub(crate) static GRAVIOLA_REPO: GitRepo = GitRepo::github(
"ctz",
"graviola",
"c779b83cfd7114c4802293700c92cfb5e05cb4b7",
&["thirdparty/cavp", "thirdparty/wycheproof"],
"e0925ceb21a56101",
"graviola",
);

static GRAVIOLA: CargoProject = CargoProject::new(GRAVIOLA_REPO.source_dir(), "graviola_target");

static PORTABLE_SIMD_SRC: RelPath = RelPath::build("portable-simd");

static PORTABLE_SIMD: CargoProject = CargoProject::new(PORTABLE_SIMD_SRC, "portable-simd_target");
Expand Down Expand Up @@ -199,6 +212,44 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
spawn_and_wait(build_cmd);
}
}),
TestCase::custom("test.graviola", &|runner| {
let (arch, _) = runner.target_compiler.triple.split_once('-').unwrap();

// FIXME: Disable `aarch64` until intrinsics are supported.
if !["x86_64"].contains(&arch) {
eprintln!("Skipping `graviola` tests: unsupported target");
return;
}

GRAVIOLA_REPO.patch(&runner.dirs);
GRAVIOLA.clean(&runner.dirs);

if runner.is_native {
let mut test_cmd = GRAVIOLA.test(&runner.target_compiler, &runner.dirs);

// FIXME: Disable AVX-512 until intrinsics are supported.
test_cmd.env("GRAVIOLA_CPU_DISABLE_avx512f", "1");
test_cmd.env("GRAVIOLA_CPU_DISABLE_avx512bw", "1");
test_cmd.env("GRAVIOLA_CPU_DISABLE_avx512vl", "1");

test_cmd.args([
"-p",
"graviola",
"--lib",
"--",
"-q",
// FIXME: Disable AVX-512 until intrinsics are supported.
"--skip",
"check_counter512",
]);
spawn_and_wait(test_cmd);
} else {
eprintln!("Cross-Compiling: Not running tests");
let mut build_cmd = GRAVIOLA.build(&runner.target_compiler, &runner.dirs);
build_cmd.args(["-p", "graviola", "--lib"]);
spawn_and_wait(build_cmd);
}
}),
TestCase::custom("test.portable-simd", &|runner| {
apply_patches(
&runner.dirs,
Expand Down
1 change: 1 addition & 0 deletions config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ test.sysroot
testsuite.extended_sysroot
test.rust-random/rand
test.regex
test.graviola
test.portable-simd
Loading