Recent

Author Topic: Raspberry with source directory on a windows share  (Read 5233 times)

sporex

  • New Member
  • *
  • Posts: 39
Raspberry with source directory on a windows share
« on: May 20, 2022, 10:27:04 am »
Pls.help,
I have installed Laz v2.0.10 on a RPi with Debian 11 (bullseye) following this tutorial:
https://wiki.freepascal.org/Lazarus_on_Raspberry_Pi

Now I want to test the installed IDE for this particular setup:
The directory for the source files is on a windows share on a different machine and properly mounted with all required access rights.
When I open a very simple test.pas file from this source directory and try to compile it, the following will happen:

- the IDE reports "BEGIN expected but end of file found"
- the test.pas file on the windows share still exists, but the content is deleted (0byte)
- the backup, lib, test.lpi, test.lps are created in the shared folder. So it cannot be a problem of access rights

When I do the same test with a folder on the local file system, everything works.
And btw, I had the same configuration (source on shared directory) with Jessie and an older version of lazarus.

I suppose I need to change something in the Tools|Options settings, but what?

Thank you for advice and kind regards

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #1 on: May 20, 2022, 10:45:59 am »
Use the file ** command to check what the line endings are.

** That's a standard unix command. Whatever the RPi people would like to call it, you're running a remix of the Debian Linux distribution, which roughly speaking is "a unix".

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #2 on: May 20, 2022, 10:59:25 am »
This is the result of file ** before attempting to compile:
 
Code: Pascal  [Select][+][-]
  1.   test0.pas: ASCII text, with CRLF line terminators

And this is after attempting to compile:
Code: Pascal  [Select][+][-]
  1.   backup:    directory
  2. lib:       directory
  3. test0.lpi: XML 1.0 document, ASCII text
  4. test0.lps: XML 1.0 document, ASCII text
  5. test0.pas: empty
  6.  

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #3 on: May 20, 2022, 11:05:53 am »
And this is what I get for the executable when I successfully compile on the local file system:

Code: Pascal  [Select][+][-]
  1.  test0:     ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, with debug_info, not stripped  

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #4 on: May 20, 2022, 11:08:25 am »
You might need to find a text editor that saves files with unix-style line endings. I /thought/ that the compiler was tolerant of variations there.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #5 on: May 20, 2022, 12:13:08 pm »
You might need to find a text editor that saves files with unix-style line endings. I /thought/ that the compiler was tolerant of variations there.

MarkMLl

But this cannot be the reason for the problem because the source file on the local file system has the same format:

Code: Pascal  [Select][+][-]
  1.  test0.pas: ASCII text, with CRLF line terminators  

this test0.pas was written with the source editor on the windows LAZ, stored to /NAS and then transferred to the local file system of the RPi, and it compiles.
« Last Edit: May 20, 2022, 12:19:54 pm by sporex »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #6 on: May 20, 2022, 12:32:23 pm »
Hmm. Going back through the thread: I used ** to indicate a footnote and assumed you would understand that you had to enter something like

Code: [Select]
file test.pas

Is it /really/ showing test.pas empty after compilation?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #7 on: May 20, 2022, 12:54:25 pm »

Really, really. This is before compilation:
Code: Pascal  [Select][+][-]
  1. pi@DEB11IDE:/NAS/TEST $ file ./test0.pas
  2. ./test0.pas: ASCII text, with CRLF line terminators

And this is afterwards:
Code: Pascal  [Select][+][-]
  1. pi@DEB11IDE:/NAS/TEST $ file ./test0.pas
  2. ./test0.pas: empty

And this is the source on the local file system that compiles:
Code: Pascal  [Select][+][-]
  1.  pi@DEB11IDE:~/fpcsrc/TEST $ file ./test0.pas
  2. ./test0.pas: ASCII text, with CRLF line terminators



MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #8 on: May 20, 2022, 01:11:18 pm »
Really, really odd :-|

Presumably you're building using the full IDE... what happens if instead you apply lazbuild to the .lpi (Lazarus project information) file?

I must say that mapping stuff like that wouldn't be my first choice: I usually use Subversion as the common point. Any idea what protocol is being used (check mount command output)?

Edited: incorrectly referred to .lpr file.

MarkMLl
« Last Edit: June 04, 2022, 02:45:45 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #9 on: May 20, 2022, 02:02:01 pm »
Really, really odd :-|
Presumably you're building using the full IDE... what happens if instead you apply lazbuild to the lpr (Lazarus project) file?
I must say that mapping stuff like that wouldn't be my first choice: I usually use Subversion as the common point. Any idea what protocol is being used (check mount command output)?

MarkMLl

The mount result gives me this (for the share):
Code: Pascal  [Select][+][-]
  1.  //192.168.2.126/PINAS/RASPI on /NAS type cifs (rw,relatime,vers=2.1,cache=strict,username=pi,uid=1000,noforceuid,gid=1000,noforcegid,addr=192.168.2.126,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)

And this is what I get for the Jessie IDE (where all is ok)
Code: Pascal  [Select][+][-]
  1.  //192.168.2.126/PINAS/RASPI on /NAS type cifs (rw,relatime,vers=2.1,sec=ntlmssp,cache=strict,username=pi,domain=P1W764,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.2.126,file_mode=0755,dir_mode=0755,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

You know that I am not so deeply involved in the internals of Lazarus stuff but what I did so far was:
- create /NAS/TEST/test_abc on the LAZ_WIN IDE
- trying to conpile (Ctrl-F9) --> failed
- trying to Build (Shift-F9) --> failed

So I am loosing hope.
I can only confirm that I have a SD card image with Debian 8 (Jessie) and LAZ 1.2.4.dfsg2-1 where all this has worked perfectly for years now.
To compile to/from the win share is very convenient because I can edit under LAZ-WIN and compile/debug under LINUX arm and get the executable right back to the archive from where I can redistribute it to many other RPi units in the field.
Unfortunately I am forced to upgrade all RPi units now to Debian 11 (Jessie is end of life) and it seems that some of the executables that I create with the Jessie IDE do not run on the upgraded Bullseye units.
The majority of my applications are "SimpleProgram" without GUI. Only one uses GUI
I have to say that I am not interested to always have the most recent release of LAZ and that "compiling the IDE" "cross compiling" and such stuff is beyond my knowledge.
So my first choice would be to have a simple way to install version 1.2.4.dfsg2-1 (apt-get install ...) on the Bullseye image, provided that it creates executables that are running. 
« Last Edit: May 20, 2022, 02:13:19 pm by sporex »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #10 on: May 20, 2022, 02:10:15 pm »
- trying to Build (Shift-F9) --> failed

...

Unfortunately I am forced to upgrade all RPi units now to Debian 11 (Jessie is end of life) and it seems that some of the executables that I create with the Jessie IDE do not run on the upgraded Bullseye units.

...

So my first choice would be to have a simple way to install version 1.2.4.dfsg2-1 (apt-get install ...) on the Bullseye image, provided that it creates executables that are running.

a) What happens if you use Lazbuild?

b) It would be worth raising failing apps as a separate thread.

c) Look back through the forum for discussion on installing Lazarus on an RPi. I for one normally build from source, but I believe that the consensus is that using the distro-provided apt is the least-good way because of the delay to getting bugfixes etc. into it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #11 on: May 20, 2022, 02:26:31 pm »
- trying to Build (Shift-F9) --> failed

...

Unfortunately I am forced to upgrade all RPi units now to Debian 11 (Jessie is end of life) and it seems that some of the executables that I create with the Jessie IDE do not run on the upgraded Bullseye units.

a) What happens if you use Lazbuild?

b) It would be worth raising failing apps as a separate thread.

c) Look back through the forum for discussion on installing Lazarus on an RPi. I for one normally build from source, but I believe that the consensus is that using the distro-provided apt is the least-good way because of the delay to getting bugfixes etc. into it.

MarkMLl
First of all, I appreciate your help.
Concerning a) : do you mean I should use Tools|Build Lazarus with Profile Normal IDE ?
Concerning b) : do you mean that apps compiled on Jessie and 1.2.4 dfsg2-1 should normally work with Bullseye?
Concerning c) : I will keep on the struggle with this

Thanks a lot

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #12 on: May 20, 2022, 03:50:01 pm »
a) You have a program called lazbuild. Use it.

b) Generally speaking, yes. Otherwise it's of general interest to know what's going on.

c) Well done.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Raspberry with source directory on a windows share
« Reply #13 on: May 20, 2022, 03:58:18 pm »
Concerning a) : do you mean I should use Tools|Build Lazarus with Profile Normal IDE ?

No, MarkMLI means the lazbuild utility provided with Lazarus which allows to build a Lazarus project from the command line.

But lets get simpler, just to check whether compilation by itself works: create a new unit on your share with a simple program (just something that does a Writeln('Hello World')) and compile that manually using fpc theprogram.pas. Does this work correctly? What was the output of FPC if it didn't?

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #14 on: May 20, 2022, 06:16:37 pm »
Without wanting to sound condescending but to make things absolutely clear: lazbuild" and "fpc" are programs that you will need to invoke in a shell session. You should be able to either cut-and-paste or redirect the output so that you can relay it to us.

Please do not oblige me to refer to that as a terminal emulator, command prompt or anything similar: there are depths to which I am reluctant to stoop :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018