Sinan documentation effort and a request

118 views
Skip to first unread message

Eric Merritt

unread,
May 3, 2012, 9:24:20 PM5/3/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
Guys,

We are undertaking an effort to do a better job of documenting sinan.
There are two big ways you can help. The first is to respond here and
let us know what specifically you would like to see documented. I
would also like to hear about what specifically you had problems with
when you where getting up to speed on the language.

The second thing is, for those of you willing to put in a bit of
effort, is a write up of how you use sinan. Some real world examples
would go a long way.

Thanks to all,

Eric

s.schaef...@gmail.com

unread,
Jun 14, 2012, 8:25:51 AM6/14/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com

The question I have about sinan is how to use it with published components that use rebar.  I'm ignorant of both, but it looks like rebar projects come with a Makefile, and one uses such a project by going to the top level directory and running "make" - at which point arbitrarily complex things happen but the result is all the sources and binaries you need.

What is the process for incorporating such a project into a sinan project?  E.g., suppose I wanted to use sinan to build something with cowboy, which uses rebar.  Do I just point sinan at the cowbory repository and then "sinan build" just works?  Or do I need to look at the cowboy Makefile and rebar stuff and tell sinan about them (recurse for all dependencies)?

If this question makes stupid assumptions, the documentation should address those.  Assume the reader knows nothing about rebar.  sinan can't achieve World Domination by requiring that one understand rebar first :-).

    - Stephen
 

Eric Merritt

unread,
Jun 14, 2012, 9:50:18 AM6/14/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
>
>
> The question I have about sinan is how to use it with published components
> that use rebar.  I'm ignorant of both, but it looks like rebar projects come
> with a Makefile, and one uses such a project by going to the top level
> directory and running "make" - at which point arbitrarily complex things
> happen but the result is all the sources and binaries you need.
>
> What is the process for incorporating such a project into a sinan project?
> E.g., suppose I wanted to use sinan to build something with cowboy, which
> uses rebar.  Do I just point sinan at the cowbory repository and then "sinan
> build" just works?  Or do I need to look at the cowboy Makefile and rebar
> stuff and tell sinan about them (recurse for all dependencies)?

As long as the dependencies have been pull sinan should be able to
build the project. The one thing sinan wont be able to do though is
fetch the dependencies.

So theoretically, you should just be able to go to the project and run
sinan build and things will work. If the deps have not been fetched
then you would need to do rebar get-deps and sinan build. The deps
thing should be solved soonish though.


> If this question makes stupid assumptions, the documentation should address
> those.  Assume the reader knows nothing about rebar.  sinan can't achieve
> World Domination by requiring that one understand rebar first :-).
>
>     - Stephen
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "erlware-questions" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/erlware-questions/-/HN4gmp9PLlUJ.
> To post to this group, send email to erlware-...@googlegroups.com.
> To unsubscribe from this group, send email to
> erlware-questi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/erlware-questions?hl=en.

s.schaef...@gmail.com

unread,
Jun 16, 2012, 7:36:33 PM6/16/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com

On Thursday, June 14, 2012 9:50:18 AM UTC-4, Eric Merritt wrote:

As long as the dependencies have been pull sinan should be able to
build the project. The one thing sinan wont be able to do though is
fetch the dependencies.

So theoretically, you should just be able to go to the project and run
sinan build and things will work. If the deps have not been fetched
then you would need to do rebar get-deps and sinan build. The deps
thing should be solved soonish though.

I just got cloned https://github.com/tsloughter/bcmvc/ and in its top directory ran sinan 4.1.1

bash-4.2$ sinan build
It looks like we couldn't satisfy all the dependency constraints We are going to search the space to see what the problem is but this could take a while
Unable to resolve compile time dependencies, probably due to the following constraints:
constraint on bcmvc_web with constraints [{bcmvc_web,"0.1.0"}] originating from these application(s) ['__top_level__'] constraint on bcmvc_db with constraints [{bcmvc_db,"0.1.0"}] originating from these application(s) ['__top_level__'] constraint on bcmvc_models with constraints [{bcmvc_models,"0.1.0"}] originating from these application(s) ['__top_level__']
bash-4.2$

I expected it to complain about the absence of cowboy, but these are all present.  I tried copying cowboy into the lib directory, and a "make" in the top of cowboy claimed to succeed, but the result was that "sinan build" just added cowboy to the list of constraints it couldn't satisfy.

    - Stephen


s.schaef...@gmail.com

unread,
Jun 16, 2012, 10:52:48 PM6/16/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com


On Saturday, June 16, 2012 7:36:33 PM UTC-4, s.schaef...@gmail.com wrote:

On Thursday, June 14, 2012 9:50:18 AM UTC-4, Eric Merritt wrote:

As long as the dependencies have been pull sinan should be able to
build the project. The one thing sinan wont be able to do though is
fetch the dependencies.

So theoretically, you should just be able to go to the project and run
sinan build and things will work. If the deps have not been fetched
then you would need to do rebar get-deps and sinan build. The deps
thing should be solved soonish though.

I just got cloned https://github.com/tsloughter/bcmvc/ and in its top directory ran sinan 4.1.1

bash-4.2$ sinan build
It looks like we couldn't satisfy all the dependency constraints We are going to search the space to see what the problem is but this could take a while
Unable to resolve compile time dependencies, probably due to the following constraints:
constraint on bcmvc_web with constraints [{bcmvc_web,"0.1.0"}] originating from these application(s) ['__top_level__'] constraint on bcmvc_db with constraints [{bcmvc_db,"0.1.0"}] originating from these application(s) ['__top_level__'] constraint on bcmvc_models with constraints [{bcmvc_models,"0.1.0"}] originating from these application(s) ['__top_level__']
bash-4.2$


OK, I'm closer now.  I did a "sinan gen" and named all the applications I knew would be included, then started copying in the files one at a time until "sinan build" started failing.  So now I'm in dependency purgatory - not dependency hell, since I haven't yet encountered mutually exclusive dependencies.  One by one I copy the dependent applications into the lib directory.

jiffy is giving me fits - although "make" within my git clone of proper exits success, "sinan build" says jiffy_tests can't find "proper/include/proper.hrl" regardless of what I put in the ERL_LIBS environment variable or $HOME/.erlang

Not your problem.


Eric Merritt

unread,
Jun 18, 2012, 2:24:16 PM6/18/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
You need the proper dependency. and whoever built jiffy_tests didn't
specify any dependency on proper at all so sinan doesn't know to warn
you that you don't have it.
> --
> You received this message because you are subscribed to the Google Groups
> "erlware-questions" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/erlware-questions/-/AK0TQpZxbDQJ.

Bill Zajac

unread,
Aug 15, 2012, 2:36:40 PM8/15/12
to erlwa...@googlegroups.com, erlware-...@googlegroups.com
I am trying to build something with a cowboy 0.6.0 dependency. I have cowboy in lib/cowboy, but it apparently has a dependency on proper 1.0. I have run rebar -C rebar.tests.config get-deps, and I have moved lib/cowboy/deps/proper to lib/proper, but I am still seeing the following error.

Unable to find include "proper/include/proper.hrl" when processing module: dispatcher_prop

I have also tried adding the following to my sinan.config
{dep_constraints,
[{lager, "1.0.0"},
{syslog, "0.0.1"},
{lager_syslog, "0.9.0"},
{proper, "1.0"},
{cowboy, "0.6.0"},
{flake, "0.7"},
{mochiweb, "2.3.2"},
{work_queue, "0.1.0"}]}.

I have also tried adding proper to applications in: lib/cowboy/src/cowboy.app.src

Am I missing something?

Here is some more output:
sinan -vvv build
starting: depends
Using the following lib directories to resolve dependencies:


/home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib
/usr/lib/erlang/lib

compile time dependencies:

work_queue 0.1.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/work_queue-0.1.0
mochiweb 2.3.2 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/mochiweb-2.3.2
flake 0.7 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/flake-0.7
cowboy 0.6.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/cowboy-0.6.0
proper 1.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/proper-1.0
lager_syslog 0.9.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/lager_syslog-0.9.0
syslog 0.0.1 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/syslog-0.0.1
lager 1.0.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/lager-1.0.0

runtime dependencies:

kernel 2.15.1 : /usr/lib/erlang/lib/kernel-2.15.1
stdlib 1.18.1 : /usr/lib/erlang/lib/stdlib-1.18.1
crypto 2.1 : /usr/lib/erlang/lib/crypto-2.1
syntax_tools 1.6.8 : /usr/lib/erlang/lib/syntax_tools-1.6.8
compiler 4.8.1 : /usr/lib/erlang/lib/compiler-4.8.1
xmerl 1.3.1 : /usr/lib/erlang/lib/xmerl-1.3.1
public_key 0.15 : /usr/lib/erlang/lib/public_key-0.15
ssl 5.0.1 : /usr/lib/erlang/lib/ssl-5.0.1
inets 5.9 : /usr/lib/erlang/lib/inets-5.9

project applications:

lager 1.0.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/lager-1.0.0
work_queue 0.1.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/work_queue-0.1.0
cowboy 0.6.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/cowboy-0.6.0
flake 0.7 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/flake-0.7
mochiweb 2.3.2 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/mochiweb-2.3.2
proper 1.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/proper-1.0
syslog 0.0.1 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/syslog-0.0.1
lager_syslog 0.9.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/lager_syslog-0.9.0
cellophane 0.1.0 : /home/wilzajac/cellophane.sinan/cellophane/_build/cellophane/lib/cellophane-0.1.0
starting: build
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake_app.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake_server.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/persistent_timer.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake_util.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake_sup.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake_harness.erl
Building /home/wilzajac/cellophane.sinan/cellophane/lib/flake/src/flake.erl
Unable to find include "proper/include/proper.hrl" when processing module: dispatcher_prop

Thanks in advance,
Bill

Eric Merritt

unread,
Aug 20, 2012, 10:26:44 AM8/20/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
On Wed, Aug 15, 2012 at 1:36 PM, Bill Zajac <bill...@gmail.com> wrote:
> I am trying to build something with a cowboy 0.6.0 dependency. I have cowboy in lib/cowboy, but it apparently has a dependency on proper 1.0. I have run rebar -C rebar.tests.config get-deps, and I have moved lib/cowboy/deps/proper to lib/proper, but I am still seeing the following error.

Does proper and cowboy both have the version numbers in the directory?
Unfortunately, for dependencies that is still something sinan needs.
> To view this discussion on the web visit https://groups.google.com/d/msg/erlware-questions/-/hKgzP0FJeTMJ.

Bill Zajac

unread,
Aug 20, 2012, 1:12:46 PM8/20/12
to erlwa...@googlegroups.com, erlware-...@googlegroups.com
Thanks for your help Eric,

In the build directory, yes (no version numbers in cellophane/lib though).

ls -l _build/cellophane/lib/
total 32
drwxr-xr-x 9 wilzajac users 4096 Aug 15 11:26 cowboy-0.6.0
drwxr-xr-x 4 wilzajac users 4096 Aug 15 11:22 flake-0.7
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 lager-1.0.0
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 lager_syslog-0.9.0
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 mochiweb-2.3.2
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 proper-1.0
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 syslog-0.0.1
drwxr-xr-x 3 wilzajac users 4096 Aug 15 11:21 work_queue-0.1.0

ls -l lib/
total 36
drwxr-xr-x  6 wilzajac users 4096 Aug 15 10:31 cellophane
drwxr-xr-x 10 wilzajac users 4096 Aug 15 11:25 cowboy
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 flake
drwxr-xr-x  7 wilzajac users 4096 Aug 15 10:20 lager
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 lager_syslog
drwxr-xr-x  9 wilzajac users 4096 Aug 15 10:20 mochiweb
drwxr-xr-x  9 wilzajac users 4096 Aug 15 11:25 proper
drwxr-xr-x  7 wilzajac users 4096 Aug 15 10:20 syslog
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 work_queue

I also tried this permutation:
ls -l lib/
total 36
drwxr-xr-x  6 wilzajac users 4096 Aug 15 10:31 cellophane
drwxr-xr-x 10 wilzajac users 4096 Aug 15 11:25 cowboy-0.6.0
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 flake
drwxr-xr-x  7 wilzajac users 4096 Aug 15 10:20 lager
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 lager_syslog
drwxr-xr-x  9 wilzajac users 4096 Aug 15 10:20 mochiweb
drwxr-xr-x  9 wilzajac users 4096 Aug 15 11:25 proper-1.0
drwxr-xr-x  7 wilzajac users 4096 Aug 15 10:20 syslog
drwxr-xr-x  5 wilzajac users 4096 Aug 15 10:20 work_queue

Also, I have tried the following two modifications to cowboy.app.src

grep -v "^%" lib/cowboy-0.6.0/src/cowboy.app.src

{application, cowboy, [
{description, "Small, fast, modular HTTP server."},
{vsn, "0.6.0"},
{modules, []},
{registered, [cowboy_clock, cowboy_sup]},
{applications, [
kernel,
stdlib,
proper
]},
{mod, {cowboy_app, []}},
{env, []}
]}.

AND THIS ONE

grep -v "^%" lib/cowboy-0.6.0/src/cowboy.app.src

{application, cowboy, [
{description, "Small, fast, modular HTTP server."},
{vsn, "0.6.0"},
{modules, []},
{registered, [cowboy_clock, cowboy_sup]},
{applications, [
kernel,
stdlib,
proper-1.0
]},
{mod, {cowboy_app, []}},
{env, []}
]}.


Any ideas?  I am willing to do some hackery to get this working, especially with cowboy.app.src if need be.

It seems like it might have to do with order of build (or of building the _build directory).  It looks like it is trying to build cowboy before proper.  Is there a way to specify order?  I assumed that came from parsing thru the app.src files.

Thanks again,
Bill

Eric Merrit

unread,
Aug 20, 2012, 1:46:00 PM8/20/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
Oh, Cowboy I think has an implicit dependency on proper (that is they use it but don't specify it). I may have missed this but do you have proper specified as a compile time dependency in your sinan.config?

To view this discussion on the web visit https://groups.google.com/d/msg/erlware-questions/-/AVWcLEG_NG0J.

bill...@gmail.com

unread,
Aug 22, 2012, 6:45:53 PM8/22/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
Here is my sinan.config

{project_name, cellophane}.
{project_vsn, "0.0.1"}.

{build_dir,  "_build"}.

{ignore_dirs, ["_", "."]}.

{ignore_apps, []}.
 
%% You can see what we have with: sinan depends -v
{dep_constraints,
   [{lager, "1.0.0"},
    {syslog, "0.0.1"},
    {lager_syslog, "0.9.0"},
    {proper, "1.0"},
    {cowboy, "0.6.0"},
    {flake, "0.7"},
    {mochiweb, "2.3.2"},
    {work_queue, "0.1.0"}]}.


Tim McGilchrist

unread,
Sep 5, 2012, 11:26:36 PM9/5/12
to erlwa...@googlegroups.com, erlware-...@googlegroups.com
Hi Eric,

Some things I'd like to see documented are:

 1. simple tutorial on creating a project with Sinan covering everything from generating to running the final software.
 2. how to generate an update. eg build a project, then show bumping the version number and how to switch between the 2.
 3. more in depth examples of how to use the proper, quick check, eunit and common_test options
 4. getting started instructions for people wanting to work on Sinan itself, I tried building from source and haven't had any luck getting it working so far.
 5. details on how to install sinan. Is it in any package repositories for Linux or Mac?
 6. comparison against rebar and other build tools.

That'd be a nice start, the rebar documentation seems to have been updated recently and has a bit more depth than I remember. (https://github.com/basho/rebar/wiki)

As far as writing up how I'm using sinan, I'm happy to help out with documentation tasks.

I recently did a presentation on sinan to my local Erlang user group in Sydney and there was a lot of interest but also a lot of questions that I couldn't answer. 
So I'm trying to remedy that by learning more about sinan and creating some docs myself.

Cheers,
Tim 

Bill Zajac

unread,
Sep 6, 2012, 5:32:05 PM9/6/12
to erlwa...@googlegroups.com, erlware-...@googlegroups.com
Sorry for the delayed response.  Are compile time dependencies specified in dep_constraints?  If so, then yes.
If not, can you tell me how to specify them?

Here is my sinan.config:
{project_name, cellophane}.
{project_vsn, "0.0.1"}.

{build_dir,  "_build"}.

{ignore_dirs, ["_", "."]}.

{ignore_apps, []}.

%% You can see what we have with: sinan depends -v

Eric Merrit

unread,
Sep 6, 2012, 6:49:32 PM9/6/12
to erlware-...@googlegroups.com, erlwa...@googlegroups.com
Bill,

Compile time deps are specified in the element

{compile_deps,
[…]}

Basically that looks exactly like dep_constraints but it is only used at compile time.

Eric
To view this discussion on the web visit https://groups.google.com/d/msg/erlware-questions/-/MXORBkQKVe4J.
Reply all
Reply to author
Forward
0 new messages