wren-cli icon indicating copy to clipboard operation
wren-cli copied to clipboard

Trouble with modules

Open petelomax opened this issue 5 years ago • 9 comments

I've just downloaded wren (hi!), but I can't get any modules to load:

Could not load module 'E:\E:/downloads/misc/wren/wren_cli-windows-0.3.0/pattern'.

Where I'm using import "/pattern" for Pattern and the pattern.wren off rosettacode. It does not matter where I put it, it ain't ever getting past that "E:\E:/" (as proved with procmon). Running on windows 10

Pete

petelomax avatar Sep 15 '20 15:09 petelomax

Currently, modules are loaded from a "wren_modules" directory from the first parent directory, relative to PWD or script path (I don't remember exactly).

mhermier avatar Sep 15 '20 15:09 mhermier

Yep, already tried that. If I change the first line to import "pattern" for Pattern, and create \wren_modules\pattern\pattern.wren (just in case), it still fails this time just saying Could not load module 'pattern'. and procmon identifies the actual error as:

E:\E:\downloads\misc\wren\wren_cli-windows-0.3.0\wren_modules\pattern\pattern.wren

I also tried import "\\pattern" for Pattern, and the error just goes back to "E:\E:/".

petelomax avatar Sep 15 '20 15:09 petelomax

I don't have windows to test it easily, it might be there is a problem in path somehow seeing that the drive is duplicated.

mhermier avatar Sep 15 '20 18:09 mhermier

Ah! It works when in the same directory, but not elsewhere.

In other words if pwd yields E:\downloads\misc\wren\wren_cli-windows-0.3.0 and I run wren_cli-0.3.0.exe test.wren, but not for E:\downloads\misc\wren\wren_cli-windows-0.3.0\wren_cli-0.3.0.exe E:\downloads\misc\wren\wren_cli-windows-0.3.0\test.wren

In fact the latter command does not work even when I am in the right directory.

petelomax avatar Sep 15 '20 21:09 petelomax

Probably a platform issue, windows has an odd notion of pwd of execution...

mhermier avatar Sep 16 '20 09:09 mhermier

OK, this is now the lowest possible priority, but next time you get a chance, it really shouldn't mangle path names like that. Cheers.

petelomax avatar Sep 16 '20 11:09 petelomax

As this is a CLI issue, it has been moved to the CLI repo.

ruby0x1 avatar Sep 16 '20 15:09 ruby0x1

@petelomax Can you confirm you still have an issue on the latest code? (we just bumped to 0.4.0)

joshgoebel avatar Apr 26 '21 08:04 joshgoebel

Sorry, there is no release as yet for me to test at https://github.com/wren-lang/wren-cli/releases The latest build there is still from June 5th 2020 (I'm a bit backward that way!)

petelomax avatar Apr 26 '21 10:04 petelomax