After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785802 - meson: Improvements on Windows
meson: Improvements on Windows
Status: RESOLVED FIXED
Product: atk
Classification: Platform
Component: build
git master
Other Windows
: Normal normal
: ---
Assigned To: ATK maintainer(s)
ATK maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-08-04 08:51 UTC by Fan, Chun-wei
Modified: 2017-09-13 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson: Build resource (.rc) files on Windows (2.07 KB, patch)
2017-08-04 08:54 UTC, Fan, Chun-wei
committed Details | Review
tests: Fix build on pre-C99 (2.01 KB, patch)
2017-08-04 08:56 UTC, Fan, Chun-wei
needs-work Details | Review
tests: Fix build on pre-C99 (take ii) (2.01 KB, patch)
2017-08-07 04:33 UTC, Fan, Chun-wei
committed Details | Review
meson: Force include msvc_recommended_pragmas.h on Visual Studio (1.06 KB, patch)
2017-08-09 07:56 UTC, Fan, Chun-wei
committed Details | Review
meson: Fix .rc file generation (1016 bytes, patch)
2017-09-12 04:33 UTC, Fan, Chun-wei
committed Details | Review
meson: Add option to disable introspection (1.61 KB, patch)
2017-09-12 04:34 UTC, Fan, Chun-wei
committed Details | Review

Description Fan, Chun-wei 2017-08-04 08:51:41 UTC
Hi,

As we aim to get the GTK+ stack building with Meson, there are some things that can be done to make it work better with Windows builds.

I will attach patches to address this issue shortly.

With blessings, thank you!
Comment 1 Fan, Chun-wei 2017-08-04 08:54:49 UTC
Created attachment 356923 [details] [review]
meson: Build resource (.rc) files on Windows

Hi,

The Visual Studio projects and the autotools builds on Windows build the .rc files into the ATK DLL so that people can determine its version info, so this patch is to do likewise on Meson builds.

With blessings, thank you!
Comment 2 Fan, Chun-wei 2017-08-04 08:56:04 UTC
Created attachment 356924 [details] [review]
tests: Fix build on pre-C99

Hi,

Since we didn't declare ATK is C99, fix the tests so that they will build on C99 compilers.  This is necessary for the Meson builds to complete on such compilers, such as pre-2013 Visual Studio.

With blessings, thank you!
Comment 3 Daniel Boles 2017-08-05 23:57:03 UTC
Review of attachment 356924 [details] [review]:

I think this kind of thing is safe to commit without question - or if it's not, then I'm doomed when they find me out :)

::: tests/testvalue.c
@@ +120,3 @@
                                gchar **description)
 {
+  TestValue *self;

However, afaict it is conventional to include a blank line between the end of declarations and the start of statements, to I'd say to add one here.

@@ +138,1 @@
   g_return_val_if_fail (TEST_IS_VALUE (value), NULL);

dto

@@ +192,1 @@
   g_return_if_fail (TEST_IS_VALUE (value));

dto
Comment 4 Fan, Chun-wei 2017-08-07 04:33:21 UTC
Created attachment 357080 [details] [review]
tests: Fix build on pre-C99 (take ii)

Hi Daniel,

Thanks for the notes, this is the new patch with the formatting fixes.

With blessings, thank you!
Comment 5 Alejandro Piñeiro Iglesias (IRC: infapi00) 2017-08-07 07:03:30 UTC
(In reply to Daniel Boles from comment #3)
> Review of attachment 356924 [details] [review] [review]:
> 
> I think this kind of thing is safe to commit without question - or if it's
> not, then I'm doomed when they find me out :)

With my ATK maintainer hat on: yes you can go on. I don't have too much knowledge of meson, and Chun-wei Fan has been doing a good work with his patches on the past. In any case, this got bonus points as it got a peer review from you, Daniel. Thank you very much.
Comment 6 Fan, Chun-wei 2017-08-09 07:56:24 UTC
Created attachment 357231 [details] [review]
meson: Force include msvc_recommended_pragmas.h on Visual Studio

Hi Alejandro,

Thanks, I went ahead with the two patches as:
-attachemnt 356923: ba463eb (Note that "(C)" is removed as we already have "Copyright")
-attachment 357080 [details] [review]: 125dac5

I am also attaching another patch here to the Meson build files to silence unwanted warnings and make some potentially-problematic warnings errors for Visual Studio builds, by force-including msvc_recommended_pragmas.h from GLib.  Note that this is already done in the Visual Studio projects.

With blessings, thank you!
Comment 7 Alejandro Piñeiro Iglesias (IRC: infapi00) 2017-08-09 09:06:08 UTC
(In reply to Fan, Chun-wei from comment #6)
> Created attachment 357231 [details] [review] [review]
> meson: Force include msvc_recommended_pragmas.h on Visual Studio
> 
> Hi Alejandro,
> 
> Thanks, I went ahead with the two patches as:
> -attachemnt 356923: ba463eb (Note that "(C)" is removed as we already have
> "Copyright")
> -attachment 357080 [details] [review] [review]: 125dac5

Just ~30 minutes after I made the atk 2.25.90 release. It is a pity. 

The release was already made somewhat late, and I don't have too much time for a new one. I hope you don't mind to wait until a following release to get them included.

> I am also attaching another patch here to the Meson build files to silence
> unwanted warnings and make some potentially-problematic warnings errors for
> Visual Studio builds, by force-including msvc_recommended_pragmas.h from
> GLib.  Note that this is already done in the Visual Studio projects.
> 
> With blessings, thank you!
Comment 8 Ignacio Casal Quinteiro (nacho) 2017-09-08 08:51:05 UTC
Review of attachment 357231 [details] [review]:

Looks good.
Comment 9 Ignacio Casal Quinteiro (nacho) 2017-09-08 08:51:07 UTC
Review of attachment 357231 [details] [review]:

Looks good.
Comment 10 Ignacio Casal Quinteiro (nacho) 2017-09-08 08:51:51 UTC
Another patch that we should make before we close the bug is to have a -Dwith_gir/enable_introspection parameter so we can disable the gir generation.
Comment 11 Fan, Chun-wei 2017-09-08 16:07:41 UTC
Review of attachment 357231 [details] [review]:

Hi Nacho,

Thanks, I pushed the patch as b7c2703.

With blessings, thank you!
Comment 12 Alejandro Piñeiro Iglesias (IRC: infapi00) 2017-09-11 09:03:05 UTC
Hi,

thanks for all this work improving meson build support on windows.

If you don't mind I have two questions/comments:

* I have just done atk 2.26.0 release, with the patches from this bug report already pushed. But I think that if this bug gets fixed, those patches would be safe enough to be included on a new stable release (2.26.1). What do you think?


* As I don't like the idea of maintaining two different build systems for ATK, I would like to remove the autools support for next cycle if possible. But I'm not sure if that would be a problem for Windows (fwiw, I never built ATK on windows). So, if this bug is fixed, would it be possible to remove the autotools support without affecting windows?

Again, thanks
Comment 13 Ignacio Casal Quinteiro (nacho) 2017-09-11 09:10:02 UTC
Hey Alejandro,

one thing that is missing is as I pointed out we need a way to skip introspection. Apart from that getting rid of autotools/windows projects should be possible now.

Cheers
Comment 14 Alejandro Piñeiro Iglesias (IRC: infapi00) 2017-09-11 09:24:27 UTC
(In reply to Ignacio Casal Quinteiro (nacho) from comment #13)
> Hey Alejandro,
> 
> one thing that is missing is as I pointed out we need a way to skip
> introspection. 

Well, this is the reason I said "if this bug is fixed". I was just asking if there was something else out of the scope of this bug.

> Apart from that getting rid of autotools/windows projects
> should be possible now.

Ok, thanks. In any case, being conservative, I will wait until this bug gets fixed.
Comment 15 Fan, Chun-wei 2017-09-12 04:10:39 UTC
Hi,

The Windows projects could be dropped, with the exception of the 2008 ones, which is there to support Python 2.7.x on Windows, which PyGObject still supports (until, the time we switch to use C99, like what GTK+ master is doing now, where 2013 or later is needed).  I could turn those to static projects instead of being filled in by autotools, or let me know supporting it is not desirable.

Builds will work out-of-the-box with 2010 or later.

With blessings, and cheers!
Comment 16 Fan, Chun-wei 2017-09-12 04:33:05 UTC
Created attachment 359570 [details] [review]
meson: Fix .rc file generation

Hi,

The initial .rc file generated by Meson did not fill in ATK_VERSION, so some version info of the DLL is missing from the resources.  This patch addresses this.

With blessings, thank you!
Comment 17 Fan, Chun-wei 2017-09-12 04:34:30 UTC
Created attachment 359571 [details] [review]
meson: Add option to disable introspection

Hi,

This adds an option to disable introspection, even when GObject-Introspection is found.  As in the autotools builds, this option is not activated by default.

With blessings, thank you!
Comment 18 Ignacio Casal Quinteiro (nacho) 2017-09-12 07:32:46 UTC
Review of attachment 359570 [details] [review]:

Looks good
Comment 19 Ignacio Casal Quinteiro (nacho) 2017-09-12 07:33:27 UTC
Review of attachment 359571 [details] [review]:

Looks good
Comment 20 Fan, Chun-wei 2017-09-13 15:25:00 UTC
Hi Nacho,

Thanks, I pushed the patches as:

Attachment 359570 [details]: b0bd719 (gnome-3-26), 28f3e78 (master)
Attachment 359571 [details]: 0de7044 (gnome-3-26), 271d9e4 (master)

I will close the bug shortly.

With blessings, thank you!