fix how benchmark script is loaded on main

To get #6921 working, we need the benchmark script to pull glue.zig correctly on main.
As such, we need to load it into a lib dir such that it is found in the correct relative path.
This hopefully will get the benchmarking working on the other PR.

Also, switch over to `lib` dir first cause that is what is seen in the wide.
This commit is contained in:
Brendan Hansknecht 2024-12-11 22:52:48 -08:00
parent 27b36a8f1f
commit 109cafcafe
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
2 changed files with 9 additions and 9 deletions

View file

@ -81,13 +81,13 @@ pub fn get_relative_path(sub_path: &Path) -> Option<PathBuf> {
}
fn find_zig_glue_path() -> PathBuf {
// First try using the repo path relative to the executable location.
let path = get_relative_path(Path::new("crates/compiler/builtins/bitcode/src/glue.zig"));
// First try using a lib path relative to the executable.
let path = get_relative_path(Path::new("lib/glue.zig"));
if let Some(path) = path {
return path;
}
// Fallback on a lib path relative to the executable location.
let path = get_relative_path(Path::new("lib/glue.zig"));
// Fallback on the repo path relative to the executable location.
let path = get_relative_path(Path::new("crates/compiler/builtins/bitcode/src/glue.zig"));
if let Some(path) = path {
return path;
}