Travis: ARM64 build

Azure changes:

- use newer caching task
- add the branch name to cache keys
- install the 64-bit MinGW-w64 ourselves

Homebrew fix
This commit is contained in:
Ștefan Talpalaru 2019-10-17 15:21:45 +02:00
parent f91918f1b6
commit 49b67f58fc
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9
4 changed files with 48 additions and 24 deletions

View File

@ -1,5 +1,7 @@
language: go language: go
dist: bionic
# https://docs.travis-ci.com/user/caching/ # https://docs.travis-ci.com/user/caching/
cache: cache:
directories: directories:
@ -20,10 +22,25 @@ go:
matrix: matrix:
include: include:
- os: linux - os: linux
arch: amd64
sudo: required sudo: required
env:
- NPROC=2
before_install: before_install:
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
- os: linux
arch: arm64
sudo: required
env:
- NPROC=6 # Worth trying more than 2 parallel jobs: https://travis-ci.community/t/no-cache-support-on-arm64/5416/8
# (also used to get a different cache key than the amd64 one)
before_install:
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
- sudo apt-get -q update
- sudo apt-get install -y libpcre3-dev git-lfs
- os: osx - os: osx
env:
- NPROC=2
before_install: before_install:
- launchctl setenv LIBRARY_PATH /usr/local/lib # for RocksDB - launchctl setenv LIBRARY_PATH /usr/local/lib # for RocksDB
@ -36,7 +53,7 @@ install:
script: script:
- set -e # fail fast - set -e # fail fast
- make -j2 update # to allow a newer Nim version to be detected - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" update # to allow a newer Nim version to be detected
- make -j2 - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}"
- make -j2 DISABLE_LFS_SCRIPT=1 test - make -j${NPROC} NIMFLAGS="--parallelBuild:${NPROC}" DISABLE_LFS_SCRIPT=1 test

View File

@ -11,30 +11,29 @@ jobs:
64-bit: 64-bit:
PLATFORM: x64 PLATFORM: x64
steps: steps:
- task: CacheBeta@0 - task: CacheBeta@1
displayName: 'cache Nim binaries' displayName: 'cache Nim binaries'
inputs: inputs:
key: NimBinaries | $(Agent.OS) | $(PLATFORM) key: NimBinaries | $(Agent.OS) | $(PLATFORM) | $(Build.SourceBranchName)
path: NimBinaries path: NimBinaries
- task: CacheBeta@0 - task: CacheBeta@1
displayName: 'cache p2pd binaries' displayName: 'cache p2pd binaries'
inputs: inputs:
key: p2pdCache | $(Agent.OS) | $(PLATFORM) key: p2pdCache | $(Agent.OS) | $(PLATFORM) | $(Build.SourceBranchName)
path: p2pdCache path: p2pdCache
- task: CacheBeta@0 - task: CacheBeta@1
displayName: 'cache LFS JSON fixtures' displayName: 'cache LFS JSON fixtures'
inputs: inputs:
key: jsonTestsCache key: jsonTestsCache
path: jsonTestsCache path: jsonTestsCache
- task: CacheBeta@0 - task: CacheBeta@1
displayName: 'cache MinGW-w64' displayName: 'cache MinGW-w64'
inputs: inputs:
key: mingwCache key: mingwCache | 8_1_0 | $(PLATFORM)
path: mingwCache path: mingwCache
condition: eq(variables['PLATFORM'], 'x86')
- powershell: | - powershell: |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
@ -42,20 +41,27 @@ jobs:
- bash: | - bash: |
set -e set -e
echo "Installing MinGW-w64"
if [[ $PLATFORM == "x86" ]]; then if [[ $PLATFORM == "x86" ]]; then
echo "Installing 32-bit MinGW-w64" MINGW_FILE="i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
MINGW_URL="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/${MINGW_FILE}"
MINGW_DIR="mingw32"
else
MINGW_FILE="x86_64-8.1.0-release-posix-seh-rt_v6-rev0.7z"
MINGW_URL="https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/seh/${MINGW_FILE}"
MINGW_DIR="mingw64"
fi
mkdir -p mingwCache mkdir -p mingwCache
cd mingwCache cd mingwCache
MINGW_FILE="i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z"
if [[ ! -e "$MINGW_FILE" ]]; then if [[ ! -e "$MINGW_FILE" ]]; then
rm -f *.7z rm -f *.7z
curl -OLsS "https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/${MINGW_FILE}" curl -OLsS "$MINGW_URL"
fi fi
7z x -y -bd "$MINGW_FILE" >/dev/null 7z x -y -bd "$MINGW_FILE" >/dev/null
mv mingw32 /C/ mkdir -p /c/custom
mv "$MINGW_DIR" /c/custom/
cd .. cd ..
export PATH="/C/mingw32/bin:$PATH" export PATH="/c/custom/${MINGW_DIR}/bin:$PATH"
fi
echo "Fetching submodules" echo "Fetching submodules"
git config --global core.longpaths true git config --global core.longpaths true
export GIT_LFS_SKIP_SMUDGE=1 export GIT_LFS_SKIP_SMUDGE=1

View File

@ -20,5 +20,6 @@
--threads:on --threads:on
--opt:speed --opt:speed
--excessiveStackTrace:on --excessiveStackTrace:on
-d:metrics # enable metric collection # enable metric collection
-d:metrics

View File

@ -74,7 +74,7 @@ process_subdir() {
fi fi
if [[ "${UPDATE_CACHE}" == "1" ]]; then if [[ "${UPDATE_CACHE}" == "1" ]]; then
if [[ "${ON_MACOS}" == "1" ]]; then if [[ "${ON_MACOS}" == "1" ]]; then
brew install git-lfs # this takes almost 5 minutes on Travis, so only run it if needed HOMEBREW_NO_AUTO_UPDATE=1 brew install git-lfs # this takes almost 5 minutes on Travis, so only run it if needed
fi fi
download_lfs_files "$LFS_DIR" download_lfs_files "$LFS_DIR"
echo "Updating the cache." echo "Updating the cache."