[M3devel] more path stuff, sorry

Jay jayk123 at hotmail.com
Tue Apr 22 01:15:05 CEST 2008


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:\dev2
In 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/Root
changes?
 
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/20080421/19c1d07b/attachment-0001.html>


More information about the M3devel mailing list