#1 2020-03-28 10:25:24

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Thanks to all for mORMot/Zeos + Linux!!!

Last two weeks I've compiled our Delphi Service with fpc under Linux.
It has 600.000 rows of code and it wasn't as easy as I thought (fpc-setup, fpcdeluxe, library pathes ...).

The documentation is good but helped me not enough to get it work.

But after two weeks of changing the code-lines and compile I've got an executable!
Two days later the service runs without issues and I can't believe it, how well that work's!

Thank you ab et al. for your unbelievable work! Also thanks to Michael (Zeos).

Now we have an REST-Service with MongoDB and Postgres -> which is a weapon!

With these tools you can do everything which needs a GUI (HTML5) and a Cloud-Service (e.g. ERP-Systems).

And the fix costs are awesome low!

I will donate Arnaud (promised) as soon as our business starts again. By now in Germany stupid yellow-belly people ruins our economy only because of a little virus!

Last edited by danielkuettner (2020-03-28 10:26:54)

Offline

#2 2020-03-28 10:46:24

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,542
Website

Re: Thanks to all for mORMot/Zeos + Linux!!!

in Germany yellow-belly people ruins our economy only because of a little virus!

I think it's everywhere. At last here in Ukraine the same (or even worst sad )

Last edited by mpv (2020-03-28 10:46:51)

Offline

#3 2020-03-28 11:55:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: Thanks to all for mORMot/Zeos + Linux!!!

Such good feedback means a lot to us.

Thanks for sharing your thoughts.

Hope your business will start as it should!

Offline

#4 2020-03-28 12:15:21

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Thanks to all for mORMot/Zeos + Linux!!!

mORMot is awesome! I genuinely recommend it to people everywhere when appropriate smile


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#5 2020-03-28 12:35:48

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Thanks to all for mORMot/Zeos + Linux!!!

BTW, isn't two weeks a quite short period of time for porting a project with 600,000 lines of code? wink

BTW2, don't neglect the little virus, safety and health are much more important than the economics. I'm from China and I know a little about it.

Last edited by edwinsn (2020-03-28 13:02:11)


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#6 2020-03-28 13:19:54

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: Thanks to all for mORMot/Zeos + Linux!!!

Not necessarily. We used only mORMot and Zeos and both should be fpc ready. Now our own code has to be ported.
Thanks to god we used Generics very rare and we have stopped the updating nightmare of Delphi XE6 up.
No one needs all the new fantastic language marketing inventions really.

I've never missed Nullable types e.g. The discussion is this really a Nullable type or only a reference type is an academic one for me. I'm not against academics, don't understand me wrong. But theory should boost the reality and not hinder it. What if we've used Spring4D? I've use very rarely a TSmartPointer. Without eliminating that it were not possible to compile it under fpc. Sure with some more investigating in that, it were possible to port it, but time is not infinite available.

Therefore I only have to navigate through the new jungle of fpc:

- remove all System. in unit names
- changed TList in Classes.TList (first fpc says generics without specialize ...)
- UTF8-Chars in strings
- replace CreateEvent with TEvent
- look for the reason, why fpc crashes with av without an error message

and so on.

The heaviest was to install fpc and get a compileable  environment. And honestly without Delphi IDE I would switch to C++ or Swift or nodejs.

But the moment where my little linux service was visible with its first requests in RemoteLog under my Windows- workstation was incomparable!

Offline

#7 2020-03-28 14:52:15

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Thanks to all for mORMot/Zeos + Linux!!!

You used FPCDeluxe to install FPC?

Offline

#8 2020-03-28 15:34:33

edwinsn
Member
Registered: 2010-07-02
Posts: 1,215

Re: Thanks to all for mORMot/Zeos + Linux!!!

danielkuettner wrote:

But the moment where my little linux service was visible with its first requests in RemoteLog under my Windows- workstation was incomparable!

Thanks for sharing your migration experience! What "remote logging" mechanism are you using? I'm recently thinking of logging from mORMot to sentry.io.


Delphi XE4 Pro on Windows 7 64bit.
Lazarus trunk built with fpcupdelux on Windows with cross-compile for Linux 64bit.

Offline

#9 2020-03-28 15:57:15

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: Thanks to all for mORMot/Zeos + Linux!!!

@mafly

Yes. First installed normally fpcupdeluxe.

Then copied all from Download to ../.
Then copied fpc and ppcx64 to /usr/local/bin
Then copy fpc.cfg to /etc

In fpc.cfg you have to set all paths to /home/daniel/fpcupdeluxe/...
and other pathes you need e.g.:

-Fi/home/daniel/mORMot/trunk
-Fi/home/daniel/Zeos/src
-Fu/home/daniel/mORMot/trunk/
-Fu/home/daniel/mORMot/trunk/SQLite3/
-Fu/home/daniel/Zeos/src
-Fu/home/daniel/Zeos/src/dbc
-Fu/home/daniel/Zeos/src/core
-Fu/home/daniel/Zeos/src/parsesql
-Fu/home/daniel/Zeos/src/plain


Now we have a Debian system with fpc and can compile our project.

Our project is now under /home/daniel/sone_srv.
We need also /home/daniel/mORMot
and
/home/daniel/Zeos

The I've created a build-One.sh script (copied from Arnauld's build-fpc-linux64.sh) with svn update, so I can do my work under Delphi, commit and then under Linux build with the script.
Building is extremely slow, so you learn patience.

@edwinson

With RemoteLog I mean Arnaud's LogViewer in Server Mode. This tool is just perfect. Many thanks for this AB!

Last edited by danielkuettner (2020-03-28 16:03:20)

Offline

#10 2020-03-28 17:03:54

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: Thanks to all for mORMot/Zeos + Linux!!!

Did you try WSL?
https://docs.microsoft.com/en-us/window … tall-win10

When Windows was my main system (I use Ubuntu now), I cross-compiled from Windows/Lazarus, then executed the Linux binary in a WSL batch.
It was much better than a VM, especially about sharing the file system.

Now, I am on Linux, and I have a XP VM and a Win10 VM to run the Windows tests inside Virtual Box.
The Lazarus / gdb debugger experience is much better within Linux - not perfect, but at lease reactive enough and stable enough.
Lazarus / gdb on Windows was a painful experience.

Offline

#11 2020-03-28 17:30:57

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: Thanks to all for mORMot/Zeos + Linux!!!

Not yet, but thx.
Atm I've only VM's (for Win and Linux) on a proxmox dedicated server at Contabo.
With svn it's easy. Change code in Delphi, commit, terminal on Linux, call build_script.sh and wait...

Last edited by danielkuettner (2020-03-28 17:31:12)

Offline

#12 2020-03-28 18:11:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,231
Website

Re: Thanks to all for mORMot/Zeos + Linux!!!

With WSL you can use Lazarus on Windows, then compile only what is needed (no slow build required), and run locally in the same environment your Linux executable.
So the compile / run / fix cycle could be much more agile than a remote server + SVN + full rebuilt.
I usually add some "writeln" inside the code, and some additional logs, to find out what is needed. So it won't pollute SVN with debug tricks.

Offline

#13 2020-03-28 18:36:10

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: Thanks to all for mORMot/Zeos + Linux!!!

Ok, I will try it out.

My tests with Lazarus were sobering. I've used Xming on windows and start Lazarus over putty. Than I changed the code in Lazarus, F9 and so on. After a while I realized, that my code changes weren't compiled! And when I move with mouse cursor over a variable the hint show not the value, only when I add it to watch list, the value was shown.

That frustrated me too much and I gave up and used as described. But I will follow your suggestions (master).

Last edited by danielkuettner (2020-03-28 19:05:35)

Offline

#14 2020-03-28 20:32:55

macfly
Member
From: Brasil
Registered: 2016-08-20
Posts: 374

Re: Thanks to all for mORMot/Zeos + Linux!!!

@danielkuettner

Thank you for sharing your experiences.

I'm currently doing cross-compiler. I Code and compile on Windows and run on Linux.

I am currently using for lighter services and it has worked very well.
But I know that at some point I will have to compile and debug directly on Linux.

Offline

Board footer

Powered by FluxBB