Deployment / Static linking

Discuss anything related to product development
Post Reply
Silicomancer
Posts: 2
Joined: Mon Dec 27 2021 12:11 pm

Deployment / Static linking

Post by Silicomancer »

Qt is frustrating in many regards. This is why I am thinking about using CopperSpice for a new private project. I checked some of the problems I had with Qt (especially Qt6) and it seems CopperSpice would solve several of those issues. I'm not sure about a remaining issue: Linux deployment.

Deployment on Linux is a nightmare compared to Windows deployment, especially when using bleeding edge compilers, newest C++ standards and newest libraries (especially Qt).
Existing tools (even Qt aware tools) don't help much when creating bleeding-edge generic applications (like AppImage, snap) and/or require a lot of deep knowledge I don't have.

Are there deployment tools which support building generic CS applications (like AppImage, snap)?

The best alternative for stand-alone applications (which I used during Qt4.0.x times) is static linking. With Qt this is nasty, both technically (because no pre-built static versions are released) and legally (because statically linked applications require GPL or a license).

What about statically linked CS applications?

barbara
Posts: 300
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Deployment / Static linking

Post by barbara »

Silicomancer wrote:
Thu Dec 30 2021 11:07 pm
Deployment on Linux is a nightmare compared to Windows deployment, especially when using bleeding edge compilers, newest C++ standards and newest libraries (especially Qt).
Existing tools (even Qt aware tools) don't help much when creating bleeding-edge generic applications (like AppImage, snap) and/or require a lot of deep knowledge I don't have.
I am not sure what issues you have experienced deploying on Linux in the past, however we have found the process to be manageable. We deploy three CopperSpice applications: KitchenSink, DoxyPress, and Diamond on a Windows, OS X, and twelve different Linux/Unix platforms. If you need assistance with this process we are happy to help. We do encourage developers to build and deploy separately for each platform.
Are there deployment tools which support building generic CS applications (like AppImage, snap)?
There is actually no way to provide a generic setup since every developer would have different requirements. Like one person might want to support an older version of Ubuntu or a newer version of Arch.

If this is something you are keen to have, we do have (paid) consultants who are available as part of the our CopperSpice team.
The best alternative for stand-alone applications is static linking. What about statically linked CS applications?
Static linking does not solve every issue and actually introduces a number of other problems. We are not currently supporting static linking at this time. There are license issues, especially on OS X.

Please let us know if you have any additional questions.

Barbara

Silicomancer
Posts: 2
Joined: Mon Dec 27 2021 12:11 pm

Re: Deployment / Static linking

Post by Silicomancer »

barbara wrote:
Sat Jan 01 2022 1:54 am
I am not sure what issues you have experienced deploying on Linux in the past, however we have found the process to be manageable. We deploy three CopperSpice applications: KitchenSink, DoxyPress, and Diamond on a Windows, OS X, and twelve different Linux/Unix platforms. If you need assistance with this process we are happy to help. We do encourage developers to build and deploy separately for each platform.
Lets start with your numbers: 1 x Win, 1 x Mac, 12(!) x Linux. That is troublesome enough. For both building and testing.
I read about building standard packages and gave up. For an application programmer who doesn't know much about the insides of Linux and about Linux specific build chains, their complexity is a huge hurdle. I simply didn't had the time to dig into that matter.
And - tell me if I am wrong - standard packages can only use frameworks and libraries versions that are available on the supported distributions. That isn't a good prerequisite for using bleeding edge Qt/CS, newest C++ standard library, etc.
I want to develop and test my code with exactly one arbitrary version of each library and I want to be able to deploy it with exactly those versions. And the installation should be as safe and simple as the de-installation. I can live with the slower startup in case of snaps as well with the additional memory consumption of snaps and AppImages.
There is actually no way to provide a generic setup since every developer would have different requirements. Like one person might want to support an older version of Ubuntu or a newer version of Arch.
Well there are tools that can help. E.g. linuxdeployqt, snapcraft and appimage-builder are very interesting. I played around with appimage-builder but it turned out that it boils down to manual configuration since the recipe generator produces rubbish. linuxdeployqt (at least an older release) was pretty easy to use and did a good job in collecting the needed Qt libraries. The only pain was related to Qt plug-ins. I was able to produce an (almost) generic AppImage that included everything except C++ standard library pretty fast.
Snapcraft also is very interesting but there is no base snap newer than Ubuntu 20.04. And unfortunately it is not Qt aware.

So my question actually was: Is there a CS aware tool that can help generating AppImages or snaps for CS applications? (I guess there isn't one)

I never understood why Qt didn't deliver an easy to use tool for that purpose. Since I started using Linux (and coding on Linux) I learned that deployment is the most troublesome step for application developers that are new to that OS. It would have been a unique selling point for Qt and Qt Creator. Read the web. It is full of people having the same problem desperately looking for an easy solution.

Deployment on Windows is one day (maybe two days) of work for an absolute beginner. At least I was able to create my first fully featured generic installer for a Qt application within a single day at the very first try. That was 15 years ago. Today windows tools are even better. On Linux an average developer seems to require one day of reading only to understand how awfully many different ways of deployment there are and that none of them solves all problems :(

Even deploying a Unix (!) application on Windows (built via MSYS2) is easier than on the original OS because it so simple to build a perfectly working and generic InnoSetup based installer. I did this before and the entire porting process of a Linux application to windows (including installer creation!) required a fraction of the time I have invested in reading about Linux packaging without a satisfying result.
(I am not a specialized Windows developer, I'm a RTOS embedded developer, so my Windows know-how is comparable to my Linux know-how)
We are not currently supporting static linking at this time. There are license issues, especially on OS X.
Ok, thanks a lot for your answer.

barbara
Posts: 300
Joined: Sat Apr 04 2015 2:32 am
Contact:

Re: Deployment / Static linking

Post by barbara »

Lets start with your numbers: 1 x Win, 1 x Mac, 12(!) x Linux. That is troublesome enough. For both building and testing.
I read about building standard packages and gave up. For an application programmer who doesn't know much about the insides of Linux and about Linux specific build chains, their complexity is a huge hurdle. I simply didn't had the time to dig into that matter.
We actually build CS on two different versions of Windows using MinGW and also on MSVC. On Mac OS X we support two different versions. You can see a list of our supported platforms in our CS Overview documentation. This is a lot of work, but on our end and our team works pretty hard.

https://www.copperspice.com/docs/cs_overview/supported-platforms.html

As an application developer using CopperSpice there is no reason to support this many platforms. Instead you should pick one Unix platform like Debian 10 and then MSVC on Windows. So all you have is two platforms to support. If you have a user who needs a build for Fedora 33, then you can either supply it or charge them some minor consulting fee.
I want to develop and test my code with exactly one arbitrary version
You can absolutely write C++ source code which uses CopperSpice that will work on every Unix platform. The is the beauty of C++.

But deployment is not that simple and this has nothing to do with CopperSpice or any other library. We just looked on a Debian site and there are around 900 people that work on the distro, for just Debian.
I played around with appimage-builder but it turned out that it boils down to manual configuration since the recipe generator produces rubbish.
I think you have answered your own question. We clearly understand you want some application which does this and works well, with little or no effort. As I mentioned, there are better way to do this such as using a package manager.
So my question actually was: Is there a CS aware tool that can help generating AppImages or snaps for CS applications?
The team does not see this as a high priority product. There are so many other services and enhancements we are looking at making with CopperSpice, this item is not on our roadmap at this time. We do however have developers on our CS team who can help you write the necessary scripts. To be clear, this would fall under our paid consulting services.

I would strongly suggest we focus on how using CopperSpice might be of value for your application and what other ways you can distribute on multiple platforms.

Barbara

Post Reply