-
Notifications
You must be signed in to change notification settings - Fork 80
Attempt at updating Clang scripts #535
Attempt at updating Clang scripts #535
Conversation
Great, thank! Two thoughts:
|
It would definitely be possible, my main concern would be making sure it can reliably find the header files it needs, which as far as I know can't really be guaranteed unless they're packaged with Gtk.jl. |
yes, whatever we do more than we currently do is better. In my perspective the tests can just run under a very specific setup (i.e. ubuntu on Travis where we have control, if we want gtk header files installed). We could even default to disable the test and only enable it if there is a certain environment variable set. In the Travis script we then can set this variable so that the test is only run there. |
That sounds reasonable, unfortunately I wouldn't really be able to implement it since I don't currently have access to a Linux machine. |
Why don't you use |
Thats a very good suggestion. The "why" is probably because all this was setup in a time where BB was not a thing ;-) |
Use BinaryBuilder packages for header file locations
I have now got a mostly working version, using the BinaryBuilder.jl packages as suggested by @giordano.
$(Expr(:import, :., :., :Gtk))
$(Expr(:import, :., :., :Gtk, :GObject)) to import ..Gtk
import ..Gtk.GObject I have no idea how this is done, other than that it may be related to
Attachments ( |
… update_generator_scripts
The history was like this. First there were only the Clang scripts. Then the GI script was added, which potentially could replace all what Clang can do. Then GI did not get migrated to any of the new Julia versions since v0.4(? not exactly sure about the version.) I am not 100% sure what would be the best strategy forward. There are 2 potential possibilities:
In the long run it would certainly better to use GI.jl and use it much more extensively. GI is what should actually be used by Gtk language bindings: https://gi.readthedocs.io/en/latest/ |
I've managed to get the Clang scripts working to produce (almost) everything, including what was previously done by GI.jl. Remaining issues:
Generated files (Win7 64bit): |
Codecov Report
@@ Coverage Diff @@
## master #535 +/- ##
==========================================
- Coverage 49.94% 47.60% -2.34%
==========================================
Files 32 32
Lines 2515 2382 -133
==========================================
- Hits 1256 1134 -122
+ Misses 1259 1248 -11
Continue to review full report at Codecov.
|
Add GtkRequisition type.
The only remaining difference from the original generated files is the argument type for I have added some hard-coded values for system-dependent constants, such as path separators and module suffixes. For the time being, any duplicate method definitions in Generated files: |
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
@coloursofnoise: Thanks for working on this! If I get it right you PR currently has not yet changed the generated files. Have you tried running the tests with the newly generated files? |
I have been testing regularly on Win7 and a Debian vm, as well as manually comparing the generated files. |
@coloursofnoise I merged this. Thank you very much working on this. IMHO we still want to run the gen scripts within the tests if possible. This can be done by adding Clang as a dependency only for testing. |
Perhaps it would be a good idea to make a separate |
yes, certainly this is also a good idea. But the environment in the test folder should also include |
I took a stab at going through and semi-blindly updating the generator scripts to use the new API provided by Clang.jl.
While I'm relatively sure that it all works, from what I can tell it was originally set up to work on Linux, and I have been so far unsuccessful in running them on my Windows machine.
Issues so far (occurring in gtk_auto_gen.jl):
gtk_libpaths = ("/opt/local", "/usr/lib")
obviously neither of these paths are present on Windows, this is fixed by settingheader
to the path of your localgtk.h
file.args = read(`pkg-config --cflags gtk+-$gtk_version.0`, String)
no clue wherepkg-config
is supposed to be, I just replace this withargs = " "
.vcruntime.h
file not found":parse_header
takes an optionalincludes
argument which should be supplied with folders containing any missing header files(...)/vadefs.h
error: expected;
after top level declarator: This is where I'm stuck, it seems as though Clang is unable to properly parse some header files, despite them being the ones installed as part of the Visual Studio MSVC.It's entirely possible that I'm wrong about this and that the scripts need to be partially or completely rewritten, but if someone could test this out on another machine/OS it would be greatly appreciated.