Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-02

Developing on Linux with files on Windows NTFS

25 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Donald Ziesig

Hi All!

I have been trying to develop a multi-platform app with the IDE on Linux (MInt) and the source files on a Windows NTFS partition. I build and test on windows but my primary work is done on linux so I don't stay logged in to windows very long.

The problem I am having is that the Linux version of the IDE seems to get confused by windows time stamps (at least that's what the symptoms suggest). When I save an edited file (either code or form), the IDE frequently (but not always) opens a copy of that file in a separate tab and complains when I edit and save one of the two instances. It sometimes deletes the most recent edit, other times the obsolete file.

I haven't found a windows driver for ext4 that doesn't warn of potential corruption of the ext4 file system, otherwise I would develop with the source on linux and occasionally build on windows.

One alternative is to keep the master source on linux and copy it all to NTFS when I build/test on windows, but that has its own set of issues.

Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it?

Thanks,

Don Ziesig
'

Reply by email

Sergei Gorelkin
to Donald Ziesig

05.02.2015 18:53, Donald Ziesig ?????:

Show quoted text 21 lines
Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt) and the source files on a Windows NTFS partition. I build and test on windows but my primary work is done on linux so I don't stay logged in to windows very long. The problem I am having is that the Linux version of the IDE seems to get confused by windows time stamps (at least that's what the symptoms suggest). When I save an edited file (either code or form), the IDE frequently (but not always) opens a copy of that file in a separate tab and complains when I edit and save one of the two instances. It sometimes deletes the most recent edit, other times the obsolete file. I haven't found a windows driver for ext4 that doesn't warn of potential corruption of the ext4 file system, otherwise I would develop with the source on linux and occasionally build on windows. One alternative is to keep the master source on linux and copy it all to NTFS when I build/test on windows, but that has its own set of issues. Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it?

I've been developing this way since roughly year 2009, using several versions of 64-bit Ubuntu and 32-bit Slackware. Never had an issue with timestamps that you describe. Just works out of the box.

Regards,
Sergei

Reply by email

Mattias Gaertner
to Donald Ziesig: Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt)…
Show quoted text 12 lines
Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt) and the source files on a Windows NTFS partition. I build and test on windows but my primary work is done on linux so I don't stay logged in to windows very long. The problem I am having is that the Linux version of the IDE seems to get confused by windows time stamps (at least that's what the symptoms suggest). When I save an edited file (either code or form), the IDE frequently (but not always) opens a copy of that file in a separate tab and complains when I edit and save one of the two instances.

This means the IDE thinks these are two separate files. For example when you mount a case insensitive file system (FAT, NTFS, Samba share) under Linux, the IDE does not know and assumes it is case sensitive. For the Linux IDE the file 'a.pas' and 'A.pas' are two different files.
Note: Some functions of IDE uses heuristics to figure out such cases, but not all.

Show quoted text 11 lines
It sometimes deletes the most recent edit, other times the obsolete file. I haven't found a windows driver for ext4 that doesn't warn of potential corruption of the ext4 file system, otherwise I would develop with the source on linux and occasionally build on windows. One alternative is to keep the master source on linux and copy it all to NTFS when I build/test on windows, but that has its own set of issues. Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it?

I strongly recommend to use a version control system like svn, git, etc. Not only will it handle OS differences (e.g. line endings, access rights), it gives you backups and diffs.

If you want to use a shared filesystem, then make all file names and uses sections lower case.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
> > suggest). When I save an edited file (either code or form), the IDE > > frequently (but not always) opens a copy of that file in a separate tab > > and complains when I edit and save one of the two instances. This means the IDE thinks these are two separate files. For example when you mount a case insensitive file system (FAT, NTFS, Samba share)

Just a thought...

I've had a similar issue years back - at least it sounds similar. But that was due to the fact that I used symlinks to folders under Linux. The IDE got confused between the true path and the symlink path - always thinking they are two separate files.

As the others suggested, I would rather setup a (bare) Git repo as a common share between Linux and Windows.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Mehmet Erol Sanliturk
to Donald Ziesig: Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt)…
Donald Ziesig wrote 31 lines
Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt) and the source files on a Windows NTFS partition. I build and test on windows but my primary work is done on linux so I don't stay logged in to windows very long. The problem I am having is that the Linux version of the IDE seems to get confused by windows time stamps (at least that's what the symptoms suggest). When I save an edited file (either code or form), the IDE frequently (but not always) opens a copy of that file in a separate tab and complains when I edit and save one of the two instances. It sometimes deletes the most recent edit, other times the obsolete file. I haven't found a windows driver for ext4 that doesn't warn of potential corruption of the ext4 file system, otherwise I would develop with the source on linux and occasionally build on windows. One alternative is to keep the master source on linux and copy it all to NTFS when I build/test on windows, but that has its own set of issues. Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it? Thanks, Don Ziesig ' --

Create two different directories :

One for Windows executable having a *.lpr , *.lpi , other for Linux executable having a *.lpr , *.lpi ( at the beginning copy of another ( with a minimum of sources )) ,

and a third directory containing sources .

In Windows , use Windows related directory
in Linux , use Linux related directory , for your *.lpr , *.lpi files in their own directories .

In that way , by using a common source directory , you may generate executables which compilations do not interfere with each other .

In your common sources , it may be necessary to insert $ifdef statements to allow parts with respect to operating systems .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150205/294c8b5e/attachment.html>

Reply by email

Sven Barth
to Mattias Gaertner: On Thu, 05 Feb 2015 10:53:40 -0500 This means the IDE thinks these are two separate…
"Mattias Gaertner" wrote 25 lines
On Thu, 05 Feb 2015 10:53:40 -0500 Donald Ziesig wrote: > Hi All! > > I have been trying to develop a multi-platform app with the IDE on Linux > (MInt) and the source files on a Windows NTFS partition. I build and > test on windows but my primary work is done on linux so I don't stay > logged in to windows very long. > > The problem I am having is that the Linux version of the IDE seems to > get confused by windows time stamps (at least that's what the symptoms > suggest). When I save an edited file (either code or form), the IDE > frequently (but not always) opens a copy of that file in a separate tab > and complains when I edit and save one of the two instances. This means the IDE thinks these are two separate files. For example when you mount a case insensitive file system (FAT, NTFS, Samba share) under Linux, the IDE does not know and assumes it is case sensitive. For the Linux IDE the file 'a.pas' and 'A.pas' are two different files. Note: Some functions of IDE uses heuristics to figure out such cases, but not all.

One could check whether the distro mounts NTFS as case sensitive or not. By default at least ntfs-3g mounts it as case sensitive. Maybe the thread starter is using the in-kernel driver, I don't know what that one does. Further info about ntfs-3g's options: http://linux.die.net/man/8/ntfs-3g

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150205/c101511c/attachment.html>

Reply by email

Gustavo Enrique Jimenez
to Donald Ziesig: Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt)…
Show quoted text 6 lines
Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it? Thanks, Don Ziesig

I use a real machine with Linux and a virtual machine with Windows. I boot to a real Windows only when I have to test custom USB hardware. A years ago I use a virtual machine with SVN on Linux. The virtual machine files were hosted on a NTFS partition visible from a real Linux with Virtualbox and a real Windows with Virtualbox. That way it was posible to access the source code from both Linux and Windows.

Gustavo

Reply by email

John Landmesser
to Donald Ziesig: Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt)…
Donald Ziesig wrote 34 lines
Hi All! I have been trying to develop a multi-platform app with the IDE on Linux (MInt) and the source files on a Windows NTFS partition. I build and test on windows but my primary work is done on linux so I don't stay logged in to windows very long. The problem I am having is that the Linux version of the IDE seems to get confused by windows time stamps (at least that's what the symptoms suggest). When I save an edited file (either code or form), the IDE frequently (but not always) opens a copy of that file in a separate tab and complains when I edit and save one of the two instances. It sometimes deletes the most recent edit, other times the obsolete file. I haven't found a windows driver for ext4 that doesn't warn of potential corruption of the ext4 file system, otherwise I would develop with the source on linux and occasionally build on windows. One alternative is to keep the master source on linux and copy it all to NTFS when I build/test on windows, but that has its own set of issues. Has anyone had any success in using common storage for multi-platform source code? If so, how do you do it? Thanks, Don Ziesig ' -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

i do it your way too, no problems!

in fstab ( Debian, sid ) i have these settings

ntfs-3g defaults,auto,users,locale=de_DE.utf8,exec

Reply by email

Mark Morgan Lloyd
to Felipe Monteiro de Carvalho: I would use svn to synchronize 2 copies, 1 in linux and 1 in windows. www.assembla.com…
Felipe Monteiro de Carvalho wrote
I would use svn to synchronize 2 copies, 1 in linux and 1 in windows. www.assembla.com offers free "Repo only" svn hosting.

I agree. A (local) subversion server is no big deal, in fact I started using svn specifically so that I could quickly get at files from any system (Linux, Windows, Solaris) with the version-control aspect being secondary.

Subversion is a bit like Perl and Kermit: it's been ported to an implausible number of systems. But if you only need it locally and for some reason want or need to build it from source, there are far fewer dependencies if you drop http: and stick to the svn: protocol.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Donald Ziesig
to Mark Morgan Lloyd

Thanks to all who responded to my plea for help with multi-platform development.

It seems that I was mistaken about the time-stamps causing the problems I encountered. The problems were caused by the fact that Lazarus for Linux wants case sensitive file names and the NTFS driver I was using was case insensitive. The erroneous behavior that I was seeing was due to capitalization in unit names, not time-stamps.

The solution (as suggested by John Landmesser) was to use ntfs-3g (I put it into fstab and added my own uid/gid to avoid permission problems. fstab would not have been the proper solution if there were more than one user on the computer). I also took the suggestion to use separate directories for the windows and linux project files. This separated the object and executable files between the two systems as well.

I also found a windows driver for ext4 that does not corrupt the ext4 file system. It is available from Paragon Software (free for personal use, reasonably priced for commercial use).

It was suggested that I use svn for file sharing between windows and linux. I actually use git for all my source control, but it did not solve the mixed case file name issue that was actually causing my problem between the two OSes.

Again, many thanks for all the great help.

Don Ziesig

Reply by email

Luca Olivetti
to Donald Ziesig

El 07/02/15 a les 02:18, Donald Ziesig ha escrit:

one user on the computer). I also took the suggestion to use separate directories for the windows and linux project files. This separated the object and executable files between the two systems as well.

This shouldn't be necessary, just set

lib/$(TargetCPU)-$(TargetOS)

in the "Unit output directory (-FU)", under Project->Project options->Compiler options->Paths

(which should be the default).

Bye

Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007

Reply by email

Mehmet Erol Sanliturk
to Luca Olivetti
Luca Olivetti wrote 26 lines
El 07/02/15 a les 02:18, Donald Ziesig ha escrit: > one user on the computer). I also took the suggestion to use separate > directories for the windows and linux project files. This separated the > object and executable files between the two systems as well. This shouldn't be necessary, just set lib/$(TargetCPU)-$(TargetOS) in the "Unit output directory (-FU)", under Project->Project options->Compiler options->Paths (which should be the default). Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es Tel. +34 935883004 Fax +34 935883007 -

If there is no change :

.lpi files are saved with respect to OS , means on each save , .lpi file of other OS is broken .

During load of .lpi files , OS difference is not taken into account .

Therefore , .lpi files should be maintained in respective OS directories .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150207/f141e8c2/attachment.html>

Reply by email

Felipe Monteiro de Carvalho
to Donald Ziesig: Thanks to all who responded to my plea for help with multi-platform development. It seems…
Donald Ziesig wrote
It was suggested that I use svn for file sharing between windows and linux. I actually use git for all my source control, but it did not solve the mixed case file name issue that was actually causing my problem between the two OSes.

I always have all my source files lowercase. In my company (where they dont use Pascal) they also do it like that, so I guess its a general problem.

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk: If there is no change : .lpi files are saved with respect to OS , means on each save ,…
Show quoted text 9 lines
[...] If there is no change : .lpi files are saved with respect to OS , means on each save , .lpi file of other OS is broken . During load of .lpi files , OS difference is not taken into account . Therefore , .lpi files should be maintained in respective OS directories .

I don't understand. All 352 lpi files of the Lazarus sources are used cross platform. Why does it not work for yours?

Mattias

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Sat, 7 Feb 2015 07:40:06 -0800 Mehmet Erol Sanliturk wrote: >[...] > If there is no change : > > .lpi files are saved with respect to OS , means on each save , .lpi file of > other OS is broken . > > During load of .lpi files , OS difference is not taken into account . > > Therefore , .lpi files should be maintained in respective OS directories . I don't understand. All 352 lpi files of the Lazarus sources are used cross platform. Why does it not work for yours? Mattias --

OS differences are not the .lpi XML file format , but file names of the project related source file names .

Some years ago , even I have sent a message to Lazarus mailing list about that issue .

In the same directory , for example , in an NFS directory :

When an .lpi file is loaded in an OS , file names recorded in other OSes are causing trouble .
During save of an .lpi file , Lazarus is saving the .lpi file in its current OS structure , by breaking the .lpi for the other OSes .

To prevent such a conflict , it is necessary to introduce into .lpi file name components a new field :
<operating_system = "..." />

During loading an .lpi file ALL of the components should be loaded , and relevant ones to OS should be used ( the other should be kept and any message should not be issued about them ) , and on save , ALL of the components should be saved with changes applied only to current OS components .

Since there is no such a structure , it is necessary to use different directories and .lpi files for the same project with common source directories ( with different compiled parts directories ) .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150207/f107d26d/attachment-0001.html>

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk
Show quoted text 5 lines
[...] In the same directory , for example , in an NFS directory : When an .lpi file is loaded in an OS , file names recorded in other OSes are causing trouble .

For example?

During save of an .lpi file , Lazarus is saving the .lpi file in its current OS structure , by breaking the .lpi for the other OSes .

For example?

Mattias

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner
Mattias Gaertner wrote 23 lines
On Sat, 7 Feb 2015 17:45:58 -0800 Mehmet Erol Sanliturk wrote: >[...] > In the same directory , for example , in an NFS directory : > > When an .lpi file is loaded in an OS , file names recorded in other OSes > are causing trouble . For example? > During save of an .lpi file , Lazarus is saving the .lpi file in its > current OS structure , by breaking the .lpi for the other OSes . For example? Mattias -- _______________________________________________

To use a same source tree from different operating systems , it is necessary to use a server , such as NFS ( which is located on a Unix server , I could not create a NFS server in Windows ) .

To access from Windows to a NFS server , it is necessary to use a Samba server in the NFS server ( I could not create a NFS client in Windows ) .

The above structure means , the same source files are in "different" locations in different client computers with respect to mount points ( for example , in Linux /home/... , in FreeBSD /usr/home/... , in Windows H:\... ) .

When the SAME .lpi is loaded in an operating system which is containing file names set in another operating system is producing error messages during loading because there is no such files in that operating system .

Assume , "incorrect" file names are when loaded , and saved .

Another operating system is starting to give error messages during loading the same .lpi file , because it is not able to find the specified files because there is no any such directories in itself .

To remedy this mix up is to use different directories and .lpi files with respect to operating systems for the same source tree .

Another remedy may be to use a "Web site" instead of an NFS server in the server and use URL for file names in everywhere such as .lpi , units and .cfg files similar to Go language . Such a facility will also allow use of sources staying in any web server at the same source tree .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150208/fb74dee3/attachment.html>

Reply by email

Bart
to Mehmet Erol Sanliturk
Mehmet Erol Sanliturk wrote
The above structure means , the same source files are in "different" locations in different client computers with respect to mount points ( for example , in Linux /home/... , in FreeBSD /usr/home/... , in Windows H:\... ) .

You should not have absolute paths in your .lpi.
None of my project have and they build without modification on all targets.

Bart

Reply by email

Mehmet Erol Sanliturk
to Bart
Bart wrote 17 lines
On 2/8/15, Mehmet Erol Sanliturk wrote: > The above structure means , the same source files are in "different" > locations in different client computers with respect to mount points ( for > example , in Linux /home/... , in FreeBSD /usr/home/... , in Windows H:\... > ) . You should not have absolute paths in your .lpi. None of my project have and they build without modification on all targets. Bart -- _______________________________________________

Some file names are generated by Lazarus as complete paths . Therefore , they are not related to relative paths .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150208/b56ad768/attachment.html>

Reply by email

Donald Ziesig
to Mehmet Erol Sanliturk: Some file names are generated by Lazarus as complete paths . Therefore , they are not…

There is still one residual problem. Right now I am developing and testing on Linux with the files on NTFS using ntfs-3g with case sensitive file names. Everything seems to be ok until I get a compilation error at which point I get two editor windows pointing to the same file with tabs showing:

MyFile MyFile(2)

If I re-compile, a window pops up telling me that the file on disk has changed and asking if I would like to reload. If I press reload I get the modified file, else I get the file from before the compilation error. Strangely, the compilation error will re-occur even with the modified file showing in the source editor and the unmodified file closed in the source editor. It doesn't seem to matter if I use "file-contents" or "file timestamp" to determine the modification state of the file. Also, I have looked on the disk and see only the MyFile.pas, never MyFile(2).pas.

There is a simple work-around (which might give someone a clue as to the cause). If I explicitly save the modified files before starting compilation the problem never occurs. (I just have to remember to do it ;-) ).

This never occurs when the files are on the Linux ext4 file system.

Don Ziesig

Reply by email

Mehmet Erol Sanliturk
to Mattias Gaertner: On Sun, 8 Feb 2015 06:40:39 -0800 For example? Mattias

On Sun, Feb 8, 2015 at 10:41 AM, Mattias Gaertner <

Show quoted text 16 lines
wrote: On Sun, 8 Feb 2015 06:40:39 -0800 Mehmet Erol Sanliturk wrote: >[...] > Some file names are generated by Lazarus as complete paths . For example? > Therefore , they are not related to relative paths . Mattias --

For a long time , I am not using a common .lpi file for different operating systems ,
but I files in different operating systems (
FreeBSD , Linux , Windows ) ,
they are containing

"/usr/home/..."
"/home/.../"
"H:\..."

which I never write them myself , because I am always using relative paths in everywhere including
unit source file includes : {$I ../.. ... } .

Since a very long time , I am never using \ in file names started in Windows .

I do not know internals of Lazarus , I do not know when it is generating such file names and why .

Thank you very much .

Mehmet Erol Sanliturk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150208/fbce756d/attachment.html>

Reply by email

Marc Weustink
to Donald Ziesig: There is still one residual problem. Right now I am developing and testing on Linux with…
Donald Ziesig wrote 7 lines
There is still one residual problem. Right now I am developing and testing on Linux with the files on NTFS using ntfs-3g with case sensitive file names. Everything seems to be ok until I get a compilation error at which point I get two editor windows pointing to the same file with tabs showing: MyFile MyFile(2)

This has to do with the difference between the path of the opened file and the path reported by the compiler.

This one I've never seen, but when debugging I had te same when gdb reports its paths.

Try to find out if tere is a difference in casing between the 2 files

Marc

Reply by email

Mattias Gaertner
to Mehmet Erol Sanliturk: On Sun, Feb 8, 2015 at 10:41 AM, Mattias Gaertner < For a long time , I am not using a…
Show quoted text 10 lines
[...] For a long time , I am not using a common .lpi file for different operating systems , but I files in different operating systems ( FreeBSD , Linux , Windows ) , they are containing "/usr/home/..." "/home/.../" "H:\..."

These are probably from you session data, which you can store separately (Project Options / Session / Save session information).

For projects using svn or git choose "Save lps in project directory".
For projects using shared mounts, choose "Save lps in IDE config directory".

New projects are created with the first option (project directory).

Mattias

Reply by email