Skip to content

Commit

Permalink
CI: Hotfix aarch64 build (#8944)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwu-tow authored Feb 2, 2024
1 parent a70cbac commit 655ae46
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
12 changes: 3 additions & 9 deletions build/build/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,10 @@ impl TargetTriple {

/// Get the triple effectively used by the Engine build.
///
/// As the GraalVM we use does not support native Aarch64 builds, it should be treated as amd64
/// there.
/// This might differ from `self` if Engine for some reason needs to cross-compile. Currently
/// this is not the case, previously it was used to force x64 on Applce Silicon.
pub fn engine(&self) -> Self {
let mut ret = self.clone();
ret.arch = if self.arch == Arch::AArch64 && self.os == OS::MacOS {
Arch::X86_64
} else {
self.arch
};
ret
self.clone()
}

/// Pretty prints architecture for our packages. Conform to GraalVM scheme as well.
Expand Down
15 changes: 7 additions & 8 deletions build/build/src/project/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ impl Backend {
pub fn matches_platform(&self, name: &str) -> bool {
// Sample name: "project-manager-bundle-2022.1.1-nightly.2022-04-16-linux-amd64.tar.gz"
let os_matches = name.contains(self.target_os.as_str());
// Arch test involves a workaround for Engine being built through Rosette on Apple Silicon.
let arch_matches = name.contains(pretty_print_arch(TARGET_ARCH))
|| (TARGET_ARCH == Arch::AArch64 && name.contains(pretty_print_arch(Arch::X86_64)));
let arch_matches = name.contains(pretty_print_arch(TARGET_ARCH));
os_matches && arch_matches
}
}
Expand All @@ -124,11 +122,12 @@ impl IsTarget for Backend {
fn adapt_artifact(self, path: impl AsRef<Path>) -> BoxFuture<'static, Result<Self::Artifact>> {
let exe_suffix = self.target_os.exe_suffix().to_owned();
let path = path.as_ref().to_owned();
let provisional_path = crate::paths::generated::ProjectManagerBundle::new_root(
&path,
&exe_suffix,
"<unknown version>",
);
let provisional_path: crate::paths::generated::ProjectManagerBundle =
crate::paths::generated::ProjectManagerBundle::new_root(
&path,
&exe_suffix,
"<unknown version>",
);
async move {
let engine_versions = bundled_engine_versions(&provisional_path).await?;
let path = crate::paths::generated::ProjectManagerBundle::new_root(
Expand Down
2 changes: 0 additions & 2 deletions build/ci_utils/src/cache/goodie/graalvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ impl GraalVM {
};
let arch_name = match *arch {
Arch::X86_64 => "x64",
// No Graal packages for Apple Silicon.
Arch::AArch64 if TARGET_OS == OS::MacOS => "x64",
Arch::AArch64 => "aarch64",
other_arch => unimplemented!("Architecture `{}` is not supported!", other_arch),
};
Expand Down

0 comments on commit 655ae46

Please sign in to comment.