[Haskell-cafe] Yi on Windows

Peter Marks peter at indigomail.net
Wed Oct 13 19:14:44 EDT 2010

The problem is down to getAppUserDataDirectory called in Yi.Boot. This
function behaves differently on Windows to Linux... and more so on Windows
7. The first issue is that on Windows it doesn't prepend the "." to the
directory name, so it is looking in "yi", not ".yi". On Windows 7, it looks
for this directory in a completely different location:
"C:\Users\peter\AppData\Roaming" rather than just "C:\Users\peter".

Obviously other parts of the program are using a different call to locate
the config file as, letting the editor create the default file, it places it
in "C:\Users\peter\.yi\yi.hs"! I can't find the code that does this at the
moment - any pointers appreciated.

My current feeling is that getAppUserDataDirectory is the correct call to
use and the docs should be changed to tell users to put their file where
this call points. Further, it would be nice if the editor told you where it
was looking if it doesn't find a config file... well actually, when it does
find a file too, so you know which one it loaded.

Now I'm on to the next problem, it tries to write its error file in a
location that doesn't exist: "C:\Users\peter\Local
Settings\Cache\yi\errors.log". "Local Settings" doesn't exist on Windows 7.
This is now "AppData\Local" I think. Setting the cacheDir field of the dyre
Params should fix this, but I don't have time to try it right now.

I'll let you know how I get on.


On 13 October 2010 22:31, Jeff Wheeler <wheele11 at illinois.edu> wrote:

> On Wed, Oct 13, 2010 at 2:54 AM, Peter Marks <peter at indigomail.net> wrote:
> > What should I see when Yi loads? If my config file is broken, where
> should I
> > see errors? The debug option didn't produce anything useful.
> I'd expect it in one of three places:
> 1. In a buffer inside Yi when it launches using the default config.
> (I'm guessing this isn't the case for you if you haven't seen the
> error messages, but it'd be in a buffer called "*errors*" if present.
> It theoretically should open as the default buffer.)
> 2. I don't think this should happen, but dyre /may/ make a file
> yi.errors in ~/.yi/, next to your config file.
> 3. It might just print it to the console, but that's not happening
> here, or you would have seen it.
> > After starting up, the help option does open my config, so I think it is
> in
> > the right place. This is Windows 7 if that makes any difference.
> I'm not sure; I've never tried installing much Haskell on my Windows
> machine, so I haven't tested Yi on it. I think somebody worked on it a
> while back, but I'm not sure if they succeeded (or if it still
> theoretically works).
> > I'm happy to take a look at the source, any suggestions where I should
> > start?
> Interfacing with the dyre config loader occurs in src/Yi/Boot.hs, but
> there's also some interesting stuff related to starting up in
> src/Yi/Main.hs. The dyre package provides the primary entry-point, and
> calls Yi.Main.main with the relevant config when it's ready to start.
> Yi.Boot instructs dyre on how to work with configs for yi.
> Best of luck, and thanks for playing with Yi!
> -Jeff
> --
> Jeff Wheeler
> Undergraduate, Electrical Engineering
> University of Illinois at Urbana-Champaign
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20101013/8df48a51/attachment.html

More information about the Haskell-Cafe mailing list