13.02.2013 Views

2 Debian Code Search: An Overview

2 Debian Code Search: An Overview

2 Debian Code Search: An Overview

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 <strong>Search</strong> result quality<br />

4.8 Auto-generated source code<br />

There are several open-source projects 11 which include automatically generated source code<br />

to a varying degree.<br />

One example is XCB, the X11 C Bindings 12 . The project consists of an XML protocol<br />

description of the wire-level X11 protocol (xcb-proto) and a script to generate the X11 C<br />

Bindings themselves (c_client.py).<br />

Where the very old libX11 contains a lot of old hand-written code, XCB wants to simplify<br />

maintenance of such code by keeping the protocol description in an XML file.<br />

Having a separate description from the code generator is also beneficial since it allows for<br />

X11 bindings for other programming languages to be generated rather easily. <strong>An</strong> example is<br />

xpyb, the X Python Binding.<br />

The problem with automatically generated source code is that it cannot be indexed by<br />

<strong>Debian</strong> <strong>Code</strong> <strong>Search</strong> for multiple reasons:<br />

• Running third-party code is a potential security risk. This is mitigated by the code<br />

being uploaded only by trusted <strong>Debian</strong> Developers, but nevertheless it might make<br />

<strong>Debian</strong> <strong>Code</strong> <strong>Search</strong> unstable.<br />

• Running code before indexing makes the indexing process slow.<br />

• Running code requires the dependencies to be present, which can be solved by installing<br />

the dependencies and running the code in a chroot-environment 13 , but that requires a<br />

lot more resources than simply indexing files.<br />

On the other hand, automatically generated source code is often, and certainly in the case<br />

of XCB, not very valuable to read. This is similar to how the generated assembler code of any<br />

advanced C compiler is likely to not be easy to read. The unavailability of auto-generated<br />

code in <strong>Debian</strong> <strong>Code</strong> <strong>Search</strong> is thus not a very big loss, but undesirable nevertheless.<br />

<strong>An</strong> acceptable workaround for open-source projects might be to include a pre-generated<br />

version (if feasible) in their releases.<br />

11 Undoubtedly also closed-source projects, but that’s out of scope for this work.<br />

12 http://xcb.freedesktop.org/<br />

13 see pbuilder<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!