| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
By default LD_LIBRARY_PATH is set to the list of target library paths;
this breaks down in cross-compilation environment, as we need to run a
native emulation wrapper rather than the target binary itself. This patch
allows exporting those paths to a different environment variable
which can be picked up and used by the wrapper.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
| |
This is useful in cross-compile environments where system's ldd
command does not work on binaries built for a different architecture
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
|
|
| |
With this option, giscanner will use a wrapper executable to run
binaries it's producing, instead of running them directly. This
is useful when binaries are cross-compiled and cannot be run directly,
but they can be run using for example QEMU emulation.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
|
|
| |
os.path.commonpath() raises ValueError if the paths given to it are on different
drives.
Handle that case by giving up and add a test.
Reported here: https://github.com/msys2/MINGW-packages/pull/5258#issuecomment-485230864
|
|
|
|
|
|
|
|
| |
Instead of allowing each error level to be enabled just enable all of them
through the enable_warnings() method. This matches what the code is currently
doing (minus that one helper script) and simplifies things.
Also remove the error count, it's not used.
|
|
|
|
| |
xmlwriter.py
|
|
|
|
|
| |
To make it easier to test make sure it always returns absolute paths.
Also fix a typo, oops!
|
|
|
|
|
|
| |
While scannermain checks that at least one filename is given, it filters
them based on the file extension after that, so we still need to handle
an empty file list laster on.
|
|
|
|
|
|
|
|
|
|
|
|
| |
commonprefix doesn't work on relative paths and doesn't return directories so
so for the g-i build case it returned an empty string resulting in paths
relative to the working directory, making the build not reproducible.
To somehwat improve this make sure the paths are absolute, use commonpath
and if no common dir can be found just fall back to passing all directories
so we only write the basenames.
I guess we should look into passing --sources-top-dirs in the g-i build.
|
|\
| |
| |
| |
| | |
Drop all Python 2 compat code
See merge request GNOME/gobject-introspection!85
|
| |
| |
| |
| | |
We only support 3.4+ now.
|
|/
|
|
|
|
|
|
|
|
|
| |
It just printed errors to stderr and always returns success even if parsing
fails. This prevents us to write any tests for it.
As a first step collect all lexing/parsing error messages and print them to stderr after
the scanner is done. This allows us to add some regression tests for !78.
In the future we probably want to raise an exception with those errors if parsing
fails.
|
|
|
|
|
|
|
|
|
|
|
| |
Some documentation tool (as hotdoc[0]) need to have information about
symbol declaration and documentation positions in the source files
to be able to do smart indexing (automatically build the documenation
index).
[0] https://hotdoc.github.io/
Fixes #175
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
g-i includes an old version of pep8 and pyflakes and uses that
during "make check".
It (1) doesn't catch all cases newer versions of pycodestyle/pyflakes catch
and (2) doesn't test all Python files (3) doesn't work with meson.
Instead of updating just remove them and depend on flake8 instead.
To run the checks simply run flake8 in the root dir.
This also makes it possible to run those checks when using meson and
not autotools.
To not get test suite failures on flake8 updates move the checks from
"make check" to an extra "make check.quality" target.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Functional changes:
* Consistently check that return code from pkg-config is zero.
* Use shell word splitting rules to process pkg-config output to match
behaviour obtained by running `cc program.cc $(pkg-config --cflags ...)`.
Fixes issue #171 .
* Use user preferred encoding to process output from pkg-config on
Python 3. Python 2 behaviour defaults to using ascii encoding as before.
edit creiter: still ignore pkg-config errors by default for now as we
depend on it when glib is a subproject.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Windows
Instead of passing the filter commands to the shell, split them with the shlex module.
This gives us more control and a more similar behaviour on unix/win32 systems.
I could only find two users in Debian which just call python with some script, so
this seems safe to me.
Adjust the tests accordingly and use the running python executable to test the
functionality as we can be sure that's available on all platforms. Also add a
new test for the symbol filter commadn which wasn't tested before.
|
|\
| |
| |
| |
| | |
Show commands executed by distutils when being verbose.
See merge request GNOME/gobject-introspection!13
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Version file is generated at build time and stored as _version.py.
To support running uninstalled tools, a fallback version is included as
well. Example output of `--version` option:
```
$ for t in g-ir-{annotation-tool,scanner,doc-tool}; do $t --version; done
g-ir-annotation-tool 1.57.1
g-ir-scanner 1.57.1
g-ir-doc-tool 1.57.1
```
|
|
|
|
|
|
|
| |
This reverts commit 17323d2b966146ad19af6285e4eea4cd76bd2c7e.
This commit breaks the build of every module using g-ir-scanner with
compiler flags that are not just -I directives.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way we were parsing cflags was causing cpp_includes, cpp_defines,
cpp_undefines to always be empty because we would consume all arguments
with --cflags-begin's callback.
Now, we make a copy of the 'remaining arguments' and parse those to
populate the cflags independent of cpp_* flags that are used for
building the scanner executable.
This fixes the build when glib and friends aren't available in the
system prefix.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently the only way to get a library to link against the dumper
program is through '--link' which implies that library will be defined
in the 'libraries' field of the .gir. When using libtool, we
link against dependencies of that library as the .la defines that, but
when using --no-libtool that won't happen and the user needs to be
able to define to what other libraries the program needs to be link
against, and this is what the new --extra-library argument is about.
https://bugzilla.gnome.org/show_bug.cgi?id=774625
|
|
|
|
|
|
|
|
| |
If the file is new, set the permissions to 0644.
If the file with the name specified as --output exists, copy its
metadata onto the temporary output file.
https://bugzilla.gnome.org/show_bug.cgi?id=757442
|
|
|
|
|
|
|
| |
If the move resulted in EPERM, discard the temporary output file, but
raise the error so that the tool exits with a nonzero status.
https://bugzilla.gnome.org/show_bug.cgi?id=757442
|
|
|
|
|
|
|
| |
Decode the output of various subprocess calls assuming ascii
encoding.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace usage of the Python 2 cStringIO module with StringIO and
conditionally use io.StringIO for Python 3. This is needed to build
up a unicode version of the XML since cStringIO does not support
unicode. Add XMLWriter.get_encoded_xml() which returns a utf-8 encoded
bytes object of the XML data.
Open files for reading/writing in binary mode since we explicitly
encode and decode as utf-8.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add unicode_literals future import which turns any string literal
into a unicode string. Return unicode strings from the Python C extension
module. Force writing of annotations (g-ir-annotation-tool) to output utf8
encoded data to stdout.
This is an initial pass at following the "unicode sandwich"
model of programming (http://nedbatchelder.com/text/unipain.html)
needed for supporting Python 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
| |
Replace occurances of "%r" (repr) in format strings where the intended
behaviour is to output a quoted string "'foo'" with explicit usage
of "'%s'". This is needed to move the codebase to unicode literals
in order to upgrade to Python 3. Python 2 unicode strings are expanded
with repr formatting prefixed with a "u" as in "u'foo'" which causes
failures for various text formatting scenarios.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Use future import "print_function" and update relevant uses of print
as a function call. See: PEP 3105
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
| |
Import Python 3 compatible "true division" from the future (PEP 238).
This changes the Python 2 classic division which uses floor division
on integers to true division. Verfied we don't actually use the
division operator anywhere in the code base so this a safety for
supporting both Python 2 and 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
| |
Use absolute_import to ensure Python 3 compatibility of the code base.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
| |
Ensures files are correctly and immediately closed.
https://bugzilla.gnome.org/show_bug.cgi?id=751926
|
|
|
|
|
|
|
|
|
|
|
|
| |
Only types are stored in the cache store, so disable
the cache for reparse validate mode since it needs
access to the whole serialized tree.
This fixes a seemingly hard to debug build failure
running 'make distcheck' on source trees configured
with --enable-doctool.
https://bugzilla.gnome.org/show_bug.cgi?id=751238
|
|
|
|
|
|
|
|
|
|
| |
Add the command line flag --symbol-filter-cmd to g-ir-scanner
which allows running symbol names through a filtering shell
command. The symbol is sent as stdin to the filter command
and expects a filtered result written to stdout.
https://bugzilla.gnome.org/show_bug.cgi?id=744534
Signed-off-by: Garrett Regier <garrett.regier@riftio.com>
|
|
|
|
|
|
|
|
|
|
| |
Rather than assuming that pkg-config is spelt pkg-config, use the environment
variable $PKG_CONFIG which is the actual detected pkg-config spelling. This is
particularly important when cross-compiling, where the pkg-config may be
prefixed with the target and will actually provide a different result from the
build pkg-config which may be available unprefixed.
https://bugzilla.gnome.org/show_bug.cgi?id=746669
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds options to scannermain so that we can decorate functions with
macros as needed, so that we can use compiler annotations for symbol export
for example.
Options are also added to include headers before or after the main include
block at the top so that we can include headers as necessary in the
generated sources and/or headers, so that we could for example grab
definitions from those headers as needed, such as to grab definitions of
macros used for symbol export.
The testcodegen.py script has been updated as well to make use of this
functionality, if needed.
https://bugzilla.gnome.org/show_bug.cgi?id=732669
|
|
|
|
|
|
| |
New versions of msys2 provide a MINGW64 env variable instead.
https://bugzilla.gnome.org/show_bug.cgi?id=734163
|
|
|
|
|
|
|
|
|
| |
Add the command line flag --identifier-filter-cmd to g-ir-scanner which
allows running identifier names through a filtering shell command. The
identifier is sent as stdin to the filter command and expects a filtered
result written to stdout.
https://bugzilla.gnome.org/show_bug.cgi?706898
|
|
|
|
|
|
| |
Un-defining __BLOCKS__ disables blocks in system
headers (like stdlib.h).
This avoids errors while compiling.
|
|
|
|
|
|
|
|
|
|
| |
In this case we were considering -I and the path as two different
command line options. This was not a problem in the past (or for other
cpp flags) because they are passed directly to gcc that accepts it. Now
that we are ensuring that the include paths are always real paths, we
need to handle this case to identify include paths in the command line.
https://bugzilla.gnome.org/show_bug.cgi?id=712211
|
|
|
|
|
|
|
|
| |
Ensure we are using the real path also for cflags comming from
pkg_config files and command line options. This fixes the generation of
the gir files when include paths contain symlinks.
https://bugzilla.gnome.org/show_bug.cgi?id=712211
|
|
|
|
|
|
|
|
|
|
|
| |
giscannermodule expects file names to be canonicalized and
symlinks to be resolved (most likely to support users of
symlinked /usr/local). Instead of computing absolute and real
paths all over the place, we can do this once on entry
in SourceScanner().parse_files() and SourceScanner().parse_macros()
and clean the rest a bit...
https://bugzilla.gnome.org/show_bug.cgi?id=710320
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not yet being used but will be in the future by
annotationparser.py to signal the difference between
message.WARNING:
something is wrong but the comment block can still
be parsed and serialized back into a comment block
without information being lost
message.ERROR:
something is wrong and the comment block can *not*
be parsed and serialized back into a comment block
without information being lost
Different tools can then act accordingly. Nothing will
change for g-ir-scanner but this will be important for
the GTK-Doc comment block rewriting tool to prevent
extremely broken input leading to even more broken
output...
|
|
|
|
|
|
| |
We already have a parse_comment_block() method parsing a single
GTK-Doc comment block so it only seems natural to have a plural
parse_comment_blocks() to go along with that.
|
|
|
|
|
|
| |
Clarify the purpose of what up until now was know as the
AnnotationParser() class, as it does more than just extracting
annotations, it parses the complete GTK-Doc comment block.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Version in our tree is a wee bit outdated. For example,
later work will introduce an utf8 encoded python source
file which our old pep8.py does not yet understand (yeah,
it really was *that* ancient)...
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py
Takes 552c1f1525e37a30376790151c1ba437776682c5,
f941537d1c0a40f0906490ed160db6c79af572d3,
5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and
a17f157e19bd6792c00321c8020dca5e5a281f45 into account...
https://bugzilla.gnome.org/show_bug.cgi?id=699535
|
|
|
|
|
|
|
| |
The transformer doesn't need the annotations, so why are
we giving it to it?
https://bugzilla.gnome.org/show_bug.cgi?id=699854
|
|
|
|
|
|
|
| |
Enables us to to use a more effecient list membership test
instead of testing the end of some string multiple times.
https://bugzilla.gnome.org/show_bug.cgi?id=699533
|
|
|
|
|
|
| |
It's more readable and as an added bonus Python 3 compatible.
https://bugzilla.gnome.org/show_bug.cgi?id=697616
|