Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Oct 2011 15:43:16 +0400
From:      Dmitry Marakasov <amdmi3@amdmi3.ru>
To:        Fernando =?utf-8?Q?Apestegu=C3=ADa?= <fernando.apesteguia@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Setting up environment for development/testing
Message-ID:  <20111001114316.GF41897@hades.panopticon>
In-Reply-To: <CAGwOe2bdi=CjmFJcttP5emN4mx9NvM94Mo6F%2BJ7mhAjyDTUuSg@mail.gmail.com>
References:  <CAGwOe2bdi=CjmFJcttP5emN4mx9NvM94Mo6F%2BJ7mhAjyDTUuSg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Fernando Apestegu=C3=ADa (fernando.apesteguia@gmail.com) wrote:

> Could anyone give me some hints on how to set up an environment to
> develop and test new ports? I see some people use tinderbox. Are
> tinderbox's jails the best way to write and test ports?

Of tools which are is available, tinderbox is likely the best.

> What are the alternatives?

`port test` (from ports-mgmt/porttools), or custom chroot, for
example, but these are not really an alternatives as they can't
test everything that tinderbox does.

> Would be enough to have a fresh freebsd installation on a virtual
> machine or is it better to prepare a chroot?

After you make a port work for you on your machine, there's still
a list of thinks to check:

- dependency list (i.e. *DEPENDS doesn't miss anything the port
  requires to build)
- plist completeness and clean deinstall (a port does not leave
  files after deinstallation and it doesn't delete/overwrite other
  ports' or system files)
- the port builds on different FreeBSD versions and, if possible,
  architectures

First two things can only be reliably checked in a clean enviromenent.
For example, if you test a port with `port test` on your development
machine, its dependency list may be incomplete, but it will still
build and install fine, as you may have installed a port it requires
before. The same may happen in a chroot or VM, unless you clean (or
recreate) it before each build, which implies either rebuilding all
dependencies from scratch, or maintaining up-to-date package set,
which is quite inconvenient to do by hand.

Tinderbox does everything for you:
- it maintains up to date packages set, rebuilding stuff only when
  it's needed (e.g when dependency port is updated)
- it makes clean environement for you by creating fresh chroot from
  an image for each build and filling it with required packages
- it checks filesystem state so you'll know if plist is incomplete
- it manages multiple chroots with different FreeBSD versions, so
  on 8.x host you can test your port for both 7.x and 8.x. For me,
  even 9.x on 8.x host have worked most of the time.
- with some hacks, you can even test different architecture, e.g.
  i386 on amd64 host.
- queue into which you can stick as many ports as you need and left
  it unattended until everything is built
- web interface from which you can check status of your ports, and=20
  examine build logs
- as a side effect, you have recent package set you may use to
  install software on your FreeBSD machines

--=20
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111001114316.GF41897>