How to test modification to a userland program (e.g., sed)?

Daniel Ebdrup Jensen debdrup at FreeBSD.org
Mon Jun 8 15:22:18 UTC 2020


On Mon, Jun 08, 2020 at 05:11:55PM +0200, Mateusz Piotrowski wrote:
>Hello hackers@,
>
>What is your preferred way to test local modifications to userland
>programs such as sed(1)?
>
>It feels like the correct way would be to create a jail, enter that
>jail, get the modified version of the src tree inside the jail and then
>run "make install check" in an appropriate subdirectory within that src
>tree (e.g., usr.sbin/sed).
>
>There must be a simpler way, not involving a jail, right?
>
>I've tried to experiment with the something along the following sequence
>of commands as well but it feels hacky and makes some of the tests fail:
>
>  export DESTDIR=/test
>  SRCTREE=/src
>  make -C $SRCTREE hierarchy
>  make -C $SRCTREE/usr.bin/sed install
>  export PATH="$DESTDIR/usr/bin:$PATH"
>  make -C $SRCTREE/usr.bin/sed check
>
>Cheers,
>Mateusz
>_______________________________________________
>freebsd-hackers at freebsd.org mailing list
>https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"

Hi Matreusz,

I think using ephemeral jails with nullfs mounts for /usr/src and /usr/obj for 
this is a perfectly valid way to test, as it gives you a clean environment.

The only improvement I can think of is to ensure that your source tree is using 
metamode [1], so that when you're rebuilding a single application, only the 
files you changed are rebuilt between each build.

If you're using zfs snapshots and clones, creating the base filesystem for the 
ephemeral jail also becomes incredibly quick.

Do let us know what you settle on, though - I'm sure there are people other than 
me, who would be interested to learn if you're doing anything that we might 
learn from. :)

Yours,
Daniel Ebdrup Jensen

[1]: https://wiki.freebsd.org/MetaMode
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20200608/ccaa53b1/attachment.sig>


More information about the freebsd-hackers mailing list