Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

elm-make creates spurious folder C:\dev with --output /dev/null on Windows #166

Open
LukeWoodward opened this issue Jun 16, 2017 · 2 comments

Comments

@LukeWoodward
Copy link

LukeWoodward commented Jun 16, 2017

Sample run, starting with the directory not existing:

C:\Users\Luke\Elm>dir C:\dev\
The system cannot find the file specified.

C:\Users\Luke\Elm>elm-make --output /dev/null Zero.elm
Success! Compiled 1 module.
Successfully generated /dev/null

C:\Users\Luke\Elm>dir C:\dev\
 Volume in drive C is Windows7
 Volume Serial Number is F399-C363

 Directory of C:\dev

16/06/2017  21:57    <DIR>          .
16/06/2017  21:57    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  102,891,061,248 bytes free

For completeness, Zero.elm is

module Zero exposing (zero)
zero =
    0

but to be honest any valid Elm file will do.

The dev folder gets created on the user's current drive. In the above example C:\dev got created because my current drive was C:. However, no file with the name null gets created in this folder.

If you lack permission to create a folder in the root of your current drive, it is likely that elm-make will fail with a permission-denied error, which seems somewhat odd.

It seems the issue is with the generate function in src/Pipeline/Generate.hs. This function understands that the output file can be /dev/null, and doesn't write to a file in this situation, but it still attempts to create the parent directory of this file if it doesn't already exist. And on Windows there isn't always a folder named dev in the root of the current drive.

I'm using Elm 0.18 on Windows 10.

@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@olisikh
Copy link

olisikh commented Oct 9, 2017

Having the same issue, but in a different situation. When I run elm-test I get the output saying that elm-make can't create /dev directory (running elm-test from Git Bash).

elm-make-error-dev-folder

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants