[buildd-tools-devel] Recent changes
Roger Leigh
rleigh at codelibre.net
Thu Mar 10 01:28:20 UTC 2011
I committed two large changes into sbuild.git today:
1) Exception handling. The build code now uses exceptions to
propagate errors, making the code somewhat cleaner and more
robust. Currently there is a set of top-level handlers in
run() functions which cascade down on failure and run all
cleanup actions. This replaces the use of a set of precisely-
ordered gotos which had to be jumped to in the correct order or
else cleanup didn't work. Now it all nests cleanly so if you
throw an exception at any point it will be trapped and trigger all
the cleanup needed as control passes back up the call stack. As
exception support is added to more of the code, any fatal error
will just throw an exception and it will trigger all the correct
cleanup actions.
2) sbuild user and privilege separation. A wrapper, sbuild-schroot,
is used to invoke schroot as the "sbuild" system user. Builds now
use the sbuild user, and all files in the build environment are
owned by sbuild:sbuild. This is the first stage of removing direct
access to the chroot by the user invoking sbuild, mainly to
eventually remove all root access to the chroot from users, for
security and preventing tampering. The rest of the job is for
another day though--it will require splitting sbuild into two parts
to run in different user and sbuild contexts, and is a much larger
job.
Changes on my current TODO list for the next day or so:
- log filtering; filter out build-specific paths e.g. replacing
/build/rleigh-dadadodo_1.04-3.1-amd64-xubcGh
with /dadadodo to reduce the noise when diffing build logs,
and to make them more readable.
- reduce path length of build dir. Can cause issues on some arches,
particularly WRT SYSV shm/sem. Since we have a random part in
/build/rleigh-dadadodo_1.04-3.1-amd64-xubcGh we could remove some
of the extra information and reduce it e.g. to
/build/dadadodo-xubcGh (or even just /build/xubcGh since the
actual dadadodo build dir is inside).
- improve SIGTERM error handling. Currently does some rather
complex stuff and does not clean up the chroot. Now we have
exception support, we can just set an abort flag in the build
object and kill dpkg-buildpackage if running, and have a
function in the build object to poll the flag and throw an
exception if set. This will make it run all the usual cleanup so
hitting ctrl-c won't require cleaning up the mess left in the
chroot with e.g. debfoster.
- more user-friendly documentation. Probably the hardest task!
Any pointers as to what's difficult when setting up and using
sbuild/schroot as a beginner would be appreciated!
- re-enable version checks after package unpack (currently parses
debian/changelog but then doesn't use the information!)
- Apt and Aptitude resolvers don't need to use Dpkg::Deps; now in
ResolverBase.
- Continue working on the db schema. My latest work is on importing
the current archive state from the InRelease file down to the sources
and packages files, all with gpg verification from archive keys
stored in the db. I'll push this onto a git branch once it's fit
for public consumption.
- Completely drop WannaBuild given that it's been in a separate
repo for some time now?
As always, comments appreciated, as are wishlist bug reports for any
feature requests.
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20110310/459dbb56/attachment.pgp>
More information about the Buildd-tools-devel
mailing list