You need to run mix as admin. Windows 10 has this stupidity that symlinks can only be made by a program running as administrator or by guest, no user account has the capability no matter the permissions you give that account, and guests can because they are limited in there access anyway. Yes it is stupid, but it is Windows.
Just run the iex or mix programs ‘as administrator’ and all is fine, symlinks work, no more race conditions with file copies, etc… etc…
First, make certain elixir is being run ‘as administrator’, not just that your account is administractor (that is not enough because programs are not run as administrator unless you explicitly do so).
Second, if the _build directory is already corrupt you have to clear it before running the iex/mix ‘as administrator’ or it will not help, once corrupt it stays corrupt, because windows NTFS stupidity.
Third, adding people to permission of other accounts or whatever will do nothing, the program itself has to be run ‘as administrator’, not the account it is running in.
EDIT:
Remember, it is like linux in this regard, just because your account on linux has sudo access, does not mean a program is run as root unless you ‘sudo’ it, just because you have an administrator account on windows does not mean the program is running as administrator, you have to tell windows to run it as administrator using the usual ways (I use a set of scripts I made, iex_admin and mix_admin, can make your own too for ease of use).
You can make a shortcut and set it to always launch as administrator, however you will get the stupid Windows UAC box every-single-irritating-time. My scripts, in comparison, elevate the command prompt to administrator if it is not, so I only get it once per session. Or whenever you open the command prompt right click on the command prompt and ‘run as administrator’ anyway. Or if using conemu then right-click the tab and ‘restart as administrator’. Or whatever other way, there are dozens that are easily done. Or you can prefix the command with the right incantation to launch the mix/iex subcommand as administrator (windows version of ‘sudo’, but far far more wordy). It is all standard normal irritating Windows stuff.
Dev’ing on Windows is a pain, no matter the language. I know it all too well as Windows is what I use at work and Linux at home, Linux is so significantly better for programming.
That is indeed very similar to what my script does, but I use powershell instead. It is a bit messy of a way and may cause more UAC popups than you’d prefer, but it works.
And yes, the Windows Dragon is big and painful.
For now, I’d say just launch your command prompt ‘as administrator’, that at least gets you going for now, just be sure to clear the _build directory once more.
I’ve had similar experiences with multiple projects, they work fine for a long time, then suddenly those errors, which I eventually tracked down to a race condition in how Windows NTFS saves files out, it is not what one would call ‘atomic’, not like a sync is on linux anyway. Clearing and resetting does not fix it. I’m unsure as to the trigger, it might be fragmentation, alignment of the files, how full the drive is, or a variety of other things, but once it starts happening it keeps happening, not just in elixir but in other languages I’ve experienced as well…
I’m just glad that elixir has some kind of work-around, since it tries to symlink if it is capable instead of copy (saves a lot on speed too) that works around the issue, which you can enable by running as administrator. Other languages I’ve dealt with do not have such a resolution and I often get stuck for a long period…
Seem i had a defective local copy of one of the dependencies i was referencing from a local folder, switching back to the git hosted copy seems to have fixed the issues.
I will clone a fresh copy of said dependency and apply my local changes to it again.