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 796441 - Meson Generates Erroneous MSVC Project Files For Build
Meson Generates Erroneous MSVC Project Files For Build
Status: RESOLVED NOTGNOME
Product: GStreamer
Classification: Platform
Component: orc
unspecified
Other Windows
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-29 00:26 UTC by TheFloatingBrain
Modified: 2018-05-31 23:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Working Build: https://nofile.io/f/ezMjzgryCyh/Orc428.zip (42 bytes, text/plain)
2018-05-29 00:29 UTC, TheFloatingBrain
Details
NON WORKING MESON FILES (50 bytes, text/plain)
2018-05-29 00:30 UTC, TheFloatingBrain
Details
Steps taken to generate meson files (45.34 KB, image/png)
2018-05-29 00:31 UTC, TheFloatingBrain
Details
Build with __attribute__ (44.50 KB, image/png)
2018-05-30 21:38 UTC, TheFloatingBrain
Details
Meson Log For --backend vs2017 (17.49 KB, text/plain)
2018-05-31 23:12 UTC, TheFloatingBrain
Details

Description TheFloatingBrain 2018-05-29 00:26:20 UTC
I mentioned I would post this on twitter a few days ago: https://twitter.com/TeFloatingBrain/status/1000150987678650380 I apologize for the unconventional manner of this but I am going to throw a link to the pastebin post here, it contains a list of problems and the steps I took to resolve them: https://pastebin.com/C2FzB9jm I will also attach to this my working build for static Orc-0.4.28 to this in case anyone wants to use it either for their project while the bug is resolved, or to fix the bug. One thing I did forget to mention is that #define isnan(x) _isnan(x) generates an error, but it seems to be fixed here: https://github.com/freedesktop/gstreamer-orc/commits/master
Comment 1 TheFloatingBrain 2018-05-29 00:29:30 UTC
Created attachment 372452 [details]
Working Build: https://nofile.io/f/ezMjzgryCyh/Orc428.zip
Comment 2 TheFloatingBrain 2018-05-29 00:30:35 UTC
Created attachment 372453 [details]
NON WORKING MESON FILES
Comment 3 TheFloatingBrain 2018-05-29 00:31:04 UTC
Created attachment 372454 [details]
Steps taken to generate meson files
Comment 4 Tim-Philipp Müller 2018-05-29 08:15:49 UTC
Thanks for the bug report, but what would be more useful to is if you ignored everything you did based on 0.4.28 for now and just reported what doesn't work with git master for you?
Comment 5 TheFloatingBrain 2018-05-30 18:46:42 UTC
(In reply to Tim-Philipp Müller from comment #4)
> Thanks for the bug report, but what would be more useful to is if you
> ignored everything you did based on 0.4.28 for now and just reported what
> doesn't work with git master for you?

Gotya. The static build seems to be a slight improvement. Building with --backend ninja still compiles with GCC (MinGW), and --backend MSVC the static build seems to target a .a extension. There is also the line #define ORC_API_EXPORT extern __attribute__ ((visibility ("default"))), if Im not mistaken the __attribute__ is a GCC language extension. It also is passing some GCC arguments (-fdiagnostics-color=always, -std=gnu99, -fvisibility=hidden). I replaced it with __declspec(dllexport) and everything compiled fine. It still passes the default arguments to the linker in addition to the default ones are already there. Also #define HAVE_SYS_TIME_H, #define HAVE_UNISTD_H are there which causes problems. Dynamic Builds and projects are config'd with it, and it seems to work on a couple executables I tested. Those small things aside everything seems to be working :)
Comment 6 Tim-Philipp Müller 2018-05-30 19:05:39 UTC
Are you combining mingw with --backend MSVC by any chance?

Are you running meson from within the visual studio environment cmd.exe (or set it up via vcvarsall.bat or whatever it's called?

Please attach the meson log file from the run where it creates the export define with __attribute__ etc.
Comment 7 TheFloatingBrain 2018-05-30 21:36:08 UTC
(In reply to Tim-Philipp Müller from comment #6)
> Are you combining mingw with --backend MSVC by any chance?
> 
> Are you running meson from within the visual studio environment cmd.exe (or
> set it up via vcvarsall.bat or whatever it's called?
> 
> Please attach the meson log file from the run where it creates the export
> define with __attribute__ etc.

Yes, when I build with --backend ninja it generates gcc makefiles. Im compiling from within the visual studio environment. Whats weird is it also passes MSVC flags to the linker as well as gcc flags to the compiler.
*Attaching log*
Comment 8 TheFloatingBrain 2018-05-30 21:38:43 UTC
Created attachment 372484 [details]
Build with __attribute__
Comment 9 Tim-Philipp Müller 2018-05-30 23:52:22 UTC
For future reference, when I said attach the log I meant the meson-log.txt file from the build directory, not a screenshot with dark blue text on dark blue background :)

But in any case, I don't think this can be expected to work. You need to run meson --backend=vs2017 with cl.exe as compiler, otherwise everything will be terribly confused, as you noticed :)

I think this is a meson bug though. It should probably not allow this.
Comment 10 Nirbheek Chauhan 2018-05-31 08:33:34 UTC
I've filed https://github.com/mesonbuild/meson/issues/3648 as the upstream bug.
Comment 11 TheFloatingBrain 2018-05-31 23:10:31 UTC
(In reply to Tim-Philipp Müller from comment #9)
> For future reference, when I said attach the log I meant the meson-log.txt
> file from the build directory, not a screenshot with dark blue text on dark
> blue background :)
> 
> But in any case, I don't think this can be expected to work. You need to run
> meson --backend=vs2017 with cl.exe as compiler, otherwise everything will be
> terribly confused, as you noticed :)
> 
> I think this is a meson bug though. It should probably not allow this.

Wups attached. :)
Comment 12 TheFloatingBrain 2018-05-31 23:12:21 UTC
Created attachment 372497 [details]
Meson Log For --backend vs2017
Comment 13 TheFloatingBrain 2018-05-31 23:12:45 UTC
(In reply to Nirbheek Chauhan from comment #10)
> I've filed https://github.com/mesonbuild/meson/issues/3648 as the upstream
> bug.

Cool beans :)