Commit d21e6ed3 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

Merge branch 'host-build' into 'master'

build: use direct host build by default

Closes #44

See merge request !37
parents 473755b7 2ea07eae
Pipeline #80099 failed with stages
in 4 minutes and 13 seconds
......@@ -4,7 +4,7 @@ build packages
Usage: apkg build [-u] [-s | -a] [<file> | -F <file-list>]...
[-v <ver>] [-r <rls>] [-d <distro>]
[-O <dir>] [--no-cache]
[-H] [-i]
[-i | -I]
Arguments:
<file> specify input <file>s (when using -s or -a)
......@@ -23,10 +23,9 @@ Options:
-O, --result-dir <dir> put results into specified dir
default: pkg/pkgs/DISTRO/NVR
--no-cache disable cache
-H, --host-build build directly on host (!) without isolated env
default: use isolated builder (pbuilder, mock, ...)
-i, --install-dep install build dependencies on host
only works with -H/--host-build
-i, --install-dep install build dependencies on host (build-dep)
-I, --isolated use isolated builder (pbuilder, mock, ...)
default: use direct builder
""" # noqa
from docopt import docopt
......@@ -48,7 +47,7 @@ def run_command(cargs):
distro=args['--distro'],
result_dir=args['--result-dir'],
install_dep=args['--install-dep'],
isolated=not args['--host-build'],
isolated=args['--isolated'],
use_cache=not args['--no-cache'])
common.print_results(results)
return results
......@@ -74,14 +74,10 @@ def build_packages(
raise ex.InvalidSourcePackageFormat(
fmt="arch source package format is PKGBUILD but got: %s"
% srcpkg_path.name)
isolated = kwargs.get('isolated')
log.info("copying source package to build dir: %s", build_path)
shutil.copytree(srcpkg_path.parent, build_path)
# build package using makepkg
if not isolated:
msg = "arch doesn't support direct host build - using isolated"
log.warning(msg)
log.info("starting isolated arch package build using makepkg")
log.info("starting arch package build using makepkg")
with cd(build_path):
run('makepkg', direct='auto')
log.info("copying built packages to result dir: %s", out_path)
......
......@@ -53,7 +53,7 @@ def test_apkg_build(tmpdir, capsys):
repo_dir = str(repo_path)
assert repo_dir.endswith('apkg')
with cd(repo_dir):
assert apkg('build', '--host-build') == 0
assert apkg('build') == 0
out, _ = capsys.readouterr()
# at least one package should be printed
assert re.match(r"pkg/pkgs/\S+/apkg\S+", out)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment