Commit Graph

19 Commits

Author SHA1 Message Date
Omar Sandoval
a7224dbc77 Fix more MANIFEST.in issues
We need to include contrib. Also improve the tools and LICENSES
patterns.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2023-01-05 19:13:19 +00:00
Omar Sandoval
05d9cb58eb Fix MANIFEST.in warning for LICENSES directory
We're getting this warning from setuptools:

  warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...

Fix it by adding '*'.

Fixes: b156d987d7 ("Move license to LICENSES")
Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-12-19 16:31:20 -08:00
Omar Sandoval
a0a54edc1f Create contrib directory
It's come up several times that it'd be nice to have somewhere to dump
drgn scripts that people write while debugging without requiring them to
be cleaned up and scrutinized in code review. Serapheim Dimitropoulos
noted that several projects have a "contrib" directory for this purpose.
See [1]. Let's create one, document it, exclude it from pre-commit, and
move our (mostly unmaintained) examples there.

1: https://drewdevault.com/2020/06/06/Add-a-contrib-directory.html

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-11-16 13:17:50 -08:00
Omar Sandoval
8eaf01fe83 Bring back COPYING
Some things want this file to exist (e.g., the Fedora RPM spec, GitHub;
see #221). Let's do what the Linux kernel does and provide a summary of
the licensing situation in COPYING. The REUSE FAQ [1] doesn't discourage
this.

1: https://reuse.software/faq/#tradition

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-11-02 22:57:40 -07:00
Omar Sandoval
b156d987d7 Move license to LICENSES
In preparation for having multiple licenses.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-11-01 16:57:00 -07:00
Omar Sandoval
1c0dbcd917 pre-commit: add flake8
This has been useful to run manually before, but I haven't added it to
the CI because it was somewhat noisy. But, it reports some really useful
warnings, so let's configure it for our needs and add it to pre-commit.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-05-17 15:26:41 -07:00
Omar Sandoval
6a3dcad19b tests: add framework for test kernel module
Now that commit d999703f94 ("vmtest: add kernel module build
dependencies to kernel packages") added the files necessary to build a
test kernel module, add the module (currently a stub) and the
scaffolding necessary to build and load it.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-05-16 14:27:35 -07:00
Omar Sandoval
8afa7ea6d8 Remove vmtest/config from MANIFEST.in
This was removed in commit 841a3dae88 ("Move vmtest assets to GitHub
releases").

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-05-13 16:41:33 -07:00
Omar Sandoval
549cd7facc Add tests/sample.core.zst to sdist
Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-03-03 00:29:01 -08:00
Omar Sandoval
ffcce8a745 Add a few files to source distributions
In particular, the Fedora RPM build needs pytest.ini. CONTRIBUTING.rst
should be included along the same lines as README.rst. libdrgn/Doxyfile
should be included so that users with a source distribution can build
the libdrgn documentation.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-12-08 17:24:24 -08:00
Davide Cavalca
31cbc187ce add COPYING to sdist
Signed-off-by: Davide Cavalca <dcavalca@fb.com>
2021-04-20 11:17:51 -07:00
Omar Sandoval
39f17a52b8 docs: add missing css, favicon, and logo files to sdist
Closes #96.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2021-04-02 10:30:28 -07:00
Omar Sandoval
0d64d66c80 Add examples and tools to source distribution 2020-04-27 16:53:14 -07:00
Omar Sandoval
63613d4d6a Add missing files to MANIFEST.in
The vmtest rework missed a few new files.
2020-04-03 16:45:19 -07:00
Omar Sandoval
739fe5686d vmtest: move to top-level directory 2020-03-27 17:13:44 -07:00
Omar Sandoval
1c9acb8eed Add virtual machine testing setup
Now that we have tests for kernel-specific functionality, we should run
them on various kernel versions. This adds a script for doing so using
QEMU with a pre-built root filesystem image and kernels that I'm hosting
on my Dropbox. The script can be run locally, but this also sets it up
to be run on Travis. For now, we're testing the mainline, stable, and
longterm releases from kernel.org (not including v3.16, which doesn't
even boot for me).
2019-11-22 16:54:00 -08:00
Omar Sandoval
393a1f3149 Document with Sphinx
drgn has pretty thorough in-program documentation, but it doesn't have a
nice overview or introduction to the basic concepts. This commit adds
that using Sphinx. In order to avoid documenting everything in two
places, the libdrgn bindings have their docstrings generated from the
API documentation. The alternative would be to use Sphinx's autodoc
extension, but that's not as flexible and would also require building
the extension to build the docs. The documentation for the helpers is
generated using autodoc and a small custom extension.
2019-04-11 12:48:15 -07:00
Omar Sandoval
687ea74ff2 Build Python bindings with automake
I went back and forth on using setuptools or autotools for the Python
extension, but I eventually settled on using only setuptools after
fighting to get the two to integrate well. However, setuptools is kind
of crappy; for one, it rebuilds every source file when rebuilding the
extension, which is really annoying for development. automake is a
better designed build system overall, so let's use that for the
extension. We override the build_ext command to build using autotools
and copy things where setuptools expects them.
2019-04-03 17:00:53 -07:00
Omar Sandoval
75c3679147 Rewrite drgn core in C
The current mixed Python/C implementation works well, but it has a
couple of important limitations:

- It's too slow for some common use cases, like iterating over large
  data structures.
- It can't be reused in utilities written in other languages.

This replaces the internals with a new library written in C, libdrgn. It
includes Python bindings with mostly the same public interface as
before, with some important improvements:

- Types are now represented by a single Type class rather than the messy
  polymorphism in the Python implementation.
- Qualifiers are a bitmask instead of a set of strings.
- Bit fields are not considered a separate type.
- The lvalue/rvalue terminology is replaced with reference/value.
- Structure, union, and array values are better supported.
- Function objects are supported.
- Program distinguishes between lookups of variables, constants, and
  functions.

The C rewrite is about 6x as fast as the original Python when using the
Python bindings, and about 8x when using the C API directly.

Currently, the exposed API in C is fairly conservative. In the future,
the memory reader, type index, and object index APIs will probably be
exposed for more flexibility.
2019-04-02 14:12:07 -07:00