New submission from Daniel Nunes:
Summary:
- Added newer_pairwise_group function to distutils.dep_util
- Added documentation and tests for previous function
- Added timestamp-based dependency system to build_libraries in build_clib
- Added tests for the above
build_clib is sorely missing one thing in distutils - checking outdated
dependencies when compiling. This makes it so that, when building a static c
library, all objects are always all compiled.
The function to create the static library itself does implement something of
this sort, but since all objects have been recompiled it has no practical
effect (everything still runs every time).
This is a small patch designed to fix that, with a couple of qol improvements
along the way. Two new keys were added to the build_info dictionary:
obj_deps - Allows specifying extra dependencies for each source so they can
be recognized as being newer than the object being compiled.
cflags - This just allows the user to provide an extra set of flags to the
compiler.
That is pretty much it, a simple (but important) quality of life improvement
for those of us who need to compile static libs with python.
Example:
setup(
...
libraries=[(
'examplelib',
{'sources': 'example.c',
'obj_deps': {'': 'global.h', # use an empty string to define global (for
all sources) dependencies
'example.c': 'example.h'}
}
)]
...
)
Documentation for the new function is done but there is no documentation for
build_clib itself. After submitting this I'll start working on it and will wait
to submit it until this patch is accepted/rejected (so I can know what to
include).
Thanks!
----------
components: Distutils
files: build_clib.patch
keywords: patch
messages: 286577
nosy: daniel.nunes, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: Add timestamp-based dependency system to build_clib
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file46472/build_clib.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29408>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com