[M3devel] more path stuff, sorry
Jay
jayk123 at hotmail.com
Tue Apr 22 06:19:52 CEST 2008
There's no dependency, no linkage. Just a few simple string operations.
I'll probably remove it tonight.
Modula-3 has a split personality no matter what, in that it calls into very varying underlying layers, often trafficing in their specific data formats.
It's just that it can strive to aid portability between them or not, by accepting either input and massaging it to work, vs. passing it along "unchanged" (well, that's not what happens actually). If there were no ambiguous cases and the Posix systems on Windows were consistent in their conventions, I'd be more for it. But the ambiguity and varying Posix conventions weaken the case tremendously.
- Jay
Date: Mon, 21 Apr 2008 23:14:00 -0400From: rcoleburn at scires.comTo: m3devel at elegosoft.comSubject: Re: [M3devel] more path stuff, sorry
I concur wholeheartedly. I absolutely DO NOT want native NT386 to have any knowledge of or dependency on Cygwin.
Regards,
Randy>>> Tony Hosking <hosking at cs.purdue.edu> 4/21/2008 9:44 PM >>>
Why would native NT386 know anything at all about Cygwin. I say just avoid split personalities like the plague. Similarly, I'd be happy for NT386GNU (i.e., Cygwin?) to simply behave like a POSIX build (modulo native threads perhaps).
On Apr 21, 2008, at 7:15 PM, Jay wrote:
Maybe this is dubious.The question is, like, should native NT386 cm3 accept /cygdrive/c/foo and translate to c:\foo?Or trickier, /usr/bin/foo and translate to c:\cygwin\usr\bin\foo?And vice versa, should NT386GNU accept c:\foo?The translation is not simple in general./ maps to the Cygwin install root.There can be symlinks.But many common cases can be handled with little, simple code.It's already in.Ultimately the way to do this correctly is to link to cygwin1.dll, which is only done sometimes, and which probably license-undesirable when not done.As well, a path like /foo is actually ambiguous.It is a valid native Win32 path, equivalent to \foo.Or it could be Cygwin path requivalent to c:\cygwin\foo.While it is nice to keep cm3 simple, it is also nice to have a more uniform interfaceacross hosts, I think. Maybe.To some extent a user can do this himself.That is, NTFS junctions and/or Cygwin symblinks can cause their to be identical pathswith identical meanings:e.g. for me, symlink /msdev => c:\msdev, /cm3 => c:\cm3 /dev => c:\dev2In some places Cygwin open et. al. accept Win32 paths, but lately taking advantage ofthat issues a warning. In some places, I think, it isn't sufficient to have Cygwin handle it.The harder question then is, if I feed Cygwin paths of a particular form, should ittry to report back paths in the same form?I put some code in M3Path.m3 "like this", but it may not be advisable.I also had an NTFS junction on my system so Win32 /cygdrive/c => c:\, but this causesa circularity in the file system, which I'd rather not have.As well, there are at least three or four Posix runtimes for Windows, and they each mapdifferently.UWin I think uses /c <=> c:\.Cygwin /cygdrive <=> c:\Interix/ServicesForUnix/SUA I think something via /dev.MinGWin also has a runtime that I think uses the UWin mapping, but this runtime is onlymeant for sh/gcc to use, not user apps.Having special code that only knows the Cygwin convention is questionable. I was often setting up some environment variables one way or the other, and thenrunning one cm3 or the other, without thinking about which form the variables were in.Indeed, it might be nice to set CM3_ROOT and CM3_INSTALL "once and for all",while still switching between different forms of cm3.exe?Though granted, CM3_INSTALL cm3.exe can usually figure out from its own path, andCM3_ROOT could usually be figured out by looking at the CVS directories in the currentworking directory, not always, but often. Basically, instead of setting these variblesone way or the other, I'd like to set them always one way, or even not at all.Hm, in fact, I think cm3 could figure out all overrides itself?You know, if there is a shipped package store, it can use that to determine the source <=> pkg mapping.And it can figure out CM3_ROOT by looking at the current directory and on up until the CVS/Rootchanges? As well, you know, the source <=> pkg mapping could be a simple generated checked in file.You know, like the PKGS file, but stripped down to only what is needed? Maybe just remove the code I put in and forget the whole thing.Maybe most people only ever stay in one of the worlds and "translation" isn't important?Just me stuck with providing support for both and therefore living with both more? - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20080422/1fc64552/attachment-0002.html>
More information about the M3devel
mailing list