Initial support sccache for windows build (#10520)

* Initial support sccache for win build

* show sccache stats

* cache paths for shared runners

* sccache status is in the script.

* removed windows test for now
This commit is contained in:
Denis S. Soldatov aka General-Beck 2019-03-27 16:47:08 +03:00 committed by soc1c
parent 407de5e8c4
commit e4c2fe9e72
2 changed files with 14 additions and 7 deletions

View File

@ -33,7 +33,7 @@ variables:
.docker-cache-status: &docker-cache-status .docker-cache-status: &docker-cache-status
variables: variables:
CARGO_HOME: "/cargo/${CI_JOB_NAME}" CARGO_HOME: "/ci-cache/parity-ethereum/cargo/${CI_JOB_NAME}"
before_script: before_script:
- SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_error.log RUST_LOG=sccache::server=debug sccache --start-server - SCCACHE_ERROR_LOG=/builds/parity/parity-ethereum/sccache_error.log RUST_LOG=sccache::server=debug sccache --start-server
- sccache -s - sccache -s
@ -102,18 +102,18 @@ build-android:
CARGO_TARGET: armv7-linux-androideabi CARGO_TARGET: armv7-linux-androideabi
script: script:
- scripts/gitlab/build-linux.sh - scripts/gitlab/build-linux.sh
<<: *collect_artifacts
tags: tags:
- linux-docker - linux-docker
<<: *collect_artifacts
build-linux: &build-linux build-linux: &build-linux
stage: build stage: build
only: *releaseable_branches only: *releaseable_branches
<<: *docker-cache-status <<: *docker-cache-status
<<: *collect_artifacts
script: script:
- scripts/gitlab/build-linux.sh - scripts/gitlab/build-linux.sh
- sccache -s - sccache -s
<<: *collect_artifacts
build-linux-i386: build-linux-i386:
<<: *build-linux <<: *build-linux
@ -136,6 +136,7 @@ build-linux-armhf:
build-darwin: build-darwin:
stage: build stage: build
only: *releaseable_branches only: *releaseable_branches
<<: *collect_artifacts
variables: variables:
CARGO_TARGET: x86_64-apple-darwin CARGO_TARGET: x86_64-apple-darwin
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" CARGO_HOME: "${CI_PROJECT_DIR}/.cargo"
@ -145,19 +146,20 @@ build-darwin:
- scripts/gitlab/build-linux.sh - scripts/gitlab/build-linux.sh
tags: tags:
- rust-osx - rust-osx
<<: *collect_artifacts
build-windows: build-windows:
stage: build stage: build
<<: *collect_artifacts
only: *releaseable_branches only: *releaseable_branches
variables: variables:
CARGO_TARGET: x86_64-pc-windows-msvc CARGO_TARGET: x86_64-pc-windows-msvc
CARGO_HOME: "${CI_PROJECT_DIR}/.cargo" CARGO_HOME: "C:/ci-cache/parity-ethereum/cargo/%CI_JOB_NAME%"
RUSTC_WRAPPER: sccache
SCCACHE_DIR: "C:/ci-cache/parity-ethereum/sccache"
script: script:
- sh scripts/gitlab/build-windows.sh - sh scripts/gitlab/build-windows.sh
tags: tags:
- rust-windows - rust-windows
<<: *collect_artifacts
publish-docker: publish-docker:
stage: publish stage: publish
@ -173,6 +175,7 @@ publish-docker:
publish-snap: &publish-snap publish-snap: &publish-snap
stage: publish stage: publish
only: *releaseable_branches only: *releaseable_branches
<<: *collect_artifacts
image: snapcore/snapcraft image: snapcore/snapcraft
variables: variables:
BUILD_ARCH: amd64 BUILD_ARCH: amd64
@ -183,7 +186,6 @@ publish-snap: &publish-snap
- linux-docker - linux-docker
script: script:
- scripts/gitlab/publish-snap.sh - scripts/gitlab/publish-snap.sh
<<: *collect_artifacts
publish-snap-i386: publish-snap-i386:
<<: *publish-snap <<: *publish-snap

View File

@ -4,11 +4,14 @@ set -u # treat unset variables as error
set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt" set INCLUDE="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include;C:\vs2015\VC\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64" set LIB="C:\vs2015\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64"
sccache -s
echo "__________Show ENVIROMENT__________" echo "__________Show ENVIROMENT__________"
echo "CI_SERVER_NAME: " $CI_SERVER_NAME echo "CI_SERVER_NAME: " $CI_SERVER_NAME
echo "CARGO_HOME: " $CARGO_HOME echo "CARGO_HOME: " $CARGO_HOME
echo "CARGO_TARGET: " $CARGO_TARGET echo "CARGO_TARGET: " $CARGO_TARGET
echo "RUSTC_WRAPPER: " $RUSTC_WRAPPER
echo "SCCACHE_DIR: " $SCCACHE_DIR
echo "_____ Building target: "$CARGO_TARGET" _____" echo "_____ Building target: "$CARGO_TARGET" _____"
time cargo build --target $CARGO_TARGET --release --features final time cargo build --target $CARGO_TARGET --release --features final
@ -44,3 +47,5 @@ do
done done
cp parity.exe.sha256 parity.sha256 cp parity.exe.sha256 parity.sha256
cp parity.exe.sha3 parity.sha3 cp parity.exe.sha3 parity.sha3
sccache -s