Recent

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

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #15 on: May 20, 2022, 09:36:26 pm »
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?
[/quote]

Yes, that one works:

Code: Pascal  [Select][+][-]
  1. root@DEB11IDE:/NAS/TEST# fpc ./test0.pas
  2. Free Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for aarch64
  3. Copyright (c) 1993-2020 by Florian Klaempfl and others
  4. Target OS: Linux for AArch64
  5. Compiling ./test0.pas
  6. test0.pas(13,6) Warning: Variable "i" does not seem to be initialized
  7. Assembling test
  8. Linking test0
  9. 17 lines compiled, 1.8 sec
  10. 1 warning(s) issued
  11.  

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #16 on: May 20, 2022, 09:40:04 pm »
And this is the executable:

Code: Pascal  [Select][+][-]
  1.  root@DEB11IDE:/NAS/TEST# file ./test0
  2. ./test0: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, stripped

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #17 on: May 20, 2022, 09:43:14 pm »
And those are the files created in the shared directory:

Code: Pascal  [Select][+][-]
  1.  root@DEB11IDE:/NAS/TEST# ls -l
  2. total 573
  3. -rwxrwxrwx 1 pi pi 577296 May 20 20:32 test0
  4. -rwxrwxrwx 1 pi pi   4696 May 20 20:32 test0.o
  5. -rwxrwxrwx 1 pi pi    151 May 20 09:43 test0.pas
  6.  

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #18 on: May 20, 2022, 09:44:27 pm »
I'm uncomfortable to see you running as root. This is not the recommended way of working, it can mess up GUI-oriented software (including introducing security vulnerabilities) and also have an impact on remote file mounts.

(And please fix your broken formatting, and you might find the "Modify" button useful when you want to add e.g. a list of files).

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 #19 on: May 21, 2022, 04:59:03 pm »
Yes, that one works:

Okay, great. Next step: would you please share the command line that Lazarus generates for your project, maybe that will give a hint what goes wrong? You can get that in the project's settings using the button “Show settings” (or similar, I'm using the German version) and then the content of the tab “Command line arguments” (or similar).

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #20 on: May 21, 2022, 07:10:44 pm »
Thank you for beeing available to help.

I was running the IDE from a terminal window.
Then I have set the project_options|verbosity to "show all"
And have copied the terminal output to the file cpl_msg1.txt (this is compiling the source from the share)

Next I did the same but compiling the source from the local file system, the output is in cpl_msg2.txt
« Last Edit: May 22, 2022, 08:56:34 am by sporex »

sporex

  • New Member
  • *
  • Posts: 39
Re: Raspberry with source directory on a windows share
« Reply #21 on: June 04, 2022, 11:31:12 am »
After being discouraged for a while I have resumed trying to compile from the shared folder.
What I found out is this:

-1) I create the source file test.pas and make a copy test.bak
-2) I try to compile test.pas and I am getting "begin expected but end of file found" and test.pas on the share is 0byte
-3) Then I copy test.bak > test.pas and try to recompile
-4) I get "source file has changed on disk," and I chose "reload checked file from disk"
- And now it compiles

After step-2) I get the following files in the shared folder /src

Code: Pascal  [Select][+][-]
  1. - /src/backup/test.pas
  2. - /src/lib/aarch64-linux/test.compiled
  3. - /src/test.lpi
  4. - /src/test.lps  

After step -4) I get additionally:
Code: Pascal  [Select][+][-]
  1. - /src/lib/aarch64-linux/test.o
and of course the executable /src/test

I suppose there must be any setting in the IDE options that must be changed.
Only what is it? I made no changes to the default config.
« Last Edit: June 04, 2022, 11:35:16 am by sporex »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #22 on: June 04, 2022, 12:11:55 pm »
So going back through the thread:

a) You're using CIFS.

b) Are you still running on the client as root?

c) Have you tried using Lazbuild yet?

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 #23 on: June 04, 2022, 12:37:31 pm »
Hello Mark
thank you for remembering this topic

a) yes I am using cifs

b) no, this time i ran it as user pi

c)
Code: Pascal  [Select][+][-]
  1. lazbuild -B /NAS/TEST/test1.pas
  2. Error: (lazbuild) don't know how to build: /NAS/TEST/test.pas  

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #24 on: June 04, 2022, 12:43:42 pm »
Lazbuild expects a .lpi ("Lazarus Project Information").

If you were building a simple "Hello, World!" console program which didn't have a .lpi you'd simply use fpc to compile the .pas... I've just done that over a CIFS share from a PC client and am about to try Lazarus.

Very slightly later: Definitely no problem using Lazarus 2.2.0 with FPC 3.2.2.

Client system running Debian "Stable" (i.e. the OS that yours is derived from) but x86_64 rather than ARM... I'd not expect that to be an issue.

Running mount describes the connection as

Code: [Select]
//192.168.0.72/guest on /home/markMLl/srv/gooey.guest type cifs (rw,nosuid,nodev,relatime,vers=2.0,cache=strict,username=guest,domain=XXXXXXXX,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.0.72,file_mode=0755,dir_mode=0755,soft,nounix,mapposix,noperm,rsize=65536,wsize=65536,echo_interval=60,actimeo=1,user=markMLl)

derived from this in .etc.fstab

Code: [Select]
//192.168.0.72/guest    /home/markMLl/srv/gooey.guest   cifs    noauto,user,username=guest,guest,workgroup=XXXXXXXX,vers=2.0,noperm     0       0

One thing I'd emphasise is that I accessed the project from a fixed mountpoint off my home directory, rather than via a desktop file manager or something under the "Places" list of a save-as dialogue or similar... the naming there might depend on what widget set's been used to build your IDE.

I don't think this is an IDE issue, it's down to either how your OS is setting up mounts, or the configuration and capabilities of your NAS.

MarkMLl
« Last Edit: June 04, 2022, 12:59:49 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 #25 on: June 04, 2022, 01:22:14 pm »
Alright, then I will have to inquire the mount options. This is mine:
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 fstab is like that:
Code: Pascal  [Select][+][-]
  1. //192.168.2.126/PINAS/RASPI     /NAS    cifs    credentials=/etc/.credentials,uid=pi,gid=pi,file_mode=0777,dir_mode=0777

I will try to mount the share manually and get back with the result.
THX Mark

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #26 on: June 04, 2022, 01:44:17 pm »
Getting mount options right- particularly for networked shares and most particularly for SMB/CIFS- is arguably more difficult than it needs to be. But the bottom line is that all of the possible options are there for a reason.

I speculate that /if/ your NAS were based on "a unix" and /if/ you could get a shell session you'd find (using ls -i) that when Lazarus saved a file it first renamed the original to .bak or similar and then created a new one, and that under certain circumstances the client system is seeing the new one cached before anything has actually been written to it. That rename-create is longstanding unix doctrine with the intention of limiting the extent to which a less-privileged user can overwrite the work of a more-privileged one, and can be contrasted with the Windows convention of doing a copy-overwrite. If that's what's really happening, then it's a NAS (or possibly client library) bug.

You /might/ find that telling the IDE to not create a backup (Tools -> Options -> Environment -> Backup) changes that behaviour: arguably, if it's told to create no backup then it should be overwriting the same file in-situ rather than creating a new one.

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 #27 on: June 04, 2022, 11:32:06 pm »
Good evening Mark,
I will give up.
What I am going to do is:
- create a debian11 32 bit images for the units for which I want to roll out the SW
- use the debian8 image that I have for the IDE in order to maintain/modify the existing applications that I am distributing to the units
- I suppose there will be no hitch (jessie/bullseye) as long as it's 32bit
My only concern is that jessie is end-of-life and only compatible with RPi up to Ver.3B (not Ver.3B+) and the hardware will also be phased-out by 2023 as I learn

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Raspberry with source directory on a windows share
« Reply #28 on: June 05, 2022, 09:30:46 am »
Good evening Mark,
I will give up.
What I am going to do is:
- create a debian11 32 bit images for the units for which I want to roll out the SW
- use the debian8 image that I have for the IDE in order to maintain/modify the existing applications that I am distributing to the units
- I suppose there will be no hitch (jessie/bullseye) as long as it's 32bit
My only concern is that jessie is end-of-life and only compatible with RPi up to Ver.3B (not Ver.3B+) and the hardware will also be phased-out by 2023 as I learn

In any event, always test thoroughly. There's always a risk of incompatibility at the library level.

Otherwise, set up a local Subversion etc. server. I think one's available as a Debian package, but otherwise it's easy enough to build particularly if you stick to the native svn protocol rather than trying to integrate with Apache.

Jessie really is getting on a bit by now, and isn't one of those releases for which there were compelling reasons to not upgrade: I'd cite Lenny as being one of those, since some targets were either dropped immediately afterwards, or their quality dropped as people lost interest (SPARC as a particular example). I've had some degree of success with in-situ upgrades, but I usually find redoing from scratch fairly painless since for many years I've been running a script which logs what gets installed manually. See https://github.com/MarkMLl/installed-package-list

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