mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1336607 - Remove dummy geckolib and taskgraph filter; r=froydnj
Now that we use the real geckolib and have all dependencies vendored, the dummy geckolib is no longer required, so we remove it. Also, the taskgraph code for testing for Servo's presence always passes and is no longer needed, so we remove it. Pushed on a CLOSED TREE because ¯\_(ツ)_/¯ MozReview-Commit-ID: ITAqArK4Bks --HG-- extra : rebase_source : 5eedb3994b679109246b89b0456dd2a59ef3212b extra : amend_source : b0c97486ae2b72fd21c7968849735e4189e2e86f
This commit is contained in:
parent
cd6c97ea60
commit
de39e4a302
@ -134,7 +134,6 @@ def get_decision_parameters(options):
|
||||
# Define default filter list, as most configurations shouldn't need
|
||||
# custom filters.
|
||||
parameters['filters'] = [
|
||||
'check_servo',
|
||||
'target_tasks_method',
|
||||
]
|
||||
|
||||
|
@ -37,29 +37,3 @@ def filter_target_tasks(graph, parameters):
|
||||
fn = target_tasks.get_method(attr)
|
||||
return fn(graph, parameters)
|
||||
|
||||
|
||||
@filter_task('check_servo')
|
||||
def filter_servo(graph, parameters):
|
||||
"""Filters out tasks requiring Servo if Servo isn't present."""
|
||||
# This filter is temporary until Servo's dependencies are vendored.
|
||||
cargo = os.path.join(GECKO, 'toolkit', 'library', 'rust', 'shared',
|
||||
'Cargo.toml')
|
||||
with open(cargo, 'rb') as fh:
|
||||
cargo = fh.read()
|
||||
|
||||
if b'servo/ports/geckolib' in cargo:
|
||||
return graph.tasks.keys()
|
||||
|
||||
logger.info('real servo geckolib not used; removing tasks requiring it')
|
||||
|
||||
SERVO_PLATFORMS = {
|
||||
'linux64-stylo',
|
||||
}
|
||||
|
||||
def fltr(task):
|
||||
if task.attributes.get('build_platform') in SERVO_PLATFORMS:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
return [l for l, t in graph.tasks.iteritems() if fltr(t)]
|
||||
|
@ -1,62 +0,0 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from mozunit import main
|
||||
|
||||
from .. import filter_tasks
|
||||
from ..graph import (
|
||||
Graph,
|
||||
)
|
||||
from ..taskgraph import (
|
||||
TaskGraph,
|
||||
)
|
||||
from .util import (
|
||||
TestTask,
|
||||
)
|
||||
|
||||
|
||||
class TestServoFilter(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self._tmpdir = tempfile.mkdtemp()
|
||||
filter_tasks.GECKO = self._tmpdir
|
||||
|
||||
def tearDown(self):
|
||||
shutil.rmtree(self._tmpdir)
|
||||
|
||||
def test_basic(self):
|
||||
graph = TaskGraph(tasks={
|
||||
'a': TestTask(kind='build', label='a',
|
||||
attributes={'build_platform': 'linux64'}),
|
||||
'b': TestTask(kind='build', label='b',
|
||||
attributes={'build_platform': 'linux64-stylo'}),
|
||||
'c': TestTask(kind='desktop-test', label='c', attributes={}),
|
||||
}, graph=Graph(nodes={'a', 'b', 'c'}, edges=set()))
|
||||
|
||||
shared = os.path.join(self._tmpdir, 'toolkit', 'library', 'rust', 'shared')
|
||||
cargo = os.path.join(shared, 'Cargo.toml')
|
||||
os.makedirs(shared)
|
||||
with open(cargo, 'a'):
|
||||
pass
|
||||
|
||||
# Default Cargo.toml should result in Servo tasks being pruned.
|
||||
self.assertEqual(set(filter_tasks.filter_servo(graph, {})), {'a', 'c'})
|
||||
|
||||
# Servo tasks should be retained if real geckolib is present.
|
||||
with open(cargo, 'wb') as fh:
|
||||
fh.write(b'[dependencies]\n')
|
||||
fh.write(b'geckoservo = { path = "../../../../servo/ports/geckolib" }\n')
|
||||
|
||||
self.assertEqual(set(filter_tasks.filter_servo(graph, {})),
|
||||
{'a', 'b', 'c'})
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,12 +0,0 @@
|
||||
[package]
|
||||
name = "geckoservo"
|
||||
version = "0.0.0"
|
||||
authors = ["nobody@mozilla.org"]
|
||||
license = "MPL-2.0"
|
||||
description = "Dummy geckoservo package for build-time bindgen to land turned off"
|
||||
|
||||
[features]
|
||||
bindgen = []
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
@ -1,5 +0,0 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
// Empty file. You should not need to add anything here.
|
Loading…
Reference in New Issue
Block a user