Recent

Author Topic: [SOLVED] If I switch to Linux  (Read 4303 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5216
  • My goal: build my own game engine using Lazarus
Re: If I switch to Linux
« Reply #15 on: May 23, 2024, 07:55:03 pm »
Windows file system is case insensitive but Linux file system is case sensitive.
This is not true, NTFS is a case sensitive file system. It is just that most of the File handling API's are case insensitive. The following must be run with administator rights:
Code: Bash  [Select][+][-]
  1. fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable
The above command makes the contents of the folder and subfolders case sensitive.
See:
https://www.windowscentral.com/how-enable-ntfs-treat-folders-case-sensitive-windows-10

I never knew about it. Thank you for the correction.

dsiders

  • Hero Member
  • *****
  • Posts: 1147
Re: If I switch to Linux
« Reply #16 on: May 23, 2024, 08:09:39 pm »
OpenSSL3 and FPC 3.2.2 do not play well together (or at all).
How? What code are you using? Synapse? fcl-net/web? Indy? Because fcl-net supports OpenSSL3 afaik and recent Indy too. In fact all my code uses OpenSSL3.
Problems only arise if you use deprecated protocols that have been removed from OpenSSL in version 3.
(SSL,SL2/3,TLS1.0)

That's the only thing that hasn't been a simple recompile. I'm not using anything other than the http client in fcl-net to do https: requests. So far, all it does is raise an exception on linux. Works fine on Windows. And yes, my linux box has OpenSSL installed. When I get a chance to tinker some more this weekend, I'll figure it out. But so far... no go.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

dsiders

  • Hero Member
  • *****
  • Posts: 1147
Re: If I switch to Linux
« Reply #17 on: May 23, 2024, 09:16:08 pm »
I didn't have to wait for the weekend.

OpenSSL3 support is not available in FPC 3.2.2. It is enabled in 3.3.X though.

See openssl.pas DLLVersions constant.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Thaddy

  • Hero Member
  • *****
  • Posts: 14805
  • Censorship about opinions does not belong here.
Re: If I switch to Linux
« Reply #18 on: May 23, 2024, 09:21:51 pm »
Yeah, I might have used my own code indeed. But trunk supports it and I hope it is a candidate for back-porting.
This is really an issue and it did not come up for the first time.
Then again: programmers that write out of date code are plainly ready to get fired. >:D >:D >:D (when was the last time I used so many? can't remember)


It is not for nothing that I write so many comments when it is about security: it was my job and I care for it. Pensionado or not.
« Last Edit: May 23, 2024, 09:28:45 pm by Thaddy »
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

Thaddy

  • Hero Member
  • *****
  • Posts: 14805
  • Censorship about opinions does not belong here.
Re: If I switch to Linux
« Reply #19 on: May 23, 2024, 09:57:39 pm »
for example, the default text font is different and I have to adjust the size of the buttons.
That would be also the case on Windows if the font is not installed.....
That is lame and ill informed.
Simply copy your Windows fonts to the Linux font directory.  (/usr/share/fonts usually, make sure you know the font format and copy to the correct subdir. This is not necessary, but keeps the lot clean)
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

Thaddy

  • Hero Member
  • *****
  • Posts: 14805
  • Censorship about opinions does not belong here.
Re: If I switch to Linux
« Reply #20 on: May 24, 2024, 06:44:48 am »
Forgot that the better option is probably to simply include the font as a resource. Then it always works.
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

dbannon

  • Hero Member
  • *****
  • Posts: 2858
    • tomboy-ng, a rewrite of the classic Tomboy
Re: If I switch to Linux
« Reply #21 on: May 24, 2024, 09:36:16 am »
So Ten_Mile_Hike, a summary -

If your code is currently written using Lazarus's excellent cross platform approach, no problems. But look for -
  • Units that have "windows" in the uses clause, comment out that unit name and see what does not compile.
  • Code that assumes use of cr/lf at the end of a line, use the correct LineEnding, AppendPathDelim() etc.  The various file handling methods don't particularly care but you probably play with a file's content at some stage.
  • If your code is careless with case of filename, eg assuming MyFile.txt is the same as myfile.txt, that could well be a issue.
  • There will possible be some low level (graphics) things that only testing will reveal.
  • When choosing a Linux to install, avoid a distro / desktop combo that uses Wayland (its not ready yet). That means don't use Gnome of KDE at present, sadly they are the default for many distros. Use a desktop such as Mate, Cinnamon, Xfce if possible. That said, Gnome and KDE will work OK for many users.
  • Sadly, if you use openssl (eg https downloads etc) you will need to use a FPC Fixes, not the official release version.
It is not for nothing that I write so many comments when it is about security: it was my job and I care for it. Pensionado or not.

And you did not know that the official release version of FPC does not work with OpenSSL3 on Linux (*) ? Make you think .....

Quote from: TRon
Quote from: Thaddy
    This is not true, NTFS is a case sensitive file system. It is just that most of the File handling API's are case insensitive. The following must be run with administator rights:
You are ofc correct there Thaddy but don't you think that for those 0.0001% of users that knows about that, then do not know about the differences wrt programming between Windows and Linux ?
I enjoyed that one !

Davo

* OpenSSL 3.0 and FPC322
Will work on your own system if you have the OpenSSL Dev package installed, thats because FPC looks for the the unversioned version (symlink) if it cannot find one of the versions hard wired in. So far, my app seems to work like that, yours may not. Further, no one wants to ship an application that requires the end user to install a dev library. And none (?) of the Linux distros will ship (or build with) a non-release compiler.

EDIT: Typo
« Last Edit: May 24, 2024, 09:39:30 am by dbannon »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dsiders

  • Hero Member
  • *****
  • Posts: 1147
Re: If I switch to Linux
« Reply #22 on: May 24, 2024, 04:31:51 pm »
  • When choosing a Linux to install, avoid a distro / desktop combo that uses Wayland (its not ready yet). That means don't use Gnome of KDE at present, sadly they are the default for many distros. Use a desktop such as Mate, Cinnamon, Xfce if possible. That said, Gnome and KDE will work OK for many users.
I would not discourage use of Gnome or KDE... just use them with X11 instead of Wayland. In fact, I would avoid Mate, Cinnamon, and XFCE IMO.


  • Sadly, if you use openssl (eg https downloads etc) you will need to use a FPC Fixes, not the official release version.
* OpenSSL 3.0 and FPC322
Will work on your own system if you have the OpenSSL Dev package installed, thats because FPC looks for the the unversioned version (symlink) if it cannot find one of the versions hard wired in. So far, my app seems to work like that, yours may not. Further, no one wants to ship an application that requires the end user to install a dev library. And none (?) of the Linux distros will ship (or build with) a non-release compiler.

Newer distros are shipping with OpenSSL3, so it's not a dev library any more (at least not with OpenSUSE).

Code: Pascal  [Select][+][-]
  1. // HACK!!! until FPC 3.2.X is updated
  2. // use openssl version command to get your installed version number... mine is 3.1.4
  3. openssl.DLLVersions[1] := '.3';
  4. openssl.DLLVersions[2] := '.3.1';
  5. openssl.DLLVersions[3] := '.3.1.4';
  6.  

[Edit]
Added missing 's'es.
« Last Edit: May 24, 2024, 04:46:01 pm by dsiders »
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

dsiders

  • Hero Member
  • *****
  • Posts: 1147
Re: If I switch to Linux
« Reply #23 on: May 24, 2024, 04:41:00 pm »
Quote
And you did not know that the official release version of FPC does not work with OpenSSL3 on Linux (*) ?

Actually, FPC 3.2.X doesn't support OpenSSL3 out-of-the-box anywhere... it's not just Linux.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Thaddy

  • Hero Member
  • *****
  • Posts: 14805
  • Censorship about opinions does not belong here.
Re: If I switch to Linux
« Reply #24 on: May 24, 2024, 07:38:14 pm »
That is correct, but fixed. Iif you need it in 3.2.X I can give you a patch.
Mind you, before asking, that a lot of code which uses out-of-date protocols will NOT work anymore.
So if the protocol in your code is hardcoded as SSL/TLS1.0.... You are a moron.
Don't complain about that: it is not an opinion but fact.
« Last Edit: May 24, 2024, 07:45:28 pm by Thaddy »
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

dsiders

  • Hero Member
  • *****
  • Posts: 1147
Re: If I switch to Linux
« Reply #25 on: May 24, 2024, 07:57:23 pm »
That is correct, but fixed. Iif you need it in 3.2.X I can give you a patch.
Mind you, before asking, that a lot of code which uses out-of-date protocols will NOT work anymore.
So if the protocol in your code is hardcoded as SSL/TLS1.0.... You are a moron.
Don't complain about that: it is not an opinion but fact.

I don't need (or want) a patch for 3.2.2. I want a 3.2.4 release.
Preview Lazarus 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

Thaddy

  • Hero Member
  • *****
  • Posts: 14805
  • Censorship about opinions does not belong here.
Re: [SOLVED] If I switch to Linux
« Reply #26 on: May 24, 2024, 09:11:38 pm »
Me too  :D, but if I can help you out, just ask.
AFAIK the commits for OpenSSL3 do not rely on new features in trunk.
« Last Edit: May 24, 2024, 09:14:59 pm by Thaddy »
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

dbannon

  • Hero Member
  • *****
  • Posts: 2858
    • tomboy-ng, a rewrite of the classic Tomboy
Re: If I switch to Linux
« Reply #27 on: May 25, 2024, 03:12:51 am »

Will work on your own system if you have the OpenSSL Dev package installed, ....
Newer distros are shipping with OpenSSL3, so it's not a dev library any more (at least not with OpenSUSE).
Sorry Don, I did not make myself clear. Linux systems have dev library packages that corresponds to library packages, they include extra things useful for developers, in practice, the important thing they provide is an unversioned  symlink to the actual library file. See -
Code: [Select]
$> sudo apt install openssl-dev
....
ls -la /usr/lib/x86_64-linux-gnu/libssl.so*
lrwxrwxrwx 1 root root     11 Oct 24  2023 /usr/lib/x86_64-linux-gnu/libssl.so -> libssl.so.3
-rw-r--r-- 1 root root 696352 Oct 24  2023 /usr/lib/x86_64-linux-gnu/libssl.so.3

Note the first one is a symlink and does not have a version number, its intended for use at (dynamic) link time, but FPC tries to open it at run time ! And, as I said, it works. But should not be relied on IMHO. Just making the symlink works just as well by the way but end users get scared ....

Quote
Code: Pascal  [Select][+][-]
  1. // HACK!!! until FPC 3.2.X is updated
  2. // use openssl version command to get your installed version number... mine is 3.1.4
  3. openssl.DLLVersions[1] := '.3';
  4. openssl.DLLVersions[2] := '.3.1';
  5. openssl.DLLVersions[3] := '.3.1.4';
  6.  
OK, that that would help with Windows, that would be good. But I had decided I was not willing to hack at the FPC.openssl, I'm not the security expert Thaddy is and when I looked at a diff of the two code sets, there were a lot more changes in the FPC-fixes version than just version numbers.

Its not a very good situation, one that can only be fixed with a proper release of FPC !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

PascalDragon

  • Hero Member
  • *****
  • Posts: 5541
  • Compiler Developer
Re: If I switch to Linux
« Reply #28 on: May 26, 2024, 10:26:15 pm »
Windows file system is case insensitive but Linux file system is case sensitive.
This is not true, NTFS is a case sensitive file system.

The file system as a whole is a case preserving file system. Only because single directories can be switched to case sensitive does not make the file system as a whole case sensitive, just like Ext4's ability to make single directories case insensitive does not make it case insensitive as a whole.

It is just that most of the File handling API's are case insensitive. The following must be run with administator rights:
Code: Bash  [Select][+][-]
  1. fsutil.exe file SetCaseSensitiveInfo C:\folder\path enable
The above command makes the contents of the folder and subfolders case sensitive.
See:
https://www.windowscentral.com/how-enable-ntfs-treat-folders-case-sensitive-windows-10

I use this on part of my development folders that are shared between Windows11 and a Debian on WSL2.
Note that the average Windows user has not enough discipline to work with a case sensitive system  :o

Important note: folders with enabled case sensitivity can not be accessed as network shares (or if the share is non-case sensitive then you can't enter such directories inside the share)!

A similar unkown on NTFS are sparse files, which are very useful,

Or Alternate Data Streams 😍
At work we use them to store the PDB and MAP files generated by the MSVC compiler as part of the binary (our builds are then stored as WIM files which allows the storing of ADS as well)

 

TinyPortal © 2005-2018