| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Provide partial support for multi-dimensional arrays by representing
them as flattened one dimensional array with size that is equal to
product of sizes in each dimension. Previously only the first dimension
would be actually used.
This should be sufficient to ensure that those fields have layout
compatible with C, without using nested array types that are currently
unsupported by vapigen
Issue #255.
|
|
|
|
|
|
|
|
| |
This also reverts workaround introduced to support this use case in
f77cfc4275b1fba4f9fedea6e40b00e0ebbe142c, since it is no longer
necessary.
Fixes issue #141.
|
|
|
|
|
|
|
|
|
|
| |
Neither `_create_source_type` nor `_create_complete_source_type`
actually support fixed size arrays, so previously generated C types were
incorrect.
Remove C types from array fields instead of producing incorrect ones.
Fixes issue #145.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is necessary to parse types like `unsigned char` or `long double`,
and is already done when parsing `declarations_specifiers`. Examples
that are fixed by this change include:
* `GLib.TestLogMsg.nums` previously parsed as `long` but should be `long
double`.
* `GMime.Encoding.uubuf` previously parsed as `unsigned` but should be
`unsigned char`.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Otherwise when you set CC=clang then distuils will still use gcc for linking.
While it seems we don't invoke the link command atm this shouldn't hurt.
The upstream customize_compiler() does the same thing on macOS and there is a bug
for enabling it everywhere: https://bugs.python.org/issue24935
|
|
|
|
|
|
|
| |
The position attributes on a <doc> element are not mandatory, so we
should have some fallback value if they are missing.
Fixes: #252
|
|
|
|
|
|
|
| |
Only use flags provided by env vars from the user and never from the
Python sysconfig. The sysconfig values depend on the way Python was built,
might conflict when using g-i with a different compiler and can't be controlled
by the g-i user.
|
|
|
|
|
|
|
|
| |
So we have more control over it.
This also removes all macOS specific bits from it because I'm not sure if they are
needed and they depend in internal API. This means this change can cause functional
changes. Please report if you hit any!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
No functional changes intended.
Tests check that:
* Compiler is obtained from CC.
* cc is used as the default compiler.
Currently not true as a Python build time compiler is used as the default.
* Preprocessor is obtained from CC when CPP is unspecified by adding -E.
* Preprocessor is obtained from CPP.
* cpp is used as the default preprocessor.
Currently not true as Python build time preprocessor is used as the default.
* Shell word splitting rules are used to split CC.
* Shell word splitting rules are used to split CPP.
* Deprecation warnings are disabled during compilation.
* Preprocessing step includes CPPFLAGS.
* Compilation step includes both CFLAGS and CPPFLAGS, in that order.
* Macros from CFLAGS are defined only once.
Currently not true as they are defined twice.
* Flags that would retain macros after preprocessing step are filtered out.
Currently only partially true as they aren't filtered out from CPPFLAGS.
* Preprocessing step includes flag that preserves comments.
* Preprocessing step includes current working directory.
* Complete preprocessing command doesn't contain anything unexpected.
Currently not true as Python build time CPPFLAGS are included as well.
* Complete build command doesn't contain anything unexpected.
Currently not true as Python build time CFLAGS and CPPFLAGS are included as well.
|
|
|
|
|
|
|
|
|
| |
With !45 special casing of bool in the lexer was removed which previously allowed the usage of
bool without including stdbool.h. This breaks scanning of graphene headers
which guarded the stdbool include with __GI_SCANNER__ (I haven't figured out why).
Add back the special handling for bool in the lexer and also map it to gboolean like
_Bool as if stdbool.h was included.
|
|
|
|
|
| |
The headerid extension no longer exists in 3.x. Use the toc extension instead.
The toc_depth option was only added in 3.x so still try headerid first.
|
|
|
|
|
|
|
|
| |
This enables various compiler warnings project wide and disables the triggered
ones for each library/executable. This should give us roughly the same behaviour
as with autotools.
Tested with gcc8 and clang7.
|
|
|
|
|
| |
Like we currently do with autotools.
See https://github.com/mesonbuild/meson/issues/4117
|
|
|
|
|
|
| |
This requires a code change in codegen.py to support the case whre output files
are not installed in the working directory. Instead of using the output
path for the header include use the relative path to the output source file.
|
|
|
|
|
| |
Add a simple test using the docwriter so we trigger the docwriter related
Python imports.
|
|
|
|
|
|
|
|
|
|
| |
When using `GI_SCANNER_DEBUG=save-temps`, the temporary input file
to be preprocessed and temporary output file that is result of this
preprocessing are retained for debugging purposes. Use together with
`-v` option to actually determine names of those temporary files.
This should make it easier to determine the source of parsing errors,
like those described in the #247.
|
|\
| |
| |
| |
| |
| |
| | |
sourcescanner: Allow empty declarations. Fixes #216
Closes #216
See merge request GNOME/gobject-introspection!89
|
| |
| |
| |
| |
| | |
As far as I see these are not valid C and only allowed in C++11.
But they do occur in the wild (mingw headers) so let's try to handle them.
|
|/
|
|
| |
Reduce total number of memory allocations and increase data locality.
|
| |
|
|\
| |
| |
| |
| | |
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.
|
|/
|
|
|
| |
pickle.loads() can pretty much throw any kind of exception and we can't
handle it besides ignoring it, so just catch all.
|
|\
| |
| |
| |
| | |
gi_source_scanner_parse_file: use a filename instead of a FILE struct
See merge request GNOME/gobject-introspection!79
|
| |
| |
| |
| |
| |
| | |
This allows us to get rid of the msvc hacks which are needed in case Python
is built with a different msvc than g-i. By passing a filename the FILE struct never
passes over library boundaries.
|
|\ \
| |/
|/|
| |
| | |
scanner: Replace use of typeof with void token
See merge request GNOME/gobject-introspection!78
|
| |
| |
| |
| |
| |
| | |
This makes it possible to parse inputs where typeof is used as part of
cast expression, e.g., in g_object_ref macro expansion. Selection of
VOID is arbitrary since there is no actual implementation of typeof.
|
|/
|
|
|
|
|
| |
... When we are building in a drive that is different from the drive
that we are acquiring the depedencies from. For example,
os.path.relpath() does not like it when we we are building G-I on D:\foo
while the GLib headers are found are C:\glib.
|
|
|
|
|
|
|
|
|
|
|
| |
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-ir-scanner would cut away the 'common prefix' between the current
working directory and the file about be warned about. This is
problematic when using automatic jumping to warnings and errors, as it'd
mean the editor can't find the relevant file.
For example, if g-ir-scanner is run from 'build/', and a warning occurs
on a file in 'src/file.c', the scanner would print the warning
'src/file.c:123: Warning: This and that'. Running this from e.g. meson
would mean e.g. VIM would not find the correct file to jump to.
Meanwhile, GCC, in the same setup, would print '../src/file.c:123:
Warning: ...', as that is the relative path from where the scanner is
ran, and e.g. VIM would behave in a correct way.
|
| |
|
|
|
|
|
| |
This makes it easier to ensure that the right library is
scanned.
|
|
|
|
|
| |
Without this, it will probably take the system library instead of the
one that we are trying to test.
|
|
|
|
|
|
|
| |
GLib 2.57.2 introduced __typeof__ in g_clear_pointer, which the scanner
failed to parse.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/328
|
|
|
|
|
| |
Disables the new "W504 line break after binary operator" warning.
Fixes wrong escape sequences "W605 invalid escape sequence '\.'"
|
|
|
|
|
|
|
|
|
| |
Configure option gir_dir_prefix is used to configure install dir for
.gir files, so add its value to include file search paths.
Fix for flake8 and meson-test at same time.
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
|
|
|
|
|
|
|
| |
Unfortunately, this is still needed for Visual Studio versions that do
not have an official CPython release that uses the CRT which the
compiler targets to, such as Visual Studio 2012 and 2013
This reverts commit a6a479af1bbe7c0d17766f1408c9fcb720df78dc.
|
|
|
|
|
|
|
|
|
|
|
| |
We need those includes and defines as we need to revert the commit that
revert the hacks on Windows, as they are still necessary in the cases
where we are using a Python installation that is not linked to the CRT
that the currently used compiler targets to, such as on Visual Studio
2012 and 2013, where no official Python release is linked to their
respective CRTs.
This reverts commit e36350e3fdcb18a21089256b63298d6e3a49212b.
|
|
|
|
|
|
| |
This reverts a small part of 19c03a46b1 to make tests pass again.
The test error weren't noticed because a new Python dependency was
missing, leading to those tests getting skipped.
|
|
|
|
|
| |
In 7f67146d8254 the FORMAT list was extended but the argparser uses
the first item as default value. This broke distcheck.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|