You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Sterling Hughes <st...@apache.org> on 2016/03/04 21:05:13 UTC
targets as packages
Hey,
Recently there was a commit to make targets work like packages, instead
of using a SQLite repository in the base of the application.
The goal here was to make it easier for people to:
a- reuse and redistribute targets
b- read the contents of a target and grep for them
In the new design, when I issue:
$ newt target create blinky_sim
Creating target blinky_sim
Target blinky_sim successfully created!
$ newt target show
blinky_sim
arch=sim
compiler_def=default
name=blinky_sim
vers=0.0.1
This creates a directory structure as follows:
$ ls
BRANCHING_STRATEGY README.md fs net scripts
LICENSE app.yml hw pkg-list.yml sys
NOTICE compiler libs project targets
$ ls targets/blinky_sim/pkg.yml
targets/blinky_sim/pkg.yml
$
With targets/blinky_sim/pkg.yml containing both the package directives,
and the compiler directives:
$ cat targets/blinky_sim/pkg.yml
### Target: blinky_sim
pkg.arch: sim
pkg.bsp: hw/bsp/native
pkg.compiler_def: default
pkg.name: blinky_sim
pkg.vers: 0.0.1
$
I don't think this is correct. I think there should be a file, called
target.yml or <target-name>.yml, that contains a separate set of target
variables.
There is a similar problem with compiler/sim/compiler.yml. Where it
looks like pkg.yml definitions are now hacked into compiler.yml:
$ more compiler/sim/osx-compiler.yml
<snip>
pkg.name: compiler/sim
pkg.vers: 0.8.0
pkg.description: Compiler definition for native gcc compiler.
pkg.author: sterling <st...@runtime.io>
pkg.homepage:
pkg.repository:
https://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva
pkg.keywords:
- sim
- compiler
- gcc
compiler.path.cc: "/usr/local/bin/gcc-5"
compiler.path.archive: "ar"
compiler.path.objdump: "gobjdump"
compiler.path.objsize: "objsize"
compiler.path.objcopy: "gobjcopy"
compiler.flags.base: >
-m32 -Wall -Werror -ggdb -O0 -DMN_OSX
compiler.flags.default: [compiler.flags.base]
compiler.flags.debug: [compiler.flags.base, -ggdb -O0]
compiler.ld.mapfile: false
$
I think we should have a very clear delineation of what goes in a
pkg.yml file, and what goes in other, individual yml files. Compilers
and targets should be broken into their own yml files, with their own
definitions, and the pkg.yml should be uniform, without target &
compiler specific details.
What do others think? If people are +1 on this, let's get this changed
prior to release.
Cheers,
Sterling