Skip to content

Commit

Permalink
fix(core): Fix Rust publishing of x86_64 binaries
Browse files Browse the repository at this point in the history
Rust names the x86-64 architecture as x86_64.  Java names it as amd64.
This mismatch causes errors during library load as they can't agree on the file path.

The fix is to normalize the Rust name into the Java name, so it can locate the output
binaries.
  • Loading branch information
rfairfax committed Sep 26, 2024
1 parent f9cbbcf commit 85732e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions project/RustPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ object RustPlugin extends AutoPlugin {
val RustPattern = "([^-]+)-([^-]+)-([^-]+).*".r
arch match {
case "host" => s"$getHostKernel/${SystemUtils.OS_ARCH}"
// Java uses amd64, Rust uses x86_64
case RustPattern("x86_64", _, kernel) => s"$kernel/amd64"
case RustPattern(arch, _, kernel) => s"$kernel/$arch"
case x => sys.error(s"Unsupported architecture $x")
}
Expand Down

0 comments on commit 85732e3

Please sign in to comment.