[MLton] Re: [MLton-commit] r6699

Wesley W. Terpstra wesley at terpstra.ca
Wed Jun 17 17:52:22 PDT 2009


On Wed, Jun 17, 2009 at 9:47 PM, Matthew Fluet<fluet at tti-c.org> wrote:
> Cygwin most definitely "lies" when providing the result for
> Posix.ProcEnv.environ.  There seem to be a number of environment variables
> that Cygwin translates between Windows paths and Cygwin paths:

You make it sound like these cygwinify and uncygwinify functions are
easy to use. Maybe we should consider uncygwinifying the name of the
executable passed to CreateProcess? At the moment everything else in
MLton (file/dir open, exec/spawn, ...) uses cygwin paths, but
Process.create does not.

> The Cygwin spawnv{,p}e functions only replicate the given environment
> variables (but do uncygwinify the paths of select variables) and construct
> an explicit environment for use as lpEnvironment for the underlying
> CreateProcess call.
>
> Another option would be to mimic Cygwin's implementation of spawnv{,p} and
> uncygwinify the paths of select variables from Posix.ProcEnv.eviron;

This sounds like a good idea to me.

> it's just not documented which variables.

The cygwin installer can also grab source code for packages. Whichever
package builds cygwin1.dll must mention these special paths.
Alternatively, run 'strings' on cygwin1.dll and look for paths you
know are translated and see which other strings are nearby?



More information about the MLton mailing list