From 31ee78264cbb4b9f0239f5edc9c08ebe4c82af8e Mon Sep 17 00:00:00 2001 From: Matthew Rothenberg Date: Mon, 13 May 2019 12:57:56 -0400 Subject: [PATCH] Update builder to use GraalVM 19 release (#4) * bump to release version of graal & see what breaks GraalVM was released, and it looks like there were quite a few API changes from the latest "release candidate" to the release version -- including the removal of native-image from the default install. I guess they don't really get the concept of a release candidate... well, lets start by just bumping the version number and seeing what breaks as a starting point. * fix: metadata checksum issue with ol7_developer appears to be entirely unrelated to the other upgrades we are doing now, but necessary to get things working again until the oracle servers get their act back together? * restore native-image in docker builder * graalvm download archive file URL path changes archive files have swapped positioning of platform<->version, and macOS has reverted back to using less userfriendly "darwin" identifier. * ci: immediately exit in build on error apparently azure CI treats scripts like.. actual scripts! which means we need set -e to have a command exit halt everything. * ci: gu install native-image lets see if this puts things where it should go or requires some PATH manipulation. fingers crossed. --- Dockerfile | 9 +++++++-- azure-pipelines.yml | 6 +++--- ci/native-build.yml | 7 ++++++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6580674..ab50add 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # # Also see regarding potential future built-in native target support: # https://github.com/scalameta/scalafmt/issues/1172 -FROM oracle/graalvm-ce:1.0.0-rc16 as builder +FROM oracle/graalvm-ce:19.0.0 as builder ARG SCALAFMT_VERSION=v2.0.0-RC7 WORKDIR /root @@ -11,11 +11,16 @@ WORKDIR /root # install sbt RUN curl https://bintray.com/sbt/rpm/rpm \ -o /etc/yum.repos.d/bintray-sbt-rpm.repo && \ - yum install -y sbt + yum --disablerepo=ol7_developer install -y sbt + # ^^ temporary fix for upstream repository issue, TODO: remove me later + # yum install -y sbt # other tools needed RUN yum install -y git zlib-static +# native-image is no longer bundled with graalvm :-/ +RUN gu install native-image + # get the source for the version of scalafmt we want RUN git clone https://github.com/scalameta/scalafmt \ --branch ${SCALAFMT_VERSION} --single-branch diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ab6774f..45f316e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,7 +4,7 @@ variables: scalafmt_version: v2.0.0-RC7 - graalvm_version: 1.0.0-rc16 + graalvm_version: '19.0.0' trigger: branches: @@ -48,7 +48,7 @@ jobs: - template: ci/native-build.yml parameters: name: BuildNative_macOS - platform: macOS-amd64 + platform: darwin-amd64 vmImage: macOS-10.14 binPath: Contents/Home/bin @@ -69,7 +69,7 @@ jobs: targetPath: $(Build.ArtifactStagingDirectory) - task: DownloadPipelineArtifact@0 inputs: - artifactName: dist_macOS-amd64 + artifactName: dist_darwin-amd64 targetPath: $(Build.ArtifactStagingDirectory) - script: ls -lh $(Build.ArtifactStagingDirectory) - task: GithubRelease@0 diff --git a/ci/native-build.yml b/ci/native-build.yml index 36d45ab..6f3d732 100644 --- a/ci/native-build.yml +++ b/ci/native-build.yml @@ -21,12 +21,17 @@ jobs: artifactName: jar targetPath: $(System.DefaultWorkingDirectory) - script: | - curl -fsL https://github.com/oracle/graal/releases/download/vm-$(graalvm_version)/graalvm-ce-${GRAALVM_VERSION}-${PLATFORM}.tar.gz \ + curl -fsL https://github.com/oracle/graal/releases/download/vm-$(graalvm_version)/graalvm-ce-${PLATFORM}-${GRAALVM_VERSION}.tar.gz \ --output graalvm.tgz tar xzf graalvm.tgz && rm -rf graalvm.tgz mv graalvm-ce-$(graalvm_version) graalvm displayName: Install GraalVM - script: | + set -e + ./graalvm/${BIN_PATH}/gu install native-image + displayName: Install native-image + - script: | + set -e JAVA_OPTS="-Xmx=2g" ./graalvm/${BIN_PATH}/native-image \ ${BUILD_FLAGS} \ --no-fallback \