summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-26 18:59:01 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-03-29 16:55:50 +0000
commita7f12476d4e7b2025a60be58027b67b9e551f31b (patch)
tree8a5de760ab7281368d11a25c659780d3aea3539f /morphlib/plugins
parent9404317020ff0455cbfd3ca7976d546af823759b (diff)
downloadmorph-a7f12476d4e7b2025a60be58027b67b9e551f31b.tar.gz
Add support for definitions version 8
This code is a rework from changes done by: - Tiago Gomes <tiago.gomes@codethink.co.uk> https://storyboard.baserock.org/#!/story/86 Change-Id: I3475c2bcb648a272fee33bc878a521f79d4e6581
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/build_plugin.py6
-rw-r--r--morphlib/plugins/cross-bootstrap_plugin.py13
-rw-r--r--morphlib/plugins/distbuild_plugin.py6
3 files changed, 17 insertions, 8 deletions
diff --git a/morphlib/plugins/build_plugin.py b/morphlib/plugins/build_plugin.py
index 0aab2d51..69848b04 100644
--- a/morphlib/plugins/build_plugin.py
+++ b/morphlib/plugins/build_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2015 Codethink Limited
+# Copyright (C) 2012-2016 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -226,6 +226,8 @@ class BuildPlugin(cliapp.Plugin):
'''
bc = morphlib.buildcommand.BuildCommand(self.app)
bc.validate_sources(source_pool)
+ bc.source_pool = source_pool
+ definitions_version = source_pool.definitions_version
root = bc.resolve_artifacts(source_pool)
if not component_names:
component_names = [root.source.name]
@@ -234,7 +236,7 @@ class BuildPlugin(cliapp.Plugin):
raise ComponentNotInSystemError(not_found, filename)
for name, component in components.iteritems():
component.build_env = root.build_env
- bc.build_in_order(component)
+ bc.build_in_order(component, definitions_version)
self.app.status(msg='%(kind)s %(name)s is cached at %(path)s',
kind=component.source.morphology['kind'],
name=name,
diff --git a/morphlib/plugins/cross-bootstrap_plugin.py b/morphlib/plugins/cross-bootstrap_plugin.py
index c6ab8017..7c1793f5 100644
--- a/morphlib/plugins/cross-bootstrap_plugin.py
+++ b/morphlib/plugins/cross-bootstrap_plugin.py
@@ -104,7 +104,8 @@ class BootstrapSystemBuilder(morphlib.builder.BuilderBase):
if not os.path.exists(source_dir):
os.makedirs(source_dir)
morphlib.builder.extract_sources(
- self.app, self.repo_cache, s.repo, s.sha1, source_dir)
+ self.app, self.definitions_version, self.repo_cache,
+ s.repo, s.sha1, source_dir, s)
name = s.name
chunk_script = os.path.join(path, 'src', 'build-%s' % name)
@@ -256,6 +257,8 @@ class CrossBootstrapPlugin(cliapp.Plugin):
srcpool = build_command.create_source_pool(
root_repo, ref, [morph_name])
+ definitions_version = srcpool.definitions_version
+
# FIXME: this is a quick fix in order to get it working for
# Baserock 13 release, it is not a reasonable fix
def validate(self, root_artifact):
@@ -289,10 +292,11 @@ class CrossBootstrapPlugin(cliapp.Plugin):
'mode can be cross-compiled.')
for s in cross_sources:
- build_command.cache_or_build_source(s, build_env)
+ build_command.cache_or_build_source(s, build_env,
+ definitions_version)
for s in native_sources:
- build_command.fetch_sources(s)
+ build_command.fetch_sources(s, definitions_version)
# Install those to the output tarball ...
self.app.status(msg='Building final bootstrap system image')
@@ -302,7 +306,8 @@ class CrossBootstrapPlugin(cliapp.Plugin):
system_artifact.source, build_env, use_chroot=False)
builder = BootstrapSystemBuilder(
self.app, staging_area, build_command.lac, build_command.rac,
- system_artifact.source, build_command.repo_cache, 1, False)
+ system_artifact.source, build_command.repo_cache, 1, False,
+ definitions_version)
builder.build_and_cache()
self.app.status(
diff --git a/morphlib/plugins/distbuild_plugin.py b/morphlib/plugins/distbuild_plugin.py
index 2da089f3..50abfc71 100644
--- a/morphlib/plugins/distbuild_plugin.py
+++ b/morphlib/plugins/distbuild_plugin.py
@@ -1,6 +1,6 @@
# distbuild_plugin.py -- Morph distributed build plugin
#
-# Copyright (C) 2014-2015 Codethink Limited
+# Copyright (C) 2014-2016 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -248,6 +248,8 @@ class WorkerBuild(cliapp.Plugin):
artifact_reference.ref,
[artifact_reference.root_filename])
+ definitions_version = source_pool.definitions_version
+
root = bc.resolve_artifacts(source_pool)
# Now, before we start the build, we garbage collect the caches
@@ -263,7 +265,7 @@ class WorkerBuild(cliapp.Plugin):
source = self.find_source(source_pool, artifact_reference)
build_env = bc.new_build_env(artifact_reference.arch)
- bc.build_source(source, build_env)
+ bc.build_source(source, build_env, definitions_version)
def find_source(self, source_pool, artifact_reference):
for s in source_pool.lookup(artifact_reference.source_repo,