Recent

Author Topic: Common File Dialogs Have Been Broken for a Very Long Time (Ex: Ubuntu AARCH64)  (Read 18543 times)

TRon

  • Hero Member
  • *****
  • Posts: 3774
Would your script also run on macOS (and Windows, if the commands were updated)?
Requires more work. especially regarding the bootstrap compiler.

Quote
This could produce the first single-source cross-platform setup for Lazarus itself, which would be exciting.
Unless I am completely misunderstand something or used a wrong interpretation of what was written: it is named fpcup, later evolved into fpcupdeluxe (*).

fwiw: Building Lazarus itself is peanuts.

(*) edit: sorry as I just noticed you addressed fpcupdeluxe as being challenging.

Could you elaborate on what difficulties you encountered ?

Reason to ask is that documentation can always be improved but be advised that setting up f.e. a cross-compiler is something far more complicated than a 'simple' Lazarus or FPC install (and FPCUpDeluxe tries to support all and then some).
« Last Edit: November 20, 2024, 03:13:53 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

rvk

  • Hero Member
  • *****
  • Posts: 6640
That script only works for Linux variants on different OSes.

It's my personal script where I only do the things I need to do each time.
For more flexibility you have the fpcupdeluxe.

But because you didn't know the problem was due to the compilation by fpcupdeluxe or something else, I shared my script here (where it worked fine).

So if you take fpcupdeluxe and choose the latest trunk, after compiling, the resulting program should work fine (under Linux VM on Mac and on Mac itself).

msintle

  • Sr. Member
  • ****
  • Posts: 259
Would your script also run on macOS (and Windows, if the commands were updated)?
Requires more work. especially regarding the bootstrap compiler.

Quote
This could produce the first single-source cross-platform setup for Lazarus itself, which would be exciting.
Unless I am completely misunderstand something or used a wrong interpretation of what was written: it is named fpcup, later evolved into fpcupdeluxe (*).

fwiw: Building Lazarus itself is peanuts.

(*) edit: sorry as I just noticed you addressed fpcupdeluxe as being challenging.

Could you elaborate on what difficulties you encountered ?

Reason to ask is that documentation can always be improved but be advised that setting up f.e. a cross-compiler is something far more complicated than a 'simple' Lazarus or FPC install (and FPCUpDeluxe tries to support all and then some).

Never looking into cross compilation, but just a reliable method to install Lazarus itself (together with its dependencies - no matter which widgetset is selected for development [Qt5, GTK2]).

FPCUPDLX typically errors out with number 512 for me, but sometimes, there's other errors. This is after the dependencies it prints out as being missing are successfully installed.

In general it is a lifesaver, and the only way I know how to get the latest trunk fixes.

TRon

  • Hero Member
  • *****
  • Posts: 3774
FPCUPDLX typically errors out with number 512 for me, but sometimes, there's other errors. This is after the dependencies it prints out as being missing are successfully installed.
Ah, that sounds familiar. Sequoia, I presume ?

Should not happen but it does.

Have you (also) tried with the pre-release of FPCUpDeluxe and does it act in a similar manner ? Is there a detailed (error) log somewhere to be able to have a look at ?

I do not have to remember anything anymore thanks to total-recall.

msintle

  • Sr. Member
  • ****
  • Posts: 259
FPCUPDLX typically errors out with number 512 for me, but sometimes, there's other errors. This is after the dependencies it prints out as being missing are successfully installed.
Ah, that sounds familiar. Sequoia, I presume ?

Should not happen but it does.

Have you (also) tried with the pre-release of FPCUpDeluxe and does it act in a similar manner ? Is there a detailed (error) log somewhere to be able to have a look at ?

I've probably never seen it fail on macOS, but it consistently fails on the Linux'es I've tried it on.

Here's a few logs for you, based on the latest pre-release version (and 4 GB VM RAM, as Alf had determined 2 GB RAM would itself break the process).

All OS's below are aarch64.

Debian 12.6:
After running "sudo apt-get install libx11-dev libgtk2.0-dev libcairo2-dev libpango1.0-dev libxtst-dev libgdk-pixbuf2.0-dev libatk1.0-dev libghc-x11-dev make binutils git gdb" successfully, we get:

Edit: It worked! Seems like a recent fix.

Ubuntu 24.04:
fpcupdlx itself doesn't run. Qt5 doesn't launch at all, GTK2 causes a floating point error upon launch and fails shortly thereafter.

Got to say, Ubuntu aarch64 really seems to have a thing out for Lazarus compiled apps!

Edit: I'll be trying more OS's later, it seems Qt5 Pascal library installations might be required for Qt5 scenario testing, too (so fpcupdlx launches properly). Would also be helpful to refresh tests on x86_64, too.

rvk

  • Hero Member
  • *****
  • Posts: 6640
Ubuntu 24.04:
fpcupdlx itself doesn't run. Qt5 doesn't launch at all, GTK2 causes a floating point error upon launch and fails shortly thereafter.
Yikes. That's a catch 22. The chicken and the egg  :D
The fpcupdlx binary also needs to be first compiled with this fix otherwise it will give the same errors you are trying to avoid   ;)

But for Linux you can use my script.

TRon

  • Hero Member
  • *****
  • Posts: 3774
Thank you very much for the testing and extensive report @msintl.

I need a bit more time to delve deeper into this but as remarked by rvk that is indeed a nice catch 22  :)

I personally have never encountered anything like you seem to experience, either native or using virtualization software.

I do not know Don Alfredo's schedule and/or release cycle (I for one wouldn't dare tamper with it either) so it might be that it could take a while. There are alternatives such as using fpcup (note the absence of Deluxe) instead or indeed use something like a script as provided by rvk.

In basics all that you need is a working FPC compiler. The build of Lazarus is more or less a 3-liner.

Usually what I do when Lazarus isn't able to build is to manually patch (well, my script does it for me but that patch needs to be crafted and added) the Lazarus sources before building. But in this case you're building straight from trunk.
« Last Edit: November 21, 2024, 11:37:24 pm by TRon »
I do not have to remember anything anymore thanks to total-recall.

msintle

  • Sr. Member
  • ****
  • Posts: 259
Running the installation script (on Ubuntu), I get a lot of encouraging output until:

Code: Text  [Select][+][-]
  1. ...
  2. Compiling for ARM64 Processor (Pi2 and higher only)
  3. ==============================================================
  4. Using bootstrap /home/parallels/dev/bootstrap/ppca64 compiler
  5.  
  6. ==============================================================
  7.  
  8. Downloading FPC sources Date:   Thu Nov 21 22:01:29 2024 +0100
  9.  
  10. HEAD is now at 09f3600cc4   * patch by Lipinast Lekrisov: fix building ffi.pp on macOS, resolves #41035
  11. Now: Date:   Thu Nov 21 22:01:29 2024 +0100
  12.  
  13. Downloading Lazarus sources Date:   Thu Nov 21 19:52:47 2024 +0100
  14. HEAD is now at ea838aa496 Gtk2: fixed bitmap creation when ratio DataSize/MaskSize have remainder. issue #41070
  15. Now: Date:   Thu Nov 21 19:52:47 2024 +0100
  16.  
  17. ./l.sh: line 387: warning: here-document at line 300 delimited by end-of-file (wanted `EOF')
  18. ./l.sh: line 388: syntax error: unexpected end of file
  19.  
Any thoughts what the issue might be here?

I tried both pasting into pico (nano) first, and then the default text editor that ships with Ubuntu.

TRon

  • Hero Member
  • *****
  • Posts: 3774
Running the installation script (on Ubuntu), I get a lot of encouraging output until:
Is that /all/ the output from running rvk's script ? (afaik (quick glance only) there should be more)

Quote
Code: [Select]
./l.sh: line 387: warning: here-document at line 300 delimited by end-of-file (wanted `EOF')
./l.sh: line 388: syntax error: unexpected end of file
Any thoughts what the issue might be here?
The heredoc seem to have failed. No idea why but it is practically at the end of the script, only responsible for creating a desktop shortcut (so can be ignored).

Can you detect whether the lazarus and startlazarus executables are present ?

PS: In order to catch and watch the output at the same time on linux something like this can be used:
Code: Bash  [Select][+][-]
  1. ./scriptname.sh 2>&1 | tee name_of_log_file.txt
  2.  

In case of a re-run of the script always make sure to remove everything that the script downloaded, extracted and/or created so that the start conditions are always the same (normally scripters like myself f.i. are lazy in automating that).
« Last Edit: November 22, 2024, 01:59:05 am by TRon »
I do not have to remember anything anymore thanks to total-recall.

rvk

  • Hero Member
  • *****
  • Posts: 6640
I tried both pasting into pico (nano) first, and then the default text editor that ships with Ubuntu.
This is a bash script (notice the first line).
So don't run it with sh.
sh isn't bash.

Edit: I check for this in the script so it must be running under bash  :D

I normally have this script on my internal server and run it via this.
Quote
bash <(wget -q -o /dev/null -O - https://internal-server/lazarus_on_linux.sh)

So this should work too
Quote
bash ./lazarus_on_linux.sh

Otherwise note that the lines 300-306 are correctly EOF'ed
This method of creating a file with cat EOF is die multiple times.
You could change the EOF to something else but for me this works.

Does line 306 contain only EOF?
« Last Edit: November 22, 2024, 06:09:33 am by rvk »

msintle

  • Sr. Member
  • ****
  • Posts: 259
You're absolutely correct, running bash made no difference.

I have no way of knowing about the end-of markers. Everything looks good in both pico and the OS default GUI text editor.

I literally just pasted your script from Firefox (on Ubuntu itself) to pico and the text editor.

TRon

  • Hero Member
  • *****
  • Posts: 3774
Does line 306 contain only EOF?
Doing exactly the same as described by msintle then the answer to that question would be yes (just checked). The only odd thing I noticed is the semicolon as last character in the line above (but no idea if that influences the heredoc parsing. I usually do not work heredoc because it messes with the formatting).
I do not have to remember anything anymore thanks to total-recall.

rvk

  • Hero Member
  • *****
  • Posts: 6640
It's this part:
Code: Bash  [Select][+][-]
  1. cat << EOF >> $HOME/.fpc.cfg
  2. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget
  3. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/*
  4. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/rtl
  5. -Fl$(find / -name crtbegin.o -printf '%h\n' 2>/dev/null | head -n 1)
  6. -FD$BASE/fpc/bin
  7. EOF

You could change the EOF to anything else
Code: Bash  [Select][+][-]
  1. cat << EOFFF >> $HOME/.fpc.cfg
  2. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget
  3. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/*
  4. -Fu$BASE/fpc/lib/fpc/\$fpcversion/units/\$fpctarget/rtl
  5. -Fl$(find / -name crtbegin.o -printf '%h\n' 2>/dev/null | head -n 1)
  6. -FD$BASE/fpc/bin
  7. EOFFF

But the EOF as part to end a cat is used multiple times in the script.
Only thing I can think of is that copy/paste has done something to the lines (or end-of-line).

msintle

  • Sr. Member
  • ****
  • Posts: 259
Just tried that, no effect. There's also several other EOF literals in the file.

rvk

  • Hero Member
  • *****
  • Posts: 6640
Just tried that, no effect. There's also several other EOF literals in the file.
Yes, and normally this is not a problem. You might want to post your version (if not a 1:1 copy).

I took my post, pressed [Select], right clicked and pressed copy.
The in a terminal I did
nano l.sh
pasted the clipboard
ctrl+x and enter.
Then
bash l.sh
and everything went fine.


 

TinyPortal © 2005-2018