Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows binaries: possible switch from MSVC to MSYS2? #124

Open
GitMensch opened this issue Nov 9, 2022 · 9 comments
Open

Windows binaries: possible switch from MSVC to MSYS2? #124

GitMensch opened this issue Nov 9, 2022 · 9 comments

Comments

@GitMensch
Copy link
Contributor

When giving the installation a try I've seen a download of the MSVC runtime (so first installation would likely not work without internet access) and installing them took 90% of the installation time.

Is a MSVC build necessary because of the dependencies? If not I'd suggest to use MSYS2 for building the Gix-IDE binaries shipped with the installer; possibly smaller and in any case self-contained.

@mridoni
Copy link
Owner

mridoni commented Nov 10, 2022

The MSVC runtimes themselves should be quite lean and fast to download, the problem is in the MSVC build tools, that are unfortunately a real drag: it's a 1,55 GB download followed by the installation of more than 300 packages. I tried to somewhat trim the fat, but the VS installer is not really cooperative and it requires a lot of stuff even for a basic C/C++ compiler + Windows SDK setup. On the other hand, the installer only downloads and installs the build tools if an MSVC-based compiler is selected, if you only select MinGW-based ones, they are skipped.

I suppose a warning (at least) about this would be helpful.

@GitMensch
Copy link
Contributor Author

GitMensch commented Nov 10, 2022

As noted: on my test environment the gix installation together with all reading and manual downloading took quite some time - with most of this being spent in the automated download and install of the runtimes (which should only happen on the first installation, but if you manually delete Gix and those runtimes via "uninstall programs", then you should see that issue).

Note that I've did a "no compiler" install!

Concerning the build tools: you don't want that huge download but https://visualstudio.microsoft.com/visual-cpp-build-tools/ which also allow to build open source software without VS license

@mridoni
Copy link
Owner

mridoni commented Nov 10, 2022

Concerning the build tools: you don't want that huge download but https://visualstudio.microsoft.com/visual-cpp-build-tools/ which also allow to build open source software without VS license

These are the very same build tools that get installed by Gix-IDE (huge downoad and all). The small initial installer is actually the "Visual Studio Installer" (it presents iitself like this, when running it) tailored to install only the build tools (and the Windows SDK, also required).

By the way: the runtimes and the initial installer for the build tools, these are the same components used by the old Gix-IDE installer, that just embedded them instead of performing a download.

@GitMensch
Copy link
Contributor Author

I see. So what about the initial question - switching the Gix-binaries (not the compiler binaries) to be generated by GCC instead of MSVC and therefore don't need the MSVC runtimes at all?

@mridoni
Copy link
Owner

mridoni commented Nov 10, 2022

Technically it's doable, no question. The problem is that Gix-IDE is developed 99% in Visual Studio Community (and Qt Creator for the Linux-specific parts). Switching to GCC/MinGW for the distributed binaries woudln't be a problem, but this would mean distributing a different binary from the one I am usually building and testing with, and/or doing separate testing for the GCC/MinGW binaries. The MSVC runtimes would also be needed anyway if one wants to use the GixSQL runtime libraries with a MSVC-enabled version of GnuCOBOL.

Just curious: how long (more or less) did it take to download and install both runtimes on your test system? On mine (an x64 VM with Windows 10 and 4GB of RAM, on a mechanical disk) takes less than a minute in total, but since the VM host's CPU is quite fast being an i9 with 32 GB of RAM, this might skew my perception.

@GitMensch
Copy link
Contributor Author

The MSVC runtimes would also be needed anyway if one wants to use the GixSQL runtime libraries with a MSVC-enabled version of GnuCOBOL.

Sure, but who wants that? ;-)

Just curious: how long (more or less) did it take to download and install both runtimes on your test system?

Download is very fast here, took only some seconds, but the install on the test machine Win11 did took some minutes (on a fast non-VM with SSD) while the Gix-IDE part took less than one.

@mridoni
Copy link
Owner

mridoni commented Nov 10, 2022

The MSVC runtimes would also be needed anyway if one wants to use the GixSQL runtime libraries with a MSVC-enabled version of GnuCOBOL.

Sure, but who wants that? ;-)

Well, I do :-) I have built a few things on Windows that, for various reasons (services, .Net), need to interface/link with MSVC or just can be developed faster this way and in Visual Studio; I suppose I am not the only one with this need. Moreover building Gix-IDE (or even GixSQL) under MinGW is painfully slow, and that might not be a big problem when building the final distribution packages, but it surely slows down (a lot) development and testing.

I am not saying I will not be doing it but for now I would like to concentrate on adding things that are still missing in the IDE and on improving those that need some work. On the other hand it would be nice to migrate the build system to CMake and target Linux, Windows (MSVC and MinGW) with a single build file, but this will probably have to wait for the migration to Qt 6 (where CMake is the default).

Just curious: how long (more or less) did it take to download and install both runtimes on your test system?

Download is very fast here, took only some seconds, but the install on the test machine Win11 did took some minutes (on a fast non-VM with SSD) while the Gix-IDE part took less than one.

This is strange, I will check on a Windows 11 VM and see what happens

@GitMensch
Copy link
Contributor Author

Moreover building Gix-IDE (or even GixSQL) under MinGW is painfully slow, and that might not be a big problem when building the final distribution packages, but it surely slows down (a lot) development and testing.

That's something I can't reproduce :-)

  • use MSYS2 provided gcc+make
  • make an exception in your security suite for the MSYS2 directory and for your development directory
  • use make -j8 for compile

That's much faster for me than building software with Visual Studio. You may want to give that a try some day.

On the other hand it would be nice to migrate the build system to CMake and target Linux, Windows (MSVC and MinGW) with a single build file, but this will probably have to wait for the migration to Qt 6 (where CMake is the default).

If possible then please leave at least the old configure and make around, I always find it bad when getting to a "CMake-only" build environment "hey download 30-50 MB and install a tool system wide (increasing to 60-80MB) and then your're (likely) able to build this one software you want to build" (vs. "execute the distributed configure script, then run make and everything works, no need to install any of the autotools or other maintainer-programs").

@mridoni
Copy link
Owner

mridoni commented Nov 11, 2022

That's something I can't reproduce :-)

  • use MSYS2 provided gcc+make
  • make an exception in your security suite for the MSYS2 directory and for your development directory
  • use make -j8 for compile

That's much faster for me than building software with Visual Studio. You may want to give that a try some day.

Been there, done that, didn't work really well for me. Also, it's not just the build speed but the overall facilities provided by the IDE. I know this is often a point of contention, so let's agree to friendly disagree :-)

On the other hand it would be nice to migrate the build system to CMake and target Linux, Windows (MSVC and MinGW) with a single build file, but this will probably have to wait for the migration to Qt 6 (where CMake is the default).

If possible then please leave at least the old configure and make around, I always find it bad when getting to a "CMake-only" build environment "hey download 30-50 MB and install a tool system wide (increasing to 60-80MB) and then your're (likely) able to build this one software you want to build" (vs. "execute the distributed configure script, then run make and everything works, no need to install any of the autotools or other maintainer-programs").

No problem on my side, but the Makefiles (not the original .pro files from which they are derived) are actually generated by QMake and, being machine-generated, they are not really easy to maintain by hand: there is no configure script for Gix-IDE and I am not sure there ever will be one, since it is a really non-standard way to build Qt software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants