Skip to content
Eric Merritt edited this page Nov 15, 2011 · 2 revisions

Building Sinan from Source

To build Sinan from source, start with the Makefile in the root of the Sinan project. This is the central point around which building and developing Sinan revolves. Unfortunately, Sinan can not actually build itself directly due to the lack of sandboxing support in the Erlang code loading subsystem. The purpose of the Makefile based bootstraping in the Sinan project is to get around that limitation. The Makefile builds sinan directly via erlc then uses that newly built version of Sinan to build itself.

To get started building Sinan from source we need to have a few dependencies in place.

Dependencies

The versions of these OTPApplications that are required are detailed in the sinan.config located in the top level of the sinan project. If no version is specified there then any version will do quite well.

Building the System

Make sure you are in the root of the system. Then run the following command:

$> make build

This command does a couple of things. First it builds the source and tests in project directly using erlc. It then uses the newly built version of Sinan to build itself. This is a pretty standard approach to compiler construction and one that is heavily used in Sinan. In fact, every single one of the subsequent commands we will be showing you builds sinan in this way first, before running the actual requested command. That command is actually run by the newly built Sinan in every case.

Assuming everything built correctly you are ready to move on to the next step.

Testing The System

There are four different kinds of tests in Sinan that serve three different purposes. All four sets of tests must pass for for the built version of Sinan to be considered stable. These are the eunit based unit tests, the cucumberl based BDD tests, the proper based Property Oriented Tests and the python/pexpect based integration tests. To run these tests enter the following commands on the command line.

$> make eunit
$> make cucumber
$> make proper
$> make smoketests

The smoke tests have a lot of output. Its actually easier to see failures if you pipe standard out into /dev/null and then look for errors from standard error as follows:

$> make smoketests > /dev/null

With this command all errors in the smoketest should be immediately obvious.

Assuming all of these tests pass you are ready to move on to packaging.

Packaging Sinan as an Escript

As with everything else you can package sinan simply by running the following command:

$> make escript

This will run Sinan's escript task on Sinan itself producing a 'sinan' escript. The location of the escript will be printed as the last line of output after you run the command.