Open ccoenen opened 10 years ago
@ccoenen ImDisk makes sense; I took a stab at this but got mired in general Windows unfamiliarity but I think ImDisk is the way to go; not sure how you want to handle automatically assigning a drive letter and sharing with other projects though.
I'm excited to see if this makes a dent in windows compilation; honestly I think enough enhancements have been made to ember-cli lately that I don't see a difference any more on Macs at least when using this addon.
I'm already hitting blockers: apparently, one needs admin-privileges for assigning driveletters and formatting the created ramdisks. Not sure how/if this would work in a broccoli context at all. I will absolutely not require people to run node with admin privileges.
# creates a 2G Ramdisk, formats it as ntfs, assigns letter "M:" to it (eMber, get it? :o) )
imdisk -a -s 2G -m M: -o fix -p "/fs:ntfs /q /y"
# remove the first ramdisk (no checks, yet)
imdisk -d -u 0
I'll try to incorporate these in the existing files.
In that case it's probably fine if you isolated the command and made the user run that part manually in Admin mode.
Yes that's probably the best way to go about it. This could also take care of symlinking or NTFS junctions, AFAIK they need admin privileges, too.
Linux also requires admin privileges (I was quite surprised OS X didn't).
What we are doing right now is to execute sudo
, and the terminal will ask for a password. I've found some npm packages that "wrapped" my comands with sudo, in a fancier way, but I ended up not using them.
On windows I found this: https://github.com/coreybutler/node-windows It is basically a wrapper for various windows stuff. Quoting the interesting part:
- Commands:
- Elevated Permissions: Run a command with elevated privileges (may prompt user for acceptance)
It looks like it might work.
EDIT: The elevate command uses child processes, so we need callbacks. Right now execSync is synchronous. Some things must be changed, but I agree with going with callbacks/promises on this.
Who's Tom Dale?
LOL!
@machty @ccoenen I too got fed up with performance on windows with the existing broccoli. I just found your discussion after experimenting with http://memory.dataram.com/products-and-services/software/ramdisk RAMDisk by Dataram. I downloaded the free version because I didn't need anything more than 4G for the tmp directory.
cmd mklink /J tmp g:\tmp
After that you should see a performance jump.
@cmosguy does the dataram dramdisk require a privilege elevation? (i.e. UAC Screen or Admin-Login...)
@ccoenen as far as i can tell it requires no admin privileges.
I am currently investigating a patch to make this work on windows, as well. I have found ImDisk, which is open source. To my knowledge, windows can't create ramdisk on its own. I'll leave my findings here.