Skip to content
Snippets Groups Projects
ci.hocon 9.87 KiB
# This is part of the framework used by FastR for continuous integration testing.
# It is not intended that this "code" is directly usable by third-party developers
# but it provide details on the commands that are used and these should be
# executable in isolation; see further comments below.

# java 7 is needed by Truffle (for now)
java7 : {name : oraclejdk, version : "7",    platformspecific: true}
# java 8 must be a jvmci enabled variant
java8 : {name : labsjdk, version : "8u161-jvmci-0.41", platformspecific: true}
java9 : {name : labsjdk, version : "9-ea+168", platformspecific: true}

java8Downloads : {
  downloads : {
    EXTRA_JAVA_HOMES : { pathlist :[
      ${java7}
    ]}
    JAVA_HOME : ${java8}
  }
}

java9Downloads : {
  downloads : {
    EXTRA_JAVA_HOMES : { pathlist :[
      ${java7}
      ${java8}
    ]}
    JAVA_HOME : ${java9}
  }
}

logfiles : [
    "fastr_errors.log"
    "results.json"
    "libdownloads/R-*/gnur_configure.log"
    "libdownloads/R-*/config.log"
    "libdownloads/R-*/gnur_make.log"
    "libdownloads/R-*/Makeconf"
    "com.oracle.truffle.r.native/gnur/tests/log/all.diff"
    "com.oracle.truffle.r.test.native/embedded/*.output"
    "com.oracle.truffle.r.test.native/embedded/src/*.output"
    "*-tests/*.Rout"
  ]

# This is needed by all (Linux) builds but is specific to the module system employed
# on the CI cluster. Not all of the modules are needed by FastR but all are needed by the
# embedded GNU R that is built within FastR.

pkgEnvironment: {
  environment : {
    PKG_INCLUDE_FLAGS_OVERRIDE : """-I/cm/shared/apps/zlib/1.2.8/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/curl/7.50.1/include"""
    PKG_LDFLAGS_OVERRIDE : """"-L/cm/shared/apps/zlib/1.2.8/lib -L/cm/shared/apps/bzip2/1.0.6/lib -L/cm/shared/apps/xz/5.2.2/lib -L/cm/shared/apps/pcre/8.38/lib -L/cm/shared/apps/curl/7.50.1/lib -L/cm/shared/apps/gcc/4.9.1/lib64""""
	TZDIR: "/usr/share/zoneinfo"
  }
}

packagesLinux : ${pkgEnvironment} {
  packages : {
    git : ">=1.8.3"
    mercurial : ">=2.2"
    "pip:astroid" : "==1.1.0"
    "pip:pylint" : "==1.1.0"
    make : ">=3.83"
    gcc-build-essentials : "==4.9.1" # GCC 4.9.0 fails on cluster
    readline : "==6.3"
    pcre : ">=8.38"
    zlib : ">=1.2.8"
    curl : ">=7.50.1"
  }
}

packagesDarwin : {
  "pip:astroid" : "==1.1.0"
  "pip:pylint" : "==1.1.0"
  "pcre" : "==8.38"
}

# Common settings for all builds but note that it uses the Linux package settings,
# so these must be overridden in any darwin builds

common : ${java8Downloads} ${packagesLinux}  {
  logs: ${logfiles}
  timelimit : "1:00:00"
}

# Every "pull request" (PR) is subject to a series of "gate" commands that must pass
# for the PR to be accepted into the master branch. The gate commands are run under
# the "mx" tool. This defines a common prefix for all gate commands. The "-t"
# arg indicates the exact set of gate "tasks" that will be run.

gateCmd : ["mx", "--strict-compliance", "rgate", "--strict-mode", "-t"]

# currently disabled gate commands: FindBugs,Checkheaders,Distribution Overlap Check

# The standard set of gate tasks: the actual executable tests are in the "UnitTests" task.

gateTestCommon : ${common} {
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac,UnitTests: with specials,Rembedded"]
  ]
}

gateTestLinux : ${gateTestCommon}  {
}

gateTestNoSpecialsLinux : ${common}  {
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac,UnitTests: no specials"]
  ]
}

darwinEnvironment : {
  environment :  {
    PATH : "/usr/local/bin:$JAVA_HOME/bin:$PATH"
    F77: "/usr/local/bin/gfortran-4.9"
    TZDIR: "/usr/share/zoneinfo"
	  PKG_INCLUDE_FLAGS_OVERRIDE : """-I/cm/shared/apps/pcre/8.38/include -I/cm/shared/apps/bzip2/1.0.6/include -I/cm/shared/apps/xz/5.2.2/include -I/cm/shared/apps/curl/7.50.1/include"""
    PKG_LDFLAGS_OVERRIDE : """" -L/cm/shared/apps/bzip2/1.0.6/lib -L/cm/shared/apps/xz/5.2.2/lib -L/cm/shared/apps/pcre/8.38/lib -L/cm/shared/apps/curl/7.50.1/lib -L/cm/shared/apps/gcc/4.9.1/lib64 -L/usr/local/Cellar/gcc@4.9/4.9.4/lib/gcc/4.9/ -L/usr/lib""""
  }
}

gateTestDarwin : ${gateTestCommon} ${darwinEnvironment}  {
  packages : ${packagesDarwin}
}

gateTestLinuxNFI : ${gateTestCommon}  {
  environment :  {
      FASTR_RFFI : "nfi"
      TZDIR: "/usr/share/zoneinfo"
  }
}

requireGCC: {
    downloads: {
        DRAGONEGG_GCC: {name: "gcc+dragonegg", version: "4.6.4-1", platformspecific: true}
        DRAGONEGG_LLVM: {name: "clang+llvm", version: "3.2", platformspecific: true}
    }
}

gateTestLinuxLLVM : ${common} ${requireGCC}  {

  packages: {
      llvm: "==3.8"
  }

  environment :  {
      TZDIR: "/usr/share/zoneinfo"
      FASTR_RFFI : "llvm"
      FASTR_LLVM_TOOLS : "$DRAGONEGG_LLVM/bin"
      FASTR_LLVM_GFORTRAN_LLVM_AS : "$DRAGONEGG_LLVM/bin/llvm-as"
      FASTR_LLVM_GFORTRAN : "$DRAGONEGG_GCC/bin/gfortran"
      FASTR_LLVM_DRAGONEGG : "$DRAGONEGG_GCC/lib/dragonegg.so"
      DEFAULT_DYNAMIC_IMPORTS : "sulong"
  }

  setup: [
    ["git", "clone", ["mx", "urlrewrite", "https://github.com/graalvm/sulong.git"], "../sulong"],
    ["mx", "sforceimports"],
    ["git","clone", "--depth", "1", ${repoBase}"r-apptests.git", "../r-apptests"]
  ]

  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"]
    ["mx", "rscript", "../r-apptests/renjin-tests/driver.R", "--setwd", "../r-apptests/renjin-tests/"]
    ["mx", "pkgtest", "--repos", "FASTR", "--run-tests", "testrffi"]
  ]
}

gateTestJava9Linux : ${java9Downloads} ${gateTestCommon} {
  downloads : {
    JAVA_HOME : ${java9Downloads.downloads.JAVA_HOME}
    EXTRA_JAVA_HOMES : ${java9Downloads.downloads.EXTRA_JAVA_HOMES}
  }
}

gateTestDarwinLLVM: ${common} ${darwinEnvironment} ${requireGCC}  {
  packages : ${packagesDarwin} {
    llvm: "==4.0.1"
  }

  environment :  {
      FASTR_RFFI : "llvm"
      FASTR_LLVM_TOOLS : "$DRAGONEGG_LLVM/bin"
      FASTR_LLVM_GFORTRAN_LLVM_AS : "$DRAGONEGG_LLVM/bin/llvm-as"
      FASTR_LLVM_GFORTRAN : "$DRAGONEGG_GCC/bin/gfortran"
      FASTR_LLVM_DRAGONEGG : "$DRAGONEGG_GCC/lib/dragonegg.so"
      DEFAULT_DYNAMIC_IMPORTS : "sulong"
      # homebrew doesn't put llvm on the path by default
      PATH: "/usr/local/Cellar/llvm@4/4.0.1/bin:$PATH"
      LC_MESSAGES: "en_US"
	  LC_COLLATE: "en_US"
	  LC_TIME: "en_US"
	  LC_MONETARY: "en_US"
	  LC_COLLATE: "en_US.UTF-8"
  }

  setup: [
    ["ls", "/usr/local/Cellar"]
    ["git", "clone", ["mx", "urlrewrite", "https://github.com/graalvm/sulong.git"], "../sulong"],
    ["mx", "sforceimports"],
    ["git", "clone", "--depth", "1", ${repoBase}"r-apptests.git", "../r-apptests"]
  ]

  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"]
    ["mx", "rscript", "../r-apptests/renjin-tests/driver.R", "--setwd", "../r-apptests/renjin-tests/"]
    ["mx", "pkgtest", "--repos", "FASTR", "--run-tests", "testrffi"]
  ]
}

# This performs a number of "style" checks on the code to ensure it confirms to the project standards.

gateStyle : ${common} {
  # need pyhocon fix
  downloads : {
    JAVA_HOME : ${java8Downloads.downloads.JAVA_HOME}
    EXTRA_JAVA_HOMES : ${java8Downloads.downloads.EXTRA_JAVA_HOMES}
    JDT : {name: ecj, version: "4.5.1", platformspecific: false}
    ECLIPSE : {name: eclipse, version: "4.5.2", platformspecific: true}
  }
  environment : {
    ECLIPSE_EXE : "$ECLIPSE/eclipse"
  }
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,Pylint,Canonicalization Check,BuildJavaWithJavac,IDEConfigCheck,CodeFormatCheck,Checkstyle,Copyright check,UnitTests: ExpectedTestOutput file check"]
  ]
}

gateBuildWithEcj : ${common} {
  # need pyhocon fix
  downloads : {
    JAVA_HOME : ${java8Downloads.downloads.JAVA_HOME}
    EXTRA_JAVA_HOMES : ${java8Downloads.downloads.EXTRA_JAVA_HOMES}
    JDT : {name: ecj, version: "4.5.1", platformspecific: false}
    ECLIPSE : {name: eclipse, version: "4.5.2", platformspecific: true}
  }
  environment : {
    ECLIPSE_EXE : "$ECLIPSE/eclipse"
  }
  run : [
    ["mx", "build"]
  ]
}

# This check runs diagnostics on the implementation of the R "builtins" in FastR, e.g., that the argument processing is sound.

rbcheck : ${common} {
  run : [
    ${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"]
    ["mx", "rbcheck"]
    ["mx", "rbdiag"]
  ]
}

internalPkgtest: ${common} {
  run : [
    ["mx", "build"]
    ["mx", "pkgtest", "--repos", "FASTR", "--pkg-filelist", "com.oracle.truffle.r.test.native/packages/pkg-filelist"]
  ]
  logs: ${common.logs}
}

gnurTests: ${common} {
  run : [
    ["mx", "build"]
    ["mx", "gnu-rtests"]
  ]
}

# The standard set of gate builds. N.B. the style/builtin checks are only run on Linux as they are not OS-dependent.

builds = [
  ${gateTestLinux}            {capabilities : [linux, amd64, fast],  targets : [gate], name: "gate-test-linux-amd64"}
  ${gateTestNoSpecialsLinux}  {capabilities : [linux, amd64, fast],  targets : [gate], name: "gate-test-linux-amd64-nospecials"}
  ${gateTestDarwin}           {capabilities : [darwin_sierra, amd64], targets : [gate], name: "gate-test-darwin-amd64"}
  ${gateStyle}                {capabilities : [linux, amd64],  targets : [gate], name: "gate-style-linux-amd64"}
  ${gateBuildWithEcj}         {capabilities : [linux, amd64],  targets : [gate], name: "gate-ecj-linux-amd64"}
  ${rbcheck}                  {capabilities : [linux, amd64],  targets : [gate], name: "gate-rbcheck-linux-amd64"}
  ${internalPkgtest}          {capabilities : [linux, amd64],  targets : [gate], name: "gate-internal-pkgtest-linux-amd64"}
  ${gateTestJava9Linux}       {capabilities : [linux, amd64, fast],  targets : [gate], name: "gate-test-java9-linux-amd64"}
  ${gnurTests}                {capabilities : [linux, amd64, fast],  targets : [gate], name: "gate-gnur-tests"}
  # disabled because of spurious dragonegg problems
  #${gateTestLinuxLLVM}        {capabilities: [linux, amd64], targets : [gate], name: "gate-test-llvm-linux-amd64" }
  ${gateTestDarwinLLVM}        {capabilities: [darwin_sierra, amd64], targets : [gate], name: "gate-test-llvm-darwin-amd64" }
]