Skip to content

Commit 694fc56

Browse files
authored
Build windows engine on GCE (flutter#8442)
This allows us to test windows engine compilation in presubmit checks using our own 32-CPU GCE instance for less than 10 minutes.
1 parent 219bf59 commit 694fc56

File tree

1 file changed

+35
-25
lines changed

1 file changed

+35
-25
lines changed

.cirrus.yml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
gcp_credentials: ENCRYPTED[987a78af29b91ce8489594c9ab3fec21845bbe5ba68294b8f6def3cf0d380830f06687a89ea69c87344c5ade369700fe]
22

3-
gke_container:
4-
image: gcr.io/flutter-cirrus/build-engine-image:latest
5-
cluster_name: build-32-cluster
6-
zone: us-central1-a
7-
namespace: default
8-
cpu: 30 # can't use all 30-cores; system pods needs cores too
9-
memory: 100Gb # similarly, can't use all 100Gb memory
10-
113
task:
4+
gke_container:
5+
image: gcr.io/flutter-cirrus/build-engine-image:latest
6+
cluster_name: build-32-cluster
7+
zone: us-central1-a
8+
namespace: default
9+
cpu: 30 # can't use all 30-cores; system pods needs cores too
10+
memory: 100Gb # similarly, can't use all 100Gb memory
1211
env:
1312
CIRRUS_WORKING_DIR: "/tmp/github_repo"
1413
ENGINE_PATH: "/tmp/clean_engine"
@@ -59,25 +58,36 @@ task:
5958
ninja -C out/android_debug_unopt
6059
mkdir javadoc_tmp
6160
./flutter/tools/gen_javadoc.py --out-dir javadoc_tmp
61+
- name: format_and_dart_test
62+
format_script: cd $ENGINE_PATH/src/flutter && ./ci/format.sh
63+
build_script: cd $ENGINE_PATH/src/flutter && ./ci/build.sh
6264

63-
format_and_dart_test_task:
64-
container:
65-
image: gcr.io/flutter-cirrus/build-engine-image:latest
65+
build_windows_task:
66+
gce_instance:
67+
image_project: flutter-cirrus
68+
image_name: flutter-engine-windows-server-2016-core
69+
zone: us-central1-a
70+
platform: windows
71+
cpu: 32
72+
memory: 32Gb
73+
disk: 50
6674

6775
env:
68-
CIRRUS_WORKING_DIR: "/tmp/github_repo"
69-
DEPOT_TOOLS: "/tmp/depot_tools"
70-
ENGINE_PATH: "/tmp/clean_engine"
71-
PATH: "$DEPOT_TOOLS:$PATH"
72-
depot_tools_script:
73-
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git $DEPOT_TOOLS
76+
# Cirrus is somehow not picking up the environment variables set in the VM image.
77+
PATH: "c:/depot_tools;c:/MinGit/cmd;$PATH"
78+
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
79+
GYP_MSVS_OVERRIDE_PATH: "c:/Program Files (x86)/Microsoft Visual Studio/2017/Community"
80+
81+
ENGINE_PATH: "c:/flutter/engine"
82+
83+
# robocopy can return 1 for successful copy; suppress its error code.
84+
# move somehow doesn't work as it complains that the file is being used by another process.
7485
gclient_sync_script: |
75-
mkdir -p $ENGINE_PATH/src
76-
echo 'solutions = [{"managed": False,"name": "src/flutter","url": "git@github.com:flutter/engine.git","deps_file": "DEPS", "custom_vars": {"download_android_deps" : False, "download_windows_deps" : False,},},]' > $ENGINE_PATH/.gclient
77-
cd $ENGINE_PATH/src
78-
rm -rf flutter
79-
rm -rf out
80-
mv $CIRRUS_WORKING_DIR flutter
86+
robocopy %CIRRUS_WORKING_DIR% %ENGINE_PATH%/src/flutter /MIR || (cmd /s /c exit /b 0)
87+
cd %ENGINE_PATH%/src
8188
gclient sync
82-
format_script: cd $ENGINE_PATH/src/flutter && ./ci/format.sh
83-
build_script: cd $ENGINE_PATH/src/flutter && ./ci/build.sh
89+
# Currently there's a problem with `flutter/tools/gn --unoptimized` so we omit --unoptimized for now
90+
compile_host_script: |
91+
cd %ENGINE_PATH%/src
92+
python flutter/tools/gn
93+
ninja -C out/host_debug

0 commit comments

Comments
 (0)