Skip to content

Commit c2d91d3

Browse files
committed
Set using stevedoreBuildDeps as default (cherry-pick unity-master merge
1 parent dd1cb5c commit c2d91d3

File tree

10 files changed

+94
-91
lines changed

10 files changed

+94
-91
lines changed

.gitlab-ci.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
stages:
2-
- runall
2+
- runall-and-report-to-github-pending
33
- build
44
- collate
5-
6-
# This is just a config to help trigger rest of the builds
7-
run_all_builds:
8-
image: ubuntu:latest
9-
stage: runall
10-
variables:
11-
GIT_STRATEGY: none
5+
- report-to-github-done
6+
7+
###############################################################################
8+
# report result to github
9+
###############################################################################
10+
runall-and-report-to-github-pending:
11+
image: python:2.7
12+
stage: runall-and-report-to-github-pending
1213
script:
13-
- pwd
14+
- python reportCiResult.py "gitlab-ci" "pending"
1415
when: manual
1516
allow_failure: false
1617

@@ -122,9 +123,6 @@ build_win:
122123
- windows
123124
script:
124125
- git submodule update --init --recursive
125-
- cd external/buildscripts
126-
- ./bee.exe
127-
- cd ../..
128126
- perl external/buildscripts/build_runtime_win64.pl --stevedorebuilddeps=1
129127
- mkdir -p incomingbuilds/win64
130128
- cp -r builds/* incomingbuilds/win64/
@@ -143,9 +141,6 @@ build_win_x86:
143141
- windows
144142
script:
145143
- git submodule update --init --recursive
146-
- cd external/buildscripts
147-
- ./bee.exe
148-
- cd ../..
149144
- perl external/buildscripts/build_runtime_win.pl --stevedorebuilddeps=1
150145
- mkdir -p incomingbuilds/win32
151146
- cp -r builds/* incomingbuilds/win32/
@@ -164,9 +159,6 @@ build_win_bare_minimum:
164159
- windows
165160
script:
166161
- git submodule update --init --recursive
167-
- cd external/buildscripts
168-
- ./bee.exe
169-
- cd ../..
170162
- perl external/buildscripts/build_unityscript_bareminimum_win.pl
171163
- mkdir -p incomingbuilds/bareminimum
172164
- cp -r builds/* incomingbuilds/bareminimum/
@@ -244,4 +236,22 @@ collate_builds:
244236
artifacts:
245237
paths:
246238
- collectedbuilds/builds.7z
247-
expire_in: 1 week
239+
expire_in: 1 week
240+
241+
242+
###############################################################################
243+
# report result to github
244+
###############################################################################
245+
report-to-github-done:failure:
246+
image: python:2.7
247+
when: on_failure
248+
stage: report-to-github-done
249+
script:
250+
- python reportCiResult.py "gitlab-ci" "failure"
251+
252+
report-to-github-done:success:
253+
image: python:2.7
254+
when: on_success
255+
stage: report-to-github-done
256+
script:
257+
- python reportCiResult.py "gitlab-ci" "success"

external/buildscripts/build.pl

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
my $tizen=0;
6565
my $tizenEmulator=0;
6666
my $windowsSubsystemForLinux=0;
67-
my $stevedoreBuildDeps=0;
67+
my $stevedoreBuildDeps=1;
6868

6969
# Handy troubleshooting/niche options
7070
my $skipMonoMake=0;
@@ -304,20 +304,30 @@
304304

305305
if (!(-d "$externalBuildDeps"))
306306
{
307-
if (not $checkoutonthefly)
307+
if($stevedoreBuildDeps)
308308
{
309-
print(">>> No external build deps found. Might as well try to check them out. If it fails, we'll continue and trust mono is in your PATH\n");
309+
print(">>> Running bee to download build-deps...\n");
310+
chdir($buildscriptsdir) eq 1 or die ("failed to chdir to $buildscriptsdir directory\n");
311+
system("./bee") eq 0 or die ("failed to run bee\n");
312+
chdir("$monoroot") eq 1 or die ("failed to chdir to $monoroot\n");
310313
}
314+
else
315+
{
316+
if (not $checkoutonthefly)
317+
{
318+
print(">>> No external build deps found. Might as well try to check them out. If it fails, we'll continue and trust mono is in your PATH\n");
319+
}
311320

312-
# Check out on the fly
313-
print(">>> Checking out mono build dependencies to : $externalBuildDeps\n");
314-
my $repo = "https://ono.unity3d.com/unity-extra/mono-build-deps";
315-
print(">>> Cloning $repo at $externalBuildDeps\n");
316-
my $checkoutResult = system("hg", "clone", $repo, "$externalBuildDeps");
321+
# Check out on the fly
322+
print(">>> Checking out mono build dependencies to : $externalBuildDeps\n");
323+
my $repo = "https://ono.unity3d.com/unity-extra/mono-build-deps";
324+
print(">>> Cloning $repo at $externalBuildDeps\n");
325+
my $checkoutResult = system("hg", "clone", $repo, "$externalBuildDeps");
317326

318-
if ($checkoutOnTheFly && $checkoutResult ne 0)
319-
{
320-
die("failed to checkout mono build dependencies\n");
327+
if ($checkoutOnTheFly && $checkoutResult ne 0)
328+
{
329+
die("failed to checkout mono build dependencies\n");
330+
}
321331
}
322332

323333
# Only clean up if the dir exists. Otherwise abs_path will return empty string

external/buildscripts/build_classlibs_osx.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
my $clean = 1;
1313
my $mcsOnly = 0;
1414
my $skipMonoMake = 0;
15-
my $stevedoreBuildDeps=0;
15+
my $stevedoreBuildDeps=1;
1616

1717
# Handy troubleshooting/niche options
1818

external/buildscripts/build_runtime_android.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
my $androidArch = "";
1212
my $clean = 1;
1313
my $windowsSubsystemForLinux = 0;
14-
my $stevedoreBuildDeps = 0;
14+
my $stevedoreBuildDeps = 1;
1515

1616
GetOptions(
1717
"androidarch=s"=>\$androidArch,
@@ -28,5 +28,5 @@
2828
}
2929
else
3030
{
31-
system("perl", "$buildScriptsRoot/build.pl", "--build=1", "--clean=$clean", "--artifact=1", "--arch32=1", "--androidarch=$androidArch", "--forcedefaultbuilddeps=1", "--windowssubsystemforlinux=$windowsSubsystemForLinux") eq 0 or die ("Failed building mono for $androidArch\n");
31+
system("perl", "$buildScriptsRoot/build.pl", "--build=1", "--clean=$clean", "--artifact=1", "--arch32=1", "--androidarch=$androidArch", "--forcedefaultbuilddeps=1", "--windowssubsystemforlinux=$windowsSubsystemForLinux", "--stevedorebuilddeps=$stevedoreBuildDeps") eq 0 or die ("Failed building mono for $androidArch\n");
3232
}

external/buildscripts/build_runtime_linux.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
my $monoroot = File::Spec->rel2abs(dirname(__FILE__) . "/../..");
88
my $monoroot = abs_path($monoroot);
99
my $buildScriptsRoot = "$monoroot/external/buildscripts";
10-
11-
my $stevedoreBuildDeps = 0;
10+
my $stevedoreBuildDeps = 1;
1211
my $build64 = 0;
1312

1413
GetOptions(

external/buildscripts/build_runtime_osx.pl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
my $monoroot = File::Spec->rel2abs(dirname(__FILE__) . "/../..");
88
my $monoroot = abs_path($monoroot);
99
my $buildScriptsRoot = "$monoroot/external/buildscripts";
10-
11-
my $stevedoreBuildDeps=0;
10+
my $stevedoreBuildDeps=1;
1211

1312
GetOptions(
1413
'stevedorebuilddeps=i'=>\$stevedoreBuildDeps,

external/buildscripts/build_runtime_win.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
my $monoroot = File::Spec->rel2abs(dirname(__FILE__) . "/../..");
88
my $monoroot = abs_path($monoroot);
99
my $buildScriptsRoot = "$monoroot/external/buildscripts";
10-
my $stevedoreBuildDeps = 0;
10+
my $stevedoreBuildDeps = 1;
1111

1212
GetOptions(
1313
"stevedorebuilddeps=i"=>\$stevedoreBuildDeps,

external/buildscripts/build_runtime_win64.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
my $monoroot = abs_path($monoroot);
99
my $buildScriptsRoot = "$monoroot/external/buildscripts";
1010

11-
my $stevedoreBuildDeps = 0;
11+
my $stevedoreBuildDeps = 1;
1212

1313
GetOptions(
1414
"stevedorebuilddeps=i"=>\$stevedoreBuildDeps,

external/buildscripts/build_win_no_cygwin.pl

Lines changed: 3 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
my $winMonoRoot = $monoroot;
3838
my $msBuildVersion = "14.0";
3939
my $buildDeps = "";
40-
my $stevedoreBuildDeps=0;
40+
my $stevedoreBuildDeps=1;
4141
4242
print(">>> Build All Args = @ARGV\n");
4343
@@ -98,58 +98,9 @@
9898
9999
if ($build)
100100
{
101-
if ($existingMonoRootPath eq "")
101+
if (!(-d "$externalBuildDeps"))
102102
{
103-
print(">>> No existing mono supplied. Checking for external...\n");
104-
105-
if (!(-d "$externalBuildDeps"))
106-
{
107-
if (not $checkoutonthefly)
108-
{
109-
print(">>> No external build deps found. Might as well try to check them out. If it fails, we'll continue and trust mono is in your PATH\n");
110-
}
111-
112-
# Check out on the fly
113-
print(">>> Checking out mono build dependencies to : $externalBuildDeps\n");
114-
my $repo = "https://ono.unity3d.com/unity-extra/mono-build-deps";
115-
print(">>> Cloning $repo at $externalBuildDeps\n");
116-
my $checkoutResult = system("hg", "clone", $repo, "$externalBuildDeps");
117-
118-
if ($checkoutOnTheFly && $checkoutResult ne 0)
119-
{
120-
die("failed to checkout mono build dependencies\n");
121-
}
122-
}
123-
124-
if (-d "$existingExternalMono")
125-
{
126-
print(">>> External mono found at : $existingExternalMono\n");
127-
128-
if (-d "$existingExternalMono/builds")
129-
{
130-
print(">>> Mono already extracted at : $existingExternalMono/builds\n");
131-
}
132-
133-
if (!(-d "$existingExternalMono/builds"))
134-
{
135-
# We need to extract builds.zip
136-
print(">>> Extracting mono builds.zip...\n");
137-
my $SevenZip = "$externalBuildDeps/7z/win64/7za.exe";
138-
print(">>> Using 7z : $SevenZip\n");
139-
system("$SevenZip", "x", "$existingExternalMono/builds.zip", "-o$existingExternalMono") eq 0 or die("Failed extracting mono builds.zip\n");
140-
}
141-
142-
$existingMonoRootPath = "$existingExternalMono/builds";
143-
}
144-
else
145-
{
146-
print(">>> No external mono found. Trusting a new enough mono is in your PATH.\n");
147-
}
148-
}
149-
150-
if ($existingMonoRootPath ne "" && !(-d $existingMonoRootPath))
151-
{
152-
die("Existing mono not found at : $existingMonoRootPath\n");
103+
print(">>> mono-build-deps is not required for windows runtime builds...\n");
153104
}
154105
155106
system("$winPerl", "$winMonoRoot/external/buildscripts/build_runtime_vs.pl", "--build=$build", "--arch32=$arch32", "--msbuildversion=$msBuildVersion", "--clean=$clean", "--debug=$debug", "--gc=bdwgc") eq 0 or die ('failed building mono bdwgc with VS\n');

reportCiResult.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python2.7
2+
3+
import os
4+
import sys
5+
import textwrap
6+
7+
def post_to_github(context, state, description=None):
8+
if 'GITHUB_TOKEN' not in os.environ:
9+
print 'NOT posting results to GitHub ($GITHUB_TOKEN not available)'
10+
return
11+
12+
payload = dict(
13+
context=context,
14+
state=state,
15+
#target_url="{CI_PROJECT_URL}/-/jobs/{CI_BUILD_ID}".format(**os.environ),
16+
target_url="{CI_PROJECT_URL}/pipelines/{CI_PIPELINE_ID}".format(**os.environ),
17+
)
18+
19+
if description:
20+
payload.update(dict(description=description))
21+
22+
import requests
23+
print 'sending status to github...'
24+
print 'sending to: {GITHUB_REPO_API}/statuses/{CI_COMMIT_SHA}'.format(**os.environ)
25+
print 'Bearer {GITHUB_TOKEN}'.format(**os.environ)
26+
response = requests.post(
27+
'{GITHUB_REPO_API}/statuses/{CI_COMMIT_SHA}'.format(**os.environ),
28+
headers={'Authorization': 'Bearer {GITHUB_TOKEN}'.format(**os.environ)},
29+
json=payload,
30+
)
31+
print response.text
32+
33+
os.system('pip install requests')
34+
post_to_github(context=sys.argv[1], state=sys.argv[2])

0 commit comments

Comments
 (0)