The Applications from AGL framework must have a build script

Description

The Applications from AGL framework should have a full packaging solution, Independent of yocto workflow.

Unfortunately the build part of the Applications is only in documentation or in yocto recipes.

The Applications build with AGL framework must be automated without any yocto recipes.


Current proposal:

  1. a script named AGLbuild is used to control application build operations

  2. the bbclass aglwgt.bbclass will call AGLbuild for all operations

  3. AGLbuild is located at the top level of the application repository

  4. AGLbuild is a script written in one of the following languages:

    1. Makefile

    2. Bash

    3. Python

  5. The script will be executed directly after a chmod() on it (this implies that the caller should make the script executable before calling it: caller could be aglwgt.bbclass, a jenkins job, a 'real' developer ...)
    An appropriate shebang is required to make the script callable directly:

    1. '#!/usr/bin/make -f' for Makefile format,

    2. '#/usr/bin/bash' for Bash

    3. etc.

  6. The calling convention is close to the one from make, in particular to pass arguments through env variables. This is also easy for bash, as a simple eval on arguments will set environment variables correctly.
    The generic call has the following format:

    1. AGLbuild <command> [ARG1="value1" [ARG2="value2" ... ]]
      which is equivalent to

    2. export ARG1="value"; export ARG2="value" ...; AGLbuild <command>

  7. AGLbuild can be invoked from any directory and all relative paths are considered to be relative to the location of AGLbuild.

    1. For makefile scripts, this is the usual behaviour.

    2. For bash scripts, running a 'cd $(dirname $0)' at the beginning is mandatory

  8. At build time, the following calls must be made in the following order:

    1. AGLbuild configure CONFIGURE_ARGS="..."
      initializes the build environment (ex: if app uses cmake, the 'configure'' step will run cmake)

    2. AGLbuild build BUILD_ARGS="...."
      builds the application (compile, link binaries, assembles javascript etc.)

    3. AGLbuild package PACKAGE_ARGS="..." DEST=<path for resulting wgt file(s)>
      creates the widget package(s) in the specified destination path prepared by the caller

    4. AGLbuild clean CLEAN_ARGS="..."
      clean the built files (removes the result of AGLbuild build)

    5. AGLbuild distclean DISTCLEAN_ARGS="..."
      clean everything (removes the result of AGLbuild build + AGLbuild configure)

  9. Notes, comments, options:

    1. multiple widgets can be created for a single build

    2. the caller is responsible for giving the destination path where the .wgt files will be created (default is top directory: DEST=. ) So aglwgt.bbclass will need a small adjustment on this.

    3. there's nothing specified regarding CONFIGURE_ARGS, BUILD_ARGS, PACKAGE_ARGS: the values can be set from bitbake recipes or freely from a caller script.

      1. Typically bitbake variables AGLWGT_XXX could be re-used by aglwgt.bbclass to pass arguments XXX_ARGS to AGLbuild

    4. official arguments could be introduced for different purposes:

      1. specify a build mode: debug, development, qa, release/production

      2. apps signing


Environment

yocto and application framwork

Activity

Show:

Stephane Desneux July 4, 2017 at 1:12 PM

: following our discussion in CIAT EG meeting

The following now works inside the docker container, using M3 SDK:

The trick is that conf.d/autobuild/agl/autobuild is generated from conf.d/app-templates/autobuild/agl/autobuild.in when building manually. What I did is that I just commited in helloworld-service the file conf.d/autobuild/agl/autobuild that was in .gitignore before.

Romain Forlot June 29, 2017 at 8:31 AM

Now integration in Yocto can begin based on that.

Romain Forlot June 29, 2017 at 8:27 AM

First "release" about build script is done and work this way:

  • Use the app-templates repository with your apps project development and follow the README to fit your project.

  • Generate autobuild script : mkdir build; cd build; cmake ..; make autobuild

  • Commit generated autobuild scripts.

Then you can use the script:

./conf.d/autobuild/agl/autobuild package DEST=/tmp

It will output a wgt file in /tmp directory.

Stephane Desneux June 27, 2017 at 4:11 PM
Edited

At the end, the autobuild script will be located in: conf.d/autobuild/<TARGET>/autobuild

TARGET can be currently:

  • agl

  • linux (for native builds)

Stephane Desneux May 4, 2017 at 12:24 PM

Agreed. We're currently working on both new cmake macros and app templates here: https://git.automotivelinux.org/apps/app-templates/

Let's see how it behaves in simple cases then more complex ones.

Be sure that we try to keep things as simple as possible while being able to deal with multiple apps sources/IDEs,/development environments. For example, having a developer who wants to build an application using cmake for a desktop Linux could be convenient (you'd get a RPM package that could be installed locally).

Fixed

Details

Assignee

Reporter

Labels

Contract ID

Components

Priority

Created March 22, 2017 at 3:08 PM
Updated October 31, 2018 at 11:50 AM
Resolved June 29, 2017 at 8:27 AM