Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ task:
freebsd_instance:
image_family: freebsd-15-0-amd64-ufs
setup_rust_script:
- pkg install -y git-tiny binutils
- pkg install -y git-tiny binutils cmake
- curl https://sh.rustup.rs -sSf --output rustup.sh
- sh rustup.sh --default-toolchain none -y --profile=minimal
target_cache:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
- os: ubuntu-latest
env:
TARGET_TRIPLE: x86_64-unknown-linux-gnu
apt_deps: valgrind
- os: ubuntu-24.04-arm
env:
TARGET_TRIPLE: aarch64-unknown-linux-gnu
Expand Down Expand Up @@ -135,6 +136,11 @@ jobs:
- name: Prepare dependencies
run: ./y.sh prepare

- name: Install valgrind
run: |
sudo apt-get update
sudo apt-get install -y valgrind

- name: Disable JIT tests
run: |
sed -i 's/jit./#jit./' config.txt
Expand Down
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
34 changes: 34 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",
"7f849963651bdd5455fcfab590d813faa525c88d", // v/0.3.2
&["thirdparty/cavp", "thirdparty/wycheproof"],
"087a9f8a3b8597a7",
"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,27 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
spawn_and_wait(build_cmd);
}
}),
TestCase::custom("test.graviola", &|runner| {
let (arch, _) = runner.target_compiler.triple.split_once('-').unwrap();
if !["x86_64", "aarch64"].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);
test_cmd.args(["-p", "graviola", "--lib", "--", "-q"]);
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