| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
In the unlucky event where the cache gets deleted after the os.path.exists()
check but before we get its mtime things would error out.
Instead of using os.path.exists() handle the exceptions of the operations
which we expect to possibly fail.
|
|
|
|
| |
This is apparently used in Gee-0.8 and Folks-0.6.
|
|
|
|
|
| |
This may have been a leftover from Python 2. Exception('message') does
not automatically set a message attribute on the exception object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On macOS we ideally want to write the final absolute path of the library
into the gir and typelib. Up until now we inferred the install path from
the .la file in case we used libtool and through otool in case we weren't
using libtool hoping that the install_name was matching the install path.
meson currently sets the install_name of libraries to "@rpath/foo.dylib"
and adds rpaths to the executables in the build dir. Only during install does
it change the install_name to the absolute target path in all places.
Since we get called during build time we only get the @rpath from otool,
which then makes things fail at runtime since the executables don't have
the matching rpath set.
To make this somewhat work just fall back to the basename for relative
paths, so we dlopen "foo.dylib" and depend on things being in /usr/local/lib
or DYLD_FALLBACK_LIBRARY_PATH including the lib path (see man dlopen)
|
|
|
|
|
|
|
|
|
| |
The original customize_compiler() calls into _osx_support.customize_compiler()
the first time it is used and I didn't copy it in !118 because it is private API.
Issue #268 points out that the macOS build is broken now so I guess that was important
in some way. Make sure the setup code is run by calling the original customize_compiler()
with a dummy compiler instance.
|
|
|
|
|
|
| |
This reverts commit f606183a010fbec4382acb728882cc0eddbaf7f7.
See https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/9#note_409979
|
|
|
|
| |
This makes the scanner consistent with the docs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
> Certain types like GIConv and GdkAtom are pointers internally but don't
> look like pointers when referenced. They have the form.
>
> typedef struct _X *X;
>
> Parse these as structures/records but mark them in the gir with a 'disguised'
> attribute so that we know that they need special handling.
Additionally, stop relaying on disguised attribute when deciding whether
to render a page. Check number of fields instead, so as to avoid
introducing large regression in the docs.
Fixes #101.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
network-manager is calling things like this during configure:
g-ir-scanner --namespace=test --library=c /dev/null --output /dev/null
to test if the scanner is working. This results in a fatal error, but
beause of #229 was ignored.
Do keep this working after we fix #229 downgrade this to a simple recoverable
error message. An empty namespace doesn't prevent the scanner from creating
a .gir file so this should be fine.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
The scanner matches gtk-doc sections which match the lower case type name
to the type and uses that for the type documentation. The only problem is
it only takes the docs and none of the other annotations like deprecation
info etc.
This changes things to also parse the annotations in that case and adds some
tests while at it.
|
|
|
|
| |
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
|