Skip to content

Commit 03f6b83

Browse files
committed
Fix deploying binaries to run on post-merge
PullRequest: truffleruby/491
2 parents a762a64 + 99bab25 commit 03f6b83

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

ci.jsonnet

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ local part_definitions = {
335335
linux: {
336336
before_build:: [],
337337
after_build:: [],
338-
"$.run.deploy_and_spec":: { test_spec_options: ["-Gci"] },
338+
"$.run.specs":: { test_spec_options: ["-Gci"] },
339339
"$.cap":: {
340340
normal_machine: ["linux", "amd64"],
341341
bench_machine: ["x52"] + self.normal_machine + ["no_frequency_scaling"],
@@ -357,7 +357,7 @@ local part_definitions = {
357357
after_build:: [
358358
["set-export", "PATH", "$PATH_WITHOUT_LLVM"],
359359
],
360-
"$.run.deploy_and_spec":: { test_spec_options: ["-GdarwinCI"] },
360+
"$.run.specs":: { test_spec_options: ["-GdarwinCI"] },
361361
"$.cap":: {
362362
normal_machine: ["darwin_sierra", "amd64"],
363363
},
@@ -371,11 +371,11 @@ local part_definitions = {
371371
gate: {
372372
capabilities+: self["$.cap"].normal_machine,
373373
targets+: ["gate"],
374-
environment+: {
375-
REPORT_GITHUB_STATUS: "true",
376-
},
377374
},
378-
deploy: { targets+: ["deploy"] },
375+
deploy: {
376+
capabilities+: self["$.cap"].normal_machine,
377+
targets+: ["deploy", "post-merge"],
378+
},
379379
fast_cpu: { capabilities+: ["fast"] },
380380
bench: { capabilities+: self["$.cap"].bench_machine },
381381
x52_18_override: {
@@ -394,15 +394,15 @@ local part_definitions = {
394394
},
395395

396396
run: {
397-
deploy_and_spec: {
398-
local deploy_binaries = [
399-
["mx", "deploy-binary-if-master-or-release"],
400-
],
397+
deploy_truffleruby_binaries: {
398+
run+: [["mx", "ruby_deploy_binaries"]],
399+
},
401400

402-
run+: deploy_binaries + [
401+
test_unit_tck_specs: {
402+
run+: [
403403
["mx", "unittest", "org.truffleruby"],
404404
["mx", "tck"],
405-
] + jt(["test", "specs"] + self["$.run.deploy_and_spec"].test_spec_options) +
405+
] + jt(["test", "specs"] + self["$.run.specs"].test_spec_options) +
406406
jt(["test", "specs", ":ruby25"]),
407407
},
408408

@@ -553,11 +553,11 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
553553

554554
test_builds:
555555
{
556-
local ruby_deploy_and_spec = $.use.maven + $.jdk.labsjdk8 + $.use.common + $.use.build + $.cap.deploy +
557-
$.cap.gate + $.run.deploy_and_spec + { timelimit: "35:00" },
556+
local shared = $.jdk.labsjdk8 + $.use.common + $.use.build + $.cap.gate +
557+
$.run.test_unit_tck_specs + { timelimit: "35:00" },
558558

559-
"ruby-deploy-and-specs-linux": $.platform.linux + ruby_deploy_and_spec,
560-
"ruby-deploy-and-specs-darwin": $.platform.darwin + ruby_deploy_and_spec,
559+
"ruby-test-specs-linux": $.platform.linux + shared,
560+
"ruby-test-specs-darwin": $.platform.darwin + shared,
561561
} +
562562

563563
{
@@ -741,8 +741,17 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
741741
"ruby-standalone-distribution-darwin": $.platform.darwin + $.cap.manual + $.jdk.labsjdk8 + shared + $.run.make_standalone_distribution,
742742
},
743743

744+
deploy_builds:
745+
{
746+
local deploy = $.use.maven + $.jdk.labsjdk8 + $.use.common + $.use.build + $.cap.deploy +
747+
$.run.deploy_truffleruby_binaries + { timelimit: "15:00" },
748+
749+
"ruby-deploy-linux": $.platform.linux + deploy,
750+
"ruby-deploy-darwin": $.platform.darwin + deploy,
751+
},
752+
744753
builds:
745-
local all_builds = $.test_builds + $.bench_builds + $.release_builds;
754+
local all_builds = $.test_builds + $.bench_builds + $.release_builds + $.deploy_builds;
746755
utils.check_builds(
747756
restrict_builds_to,
748757
# Move name inside into `name` field

mx.truffleruby/mx_truffleruby.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,15 @@ def build_truffleruby(args = []):
224224
def run_unittest(*args):
225225
mx_unittest.unittest(['-Dpolyglot.ruby.home='+root, '--verbose', '--suite', 'truffleruby'] + list(args))
226226

227-
def deploy_binary_if_master_or_release(args):
228-
"""If the active branch is 'master' or starts with 'release', deploy binaries for the primary suite."""
227+
def ruby_deploy_binaries(args):
228+
"""Deploy a binary suite for truffleruby"""
229229
assert len(args) == 0
230-
active_branch = mx.VC.get_vc(root).active_branch(root)
231230
deploy_binary = mx.command_function('deploy-binary')
232-
if active_branch == 'master' or active_branch.startswith('release'):
233-
# Deploy platform-independent distributions only on Linux to avoid duplicates
234-
if sys.platform.startswith('linux'):
235-
return deploy_binary(['--skip-existing', 'truffleruby-binary-snapshots'])
236-
else:
237-
return deploy_binary(['--skip-existing', '--platform-dependent', 'truffleruby-binary-snapshots'])
231+
# Deploy platform-independent distributions only on Linux to avoid duplicates
232+
if sys.platform.startswith('linux'):
233+
return deploy_binary(['--skip-existing', 'truffleruby-binary-snapshots'])
238234
else:
239-
mx.log('The active branch is "%s". Binaries are deployed only if the active branch is "master" or starts with "release".' % (active_branch))
240-
return 0
235+
return deploy_binary(['--skip-existing', '--platform-dependent', 'truffleruby-binary-snapshots'])
241236

242237
def download_binary_suite(args):
243238
"""Download a binary suite at the given revision"""
@@ -372,7 +367,7 @@ def ruby_testdownstream_sulong(args):
372367
mx.update_commands(_suite, {
373368
'ruby': [ruby_run_ruby, ''],
374369
'build_truffleruby': [build_truffleruby, ''],
375-
'deploy-binary-if-master-or-release': [deploy_binary_if_master_or_release, ''],
370+
'ruby_deploy_binaries': [ruby_deploy_binaries, ''],
376371
'ruby_download_binary_suite': [download_binary_suite, 'name [revision]'],
377372
'ruby_testdownstream': [ruby_testdownstream, ''],
378373
'ruby_testdownstream_aot': [ruby_testdownstream_aot, 'aot_bin'],

0 commit comments

Comments
 (0)