From: Thomas Leonard Date: Thu, 28 Feb 2013 09:45:57 +0000 (+0000) Subject: Depend on 0compile using the feed X-Git-Tag: v0.15~10 X-Git-Url: https://repo.or.cz/w/0release.git/commitdiff_plain/ced52a70ea2b3535d67829c01aa3a35939b7b953 Depend on 0compile using the feed We only need 0compile when releasing compiled binaries. The process was: 1. master runs user command on slave, typically "0launch .../0release.xml --build-slave" 2. the 0release build slave runs "0launch .../0compile.xml" Now, we add a new with a 0compile dependency. So: 1. master runs user command on slave, typically "0launch --command=build-slave .../0release.xml" This means we only need to run 0install once. --- diff --git a/0release.xml b/0release.xml index 3c456bb..f407490 100644 --- a/0release.xml +++ b/0release.xml @@ -19,19 +19,26 @@ - - - + + + + + --build-slave + + + + - - - + + + + diff --git a/compile.py b/compile.py index 573f86d..aa80035 100644 --- a/compile.py +++ b/compile.py @@ -1,15 +1,13 @@ # Copyright (C) 2009, Thomas Leonard # See the README file for details, or visit http://0install.net. -import tempfile, shutil, os +import tempfile, shutil, os, sys import ConfigParser from logging import info from zeroinstall.support import basedir import support -COMPILE = 'http://0install.net/2006/interfaces/0compile.xml' - class Compiler: def __init__(self, options, src_feed_name): self.src_feed_name = src_feed_name @@ -24,7 +22,8 @@ class Compiler: self.config.set('global', 'builders', 'host') self.config.add_section('builder-host') - self.config.set('builder-host', 'build', '0launch --not-before 0.10 http://0install.net/2007/interfaces/0release.xml --build-slave "$@"') + #self.config.set('builder-host', 'build', '0launch --not-before 0.10 http://0install.net/2007/interfaces/0release.xml --build-slave "$@"') + self.config.set('builder-host', 'build', '0launch --command=build-slave http://0install.net/2007/interfaces/0release.xml "$@"') self.src_impl = support.get_singleton_impl(self.src_feed) if self.src_impl.arch and self.src_impl.arch.endswith('-src'): @@ -95,6 +94,14 @@ class Compiler: # This is the actual build process, running on the build machine def build_slave(src_feed, archive_file, archive_dir_public_url, target_feed): + try: + COMPILE = [os.environ['0COMPILE']] + except KeyError: + print >>sys.stdout, ("\n\n*****\n" + "Please update your ~/.config/0install.net/0release/builders.conf file to use --command=build-slave." + "\n*****\n\n") + COMPILE = ['0launch', '--not-before=0.30', 'http://0install.net/2006/interfaces/0compile.xml'] + feed = support.load_feed(src_feed) src_feed = os.path.abspath(src_feed) @@ -125,8 +132,8 @@ def build_slave(src_feed, archive_file, archive_dir_public_url, target_feed): finally: stream.close() - support.check_call(['0launch', '--not-before=0.30', COMPILE, 'build'], cwd = tmpdir) - support.check_call(['0launch', '--not-before=0.30', COMPILE, 'publish', '--target-feed', target_feed], cwd = tmpdir) + support.check_call(COMPILE + ['build'], cwd = tmpdir) + support.check_call(COMPILE + ['publish', '--target-feed', target_feed], cwd = tmpdir) # TODO: run unit-tests diff --git a/tests/testrelease.py b/tests/testrelease.py index 3add727..b1b00a9 100755 --- a/tests/testrelease.py +++ b/tests/testrelease.py @@ -8,6 +8,7 @@ from zeroinstall.injector.config import load_config from zeroinstall.support import basedir, ro_rmtree sys.path.insert(0, '..') +os.environ['http_proxy'] = 'localhost:1111' # Prevent accidental network access import support