On Mon, Mar 17, 2014 at 6:46 PM, ghitchens <
ghit...@gmail.com> wrote:
> I'm loving Nerves, but there's a lot of project-specific configuration which
> resides in multiple places...
Yes. You might have figured this out, but I'm replicating a typical
Buildroot setup in Nerves for two reasons: 1) to avoid confusing
myself, since I'm so used to the setup, and 2) I haven't thought much
about how to improve on it. Now that you point it out, there's clearly
replication. I didn't see much justification for it in the Buildroot
manual, but it's possible that everyone in the BR community has just
gotten used to the setup.
>
> nerves-sdk
> board
> myboard/.... (really, settings here are likely different for different
> projects, even on the same board -- i.e different busybox applets)
> configs
> myconfig (really, a project configuration, since I need a different one
> for different projects even on same board)
Right. Board and configs are really projects. In the AG150 branch,
I've pulled some of the shared nerves configuration together in a
common directory, but it's still the same idea.
>
> And then, there's my project directory, which contains configuration..
>
> my-project
> relx.config
> rebar.config
> Makefile
> syslinux.config
> ...
>
> Before building a project I need to CD into my project and source the
> nerves-sdk and then build my project, but that implies the nerves-sdk
> directory I source has already been built with the settings I need for my
> project anyway, and those have to be customized in two different places..
>
My original expectation was that users would spend almost all of their
time in the Erlang project directories and very little time in the
nerves-sdk directory. At one point, I was even hoping that we could
put together a binary SDK so that people could download it and be
immediately productive. I still think that we'll eventually spend most
of our time in the Erlang project directory, since my past C projects
have been set up similarly and it's happened there. My experience has
been that Buildroot is great for integrating the whole project, but
day-to-day development is just way too slow to be productive building
in tree.
Regarding the configuration, it bugs me that it's easy to have
multiple nerves-sdk repos checked out with different build parameters
and accidentally use the wrong one when building an Erlang project.
I'm looking for help on this one, but if nothing comes up, I might
export an environment variable so that Erlang projects could check the
Buildroot .config that was used.
> I'm finding I keep multiple nerves checkouts around each with a custom git
> branch and "board" and "configs" configuration areas for my project, and
> then source that before building my project directory. Maybe it can't be
> helped, just wondering if that's the way you're thinking it should be
> used..
The typical Buildroot setup is a fork of the upstream repository. I
used the new BR2_EXTERNAL mechanism so that I didn't have to fork
upstream Buildroot, and I know that others are doing it this way as
well. I like it better. It feels like the Nerves SDK has a similar
issue in that right now you have to fork nerves-sdk project to
customize it ("is-a" relationship), but it might be nicer if you could
have a "has-a" relation. You may be in a better position than me to
figure this out, since my projects are tightly coupled to the SDK.
> I guess the one concrete suggestion I might have is that it might be better
> to merge the configs and board areas together, since in practice both need
> to be customized for any nontrivial project, even if it's on the same board
> as another project.
That makes sense and to rename the directory as "projects" or
something like that.
I've been moving files around with the x86 board support updates so
I'm not sure if I could handle many changes now, but maybe after that.
Frank