<commit_before># This is the Azure Pipelines configuration is also used to create the
# precompiled release archives that are made available at <https://rakudo.org>.
#
# To trigger a build, go to <https://dev.azure.com/infra0037/raku/...> and
# manually start a run of this pipeline.
#
# The following pipeline variables are required:
#
# BUILD_PRECOMP_RELEASE: Set this to "yes".
# RELEASE_URL: Release archive to build. e.g. "https://rakudo.org/dl/rakudo/rakudo-2020.05.tar.gz"
# VERSION: The version that you are building. e.g. "2020.05"
# REVISION: Usually "01"
#

trigger:
- master

pr:
- master

variables:
  # Turn this Powershell console into a developer powershell console.
  # https://intellitect.com/enter-vsdevshell-powershell/
  PWSH_DEV: |
    $installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
    $devShell    = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
    Import-Module $devShell
    Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64"


stages:
- stage: Test
  condition: ne( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
  jobs:
    - job: Test
      strategy:
       matrix:
         Windows_MoarVM:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         Windows_MoarVM_NQP_master:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         Windows_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         Windows_JVM:
          IMAGE_NAME: 'windows-2019'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         Windows_JVM_NQP_master:
          IMAGE_NAME: 'windows-2019'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         Windows_MoarVM_relocatable:
          IMAGE_NAME: 'windows-2019'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

         MacOS_MoarVM:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         MacOS_MoarVM_NQP_master:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         MacOS_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         MacOS_JVM:
          IMAGE_NAME: 'macOS-10.15'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         MacOS_JVM_NQP_master:
          IMAGE_NAME: 'macOS-10.15'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         MacOS_MoarVM_relocatable:
          IMAGE_NAME: 'macOS-10.15'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

         Linux_MoarVM:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         Linux_MoarVM_NQP_master:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         Linux_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         Linux_JVM:
          IMAGE_NAME: 'ubuntu-18.04'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         Linux_JVM_NQP_master:
          IMAGE_NAME: 'ubuntu-18.04'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         Linux_MoarVM_relocatable:
          IMAGE_NAME: 'ubuntu-18.04'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

      pool:
        vmImage: $(IMAGE_NAME)
      workspace:
        clean: all
      steps:

        - script: |
            echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
            echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)/bin:$(PATH)"
          displayName: "Set java version (non-Windows)"
          condition: and( eq( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
        - script: |
            echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
            echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)"
          displayName: "Set java version (Windows)"
          condition: and( eq( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )

        - checkout: self
          displayName: Checkout repository

        - script: |
            perl Configure.pl $(RAKUDO_OPTIONS)
          condition: ne( variables['Agent.OS'], 'Windows_NT' )
          displayName: Build (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            perl Configure.pl $(RAKUDO_OPTIONS)
          failOnStderr: false
          condition: eq( variables['Agent.OS'], 'Windows_NT' )
          displayName: Build (Windows)
        
        - script: make install
          condition: ne( variables['Agent.OS'], 'Windows_NT' )
          displayName: Install (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            nmake install
          failOnStderr: false
          condition: eq( variables['Agent.OS'], 'Windows_NT' )
          displayName: Install (Windows)
        
        # TODO: Should use "install moved" instead of "install-moved". But `prove` currently fails with an executable path that contains a space.
        - script: mv install install-moved
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Move installation (non-Windows)
        - pwsh: mv install install-moved
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Move installation (Windows)

        - script: prove -e install/bin/perl6 -vlr t
          condition: and( ne( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            prove -e install/bin/perl6 -vlr t
          condition: and( ne( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test (Windows)

        - script: prove -e install-moved/bin/perl6 -vlr t
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test with moved installation (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            prove -e install-moved\bin\perl6 -vlr t
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test with moved installation (Windows)

        - publish: install-moved
          artifact: relocatable-build
          condition: eq( variables['RELOCATABLE'], 'yes' )
          displayName: Publish build artifact

- stage: Build_Precomp_Release
  condition: eq( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
  jobs:
    - job: linux
      displayName: Linux x86_64 build
      pool:
        vmImage: 'ubuntu-18.04'
      container:
        image: centos:6
        options: "--name raku-build-container -v /usr/bin/docker:/tmp/docker:ro"
      workspace:
        clean: all
      steps:
        - script: /tmp/docker exec -t -u 0 raku-build-container sh -c "yum -y update && yum -y install sudo"
          displayName: Set up sudo (see https://github.com/microsoft/azure-pipelines-agent/issues/2043)

        - checkout: self
          path: source
          displayName: Checkout repository

        - script: $(Agent.BuildDirectory)/source/tools/build/binary-release/build-linux.sh
          failOnStderr: false
          displayName: Run build script<commit_msg>Fix build artifact publishing<commit_after># This is the Azure Pipelines configuration is also used to create the
# precompiled release archives that are made available at <https://rakudo.org>.
#
# To trigger a build, go to <https://dev.azure.com/infra0037/raku/...> and
# manually start a run of this pipeline.
#
# The following pipeline variables are required:
#
# BUILD_PRECOMP_RELEASE: Set this to "yes".
# RELEASE_URL: Release archive to build. e.g. "https://rakudo.org/dl/rakudo/rakudo-2020.05.tar.gz"
# VERSION: The version that you are building. e.g. "2020.05"
# REVISION: Usually "01"
#

trigger:
- master

pr:
- master

variables:
  # Turn this Powershell console into a developer powershell console.
  # https://intellitect.com/enter-vsdevshell-powershell/
  PWSH_DEV: |
    $installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
    $devShell    = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
    Import-Module $devShell
    Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64"


stages:
- stage: Test
  condition: ne( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
  jobs:
    - job: Test
      strategy:
       matrix:
         Windows_MoarVM:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         Windows_MoarVM_NQP_master:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         Windows_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'windows-2019'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         Windows_JVM:
          IMAGE_NAME: 'windows-2019'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         Windows_JVM_NQP_master:
          IMAGE_NAME: 'windows-2019'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         Windows_MoarVM_relocatable:
          IMAGE_NAME: 'windows-2019'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

         MacOS_MoarVM:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         MacOS_MoarVM_NQP_master:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         MacOS_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'macOS-10.15'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         MacOS_JVM:
          IMAGE_NAME: 'macOS-10.15'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         MacOS_JVM_NQP_master:
          IMAGE_NAME: 'macOS-10.15'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         MacOS_MoarVM_relocatable:
          IMAGE_NAME: 'macOS-10.15'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

         Linux_MoarVM:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar'
         Linux_MoarVM_NQP_master:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar'
         Linux_MoarVM_NQP_master_MoarVM_master:
          IMAGE_NAME: 'ubuntu-18.04'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp=master --gen-moar=master'
         Linux_JVM:
          IMAGE_NAME: 'ubuntu-18.04'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp'
         Linux_JVM_NQP_master:
          IMAGE_NAME: 'ubuntu-18.04'
          BACKEND: 'JVM'
          RAKUDO_OPTIONS: '--backends=jvm  --gen-nqp=master'
         Linux_MoarVM_relocatable:
          IMAGE_NAME: 'ubuntu-18.04'
          RELOCATABLE: 'yes'
          RAKUDO_OPTIONS: '--backends=moar --gen-nqp --gen-moar --relocatable'

      pool:
        vmImage: $(IMAGE_NAME)
      workspace:
        clean: all
      steps:

        - script: |
            echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
            echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)/bin:$(PATH)"
          displayName: "Set java version (non-Windows)"
          condition: and( eq( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
        - script: |
            echo "##vso[task.setvariable variable=JAVA_HOME]$(JAVA_HOME_11_X64)"
            echo "##vso[task.setvariable variable=PATH]$(JAVA_HOME_11_X64)\bin;$(PATH)"
          displayName: "Set java version (Windows)"
          condition: and( eq( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )

        - checkout: self
          displayName: Checkout repository

        - script: |
            perl Configure.pl $(RAKUDO_OPTIONS)
          condition: ne( variables['Agent.OS'], 'Windows_NT' )
          displayName: Build (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            perl Configure.pl $(RAKUDO_OPTIONS)
          failOnStderr: false
          condition: eq( variables['Agent.OS'], 'Windows_NT' )
          displayName: Build (Windows)
        
        - script: make install
          condition: ne( variables['Agent.OS'], 'Windows_NT' )
          displayName: Install (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            nmake install
          failOnStderr: false
          condition: eq( variables['Agent.OS'], 'Windows_NT' )
          displayName: Install (Windows)
        
        # TODO: Should use "install moved" instead of "install-moved". But `prove` currently fails with an executable path that contains a space.
        - script: mv install install-moved
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Move installation (non-Windows)
        - pwsh: mv install install-moved
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Move installation (Windows)

        - script: prove -e install/bin/perl6 -vlr t
          condition: and( ne( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            prove -e install/bin/perl6 -vlr t
          condition: and( ne( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test (Windows)

        - script: prove -e install-moved/bin/perl6 -vlr t
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), ne( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test with moved installation (non-Windows)
        - pwsh: |
            ${{ variables.PWSH_DEV }}
            prove -e install-moved\bin\perl6 -vlr t
          condition: and( eq( variables['RELOCATABLE'], 'yes' ), ne( variables['BACKEND'], 'JVM'), eq( variables['Agent.OS'], 'Windows_NT' ) )
          displayName: Test with moved installation (Windows)

        - publish: install-moved
          condition: eq( variables['RELOCATABLE'], 'yes' )
          displayName: Publish build artifact

- stage: Build_Precomp_Release
  condition: eq( variables['BUILD_PRECOMP_RELEASE'], 'yes' )
  jobs:
    - job: linux
      displayName: Linux x86_64 build
      pool:
        vmImage: 'ubuntu-18.04'
      container:
        image: centos:6
        options: "--name raku-build-container -v /usr/bin/docker:/tmp/docker:ro"
      workspace:
        clean: all
      steps:
        - script: /tmp/docker exec -t -u 0 raku-build-container sh -c "yum -y update && yum -y install sudo"
          displayName: Set up sudo (see https://github.com/microsoft/azure-pipelines-agent/issues/2043)

        - checkout: self
          path: source
          displayName: Checkout repository

        - script: $(Agent.BuildDirectory)/source/tools/build/binary-release/build-linux.sh
          failOnStderr: false
          displayName: Run build script
{'fraction_non_alphanumeric': 0.12967191443336137, 'fraction_numerical': 0.015623122220886913, 'mean_word_length': 2.387543252595156, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2053259', 'n_tokens_mistral': 5791, 'n_tokens_neox': 5442, 'n_words': 1158}