Skip to content
Snippets Groups Projects
Commit 4fc4e695 authored by Simon McVittie's avatar Simon McVittie
Browse files

Build relocatable installation from installed files in a temp directory

parent 4236e11b
No related branches found
No related tags found
No related merge requests found
......@@ -38,32 +38,28 @@ build:scout:
apt-get -y --no-install-recommends install \
bubblewrap \
libcapsule0 \
libcapsule-tools-relocatable \
libcapsule-tools-relocatable:amd64 \
libcapsule-tools-relocatable:i386 \
libglib2.0-dev \
libxau-dev \
meson \
${NULL+}
meson \
--prefix="$(pwd)/_build/relocatable-install" \
-Dpython=python3.5 \
_build
meson --prefix="$(pwd)/_build/prefix" -Dpython=python3.5 _build
ninja -C _build
ninja -C _build install
meson test --verbose -C _build
ninja -C _build install
rm -fr _build/relocatable-install
./build-relocatable-install.py \
--srcdir . \
--builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--prefix="$(pwd)/_build/relocatable-install" \
--output _build/relocatable-install \
--archive "$(pwd)/_build" \
--set-version "$(cat .tarball-version)" \
${NULL+}
prove -v ./tests/relocatable-install.py :: \
--srcdir . \
--builddir _build \
--prefix="$(pwd)/_build/relocatable-install" \
${NULL+}
"$(pwd)/_build/relocatable-install"
# Artifacts are currently disabled because uploading them to the
# coordinator results in HTTP 413 Request Entity Too Large.
......
......@@ -143,25 +143,24 @@ Building a relocatable install for deployment
To make the built version compatible with older systems, you will need
a SteamRT 1 'scout' environment.
The most straightforward method is to have prebuilt versions of
libcapsule-tools-relocatable:amd64, libcapsule-tools-relocatable:i386
and bubblewrap in your build environment. For example, you could do the
build in a SteamRT 1 'scout' SDK Docker image that has those packages
already. Then you can do:
For this, you need prebuilt versions of libcapsule-tools-relocatable:amd64
and libcapsule-tools-relocatable:i386 either in your build environment
or available via apt-get. For example, you could do the build in a
SteamRT 1 'scout' SDK Docker image that has those packages already.
Then you can do:
meson --prefix=$(pwd)/_build/relocatable-install _build
meson --prefix="$(pwd)/_build/prefix" _build
ninja -C _build
rm -fr $(pwd)/_build/relocatable-install
meson test -v -C _build # optional
ninja -C _build install
rm -fr _build/relocatable-install
./build-relocatable-install.py \
--srcdir . \
--builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--output _build/relocatable-install \
--archive .
./tests/relocatable-install.py \
--srcdir . \
--builddir _build # optional
./tests/relocatable-install.py _build/relocatable-install # optional
For more convenient use on a development system, if you have a
SteamRT 1 'scout' SDK tarball or an unpacked sysroot, you can place a
......@@ -170,16 +169,15 @@ tarball at `_build/sysroot.tar.gz` or unpack a sysroot into
`./sysroot/run-in-sysroot.py`:
./sysroot/run-in-sysroot.py apt-get update
./sysroot/run-in-sysroot.py meson ...
rm -fr $(pwd)/_build/relocatable-install
./sysroot/run-in-sysroot.py ninja ...
./sysroot/run-in-sysroot.py ./build-relocatable-install.py ...
./sysroot/run-in-sysroot.py meson --prefix="$(pwd)/_build/prefix" _build
./sysroot/run-in-sysroot.py ninja -C _build
(etc.)
(Or put them in different locations and pass the `--sysroot` and
`--tarball` options to `./sysroot/run-in-sysroot.py`.)
The relocatable install goes into`_build/relocatable-install` (or
whatever you used as the `--prefix`), and a compressed version ends
The relocatable install goes into `relocatable-install` (or
whatever you used as the `--output`), and a compressed version ends
up in the directory passed as an argument to `--archive`.
Instructions for testing
......
This diff is collapsed.
......@@ -109,23 +109,21 @@ pipeline {
sh '''
set -eu
cd src
meson --prefix="${WORKSPACE}/src/_build/relocatable-install" -Dpython=python3.5 _build
meson --prefix="$(pwd)/_build/prefix" -Dpython=python3.5 _build
ninja -C _build
ninja -C _build install
meson test --verbose -C _build
ninja -C _build install
rm -fr ../relocatable-install
./build-relocatable-install.py \
--srcdir . \
--builddir _build \
--libcapsuledir /usr/lib/libcapsule/relocatable \
--prefix="${WORKSPACE}/src/_build/relocatable-install" \
--output "${WORKSPACE}/relocatable-install" \
--archive "${WORKSPACE}" \
--set-version "$(cat .tarball-version)" \
${NULL+}
prove -v ./tests/relocatable-install.py :: \
--srcdir . \
--builddir _build \
--prefix="${WORKSPACE}/src/_build/relocatable-install" \
${NULL+}
"${WORKSPACE}/relocatable-install"
'''
}
}
......
......@@ -176,40 +176,10 @@ def main():
# type: () -> None
parser = argparse.ArgumentParser()
parser.add_argument('--destdir', default=os.getenv('DESTDIR', ''))
parser.add_argument('--srcdir', default=G_TEST_SRCDIR)
parser.add_argument('--builddir', default=G_TEST_BUILDDIR)
parser.add_argument('--prefix', default=None)
parser.add_argument('path')
args = parser.parse_args()
if args.destdir:
args.destdir = os.path.abspath(args.destdir)
args.srcdir = os.path.abspath(args.srcdir)
args.builddir = os.path.abspath(args.builddir)
if args.prefix is None:
blob = subprocess.check_output([
'meson', 'introspect', args.builddir, '--buildoptions',
], universal_newlines=True)
for opt in json.loads(blob):
if opt['name'] == 'prefix':
args.prefix = opt['value']
break
else:
raise RuntimeError(
'Unable to determine installation prefix from Meson, '
'please specify --prefix'
)
relocatable_install = args.destdir + args.prefix
if relocatable_install is None:
relocatable_install = os.path.join(args.builddir, 'relocatable-install')
if not os.path.exists(relocatable_install):
print('1..0 # SKIP relocatable-install not in expected location')
sys.exit(0)
relocatable_install = os.path.abspath(args.path)
test = TapTest()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment