Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GraalVM distribution download on MacOS #7364

Merged
merged 6 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 build/ci_utils/src/cache/goodie/graalvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl GraalVM {
let os_name = match *os {
OS::Linux => "linux",
OS::Windows => "windows",
OS::MacOS => "darwin",
OS::MacOS => "macos",
other_os => unimplemented!("System `{}` is not supported!", other_os),
};
let arch_name = match *arch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ object GraalCEReleaseProvider {
def packageFileNameForCurrentOS(version: GraalVMVersion): String = {
val os = OS.operatingSystem match {
case OS.Linux => "linux"
case OS.MacOS => "darwin"
case OS.MacOS => if (version.graalMajorVersion < 23) "darwin" else "macos"
case OS.Windows => "windows"
}
val extension = OS.operatingSystem match {
Expand Down
12 changes: 5 additions & 7 deletions project/DistributionPackage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ object DistributionPackage {
sealed trait OS {
def name: String
def hasSupportForSulong: Boolean
def graalName: String = name
def executableName(base: String): String = base
def archiveExt: String = ".tar.gz"
def isUNIX: Boolean = true
Expand All @@ -435,7 +434,6 @@ object DistributionPackage {
case object MacOS extends OS {
override val name: String = "macos"
override val hasSupportForSulong: Boolean = true
override def graalName: String = "darwin"
}
case object Windows extends OS {
override val name: String = "windows"
Expand All @@ -461,7 +459,7 @@ object DistributionPackage {
}
object Architecture {
case object X64 extends Architecture {
override def name: String = "amd64"
override def name: String = "x64"
}

val archs = Seq(X64)
Expand Down Expand Up @@ -566,9 +564,9 @@ object DistributionPackage {
)
val graalUrl =
s"https://github.com/graalvm/graalvm-ce-builds/releases/download/" +
s"vm-$graalVersion/" +
s"graalvm-ce-java$graalJavaVersion-${os.graalName}-" +
s"${architecture.name}-$graalVersion${os.archiveExt}"
s"jdk-$graalJavaVersion/" +
s"graalvm-community-jdk-${graalJavaVersion}_${os.name}-" +
s"${architecture.name}_bin${os.archiveExt}"
val exitCode = (url(graalUrl) #> archive).!
if (exitCode != 0) {
throw new RuntimeException(s"Graal download from $graalUrl failed.")
Expand Down Expand Up @@ -614,7 +612,7 @@ object DistributionPackage {
extract(archive, packageDir)

log.info("Installing components")
gu(log, os, extractedGraalDir, "install", "python", "R")
gu(log, os, extractedGraalDir, "install", "python")

log.info(s"Re-creating $archive")
IO.delete(archive)
Expand Down