-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
braindump for windows #1
Conversation
c805734
to
6ead5d2
Compare
fs: fs | ||
}; | ||
|
||
var spawn = require('child_process').spawn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd indentation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this isn't used, remove?
What happens if we always hardlink on win32? I'm kinda bracing myself for another episode in disastrous hardlink handling like OS X, but on the other hand symlinks are not much fun either, so perhaps it's worth exploring. |
return false; | ||
} | ||
|
||
fs.unlinkSync(canLinkDest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also need to unlink canLinkSrc
here. Otherwise it is only removed if an error occurs during symlinking.
@joliss - I was thinking that we could do a tiered strategy on windows: symlink (if we can), hardlink (if we can), then fall back to Ray, Stef, and I will be working through this in the next few days.... |
Yes, maybe a tiered strategy is good. (I also just remembered that we probably cannot hardlink across device boundaries, so we'd still need a copy fallback.) |
Seems like junctions are what we need - power of hardlinks without the restrictions? |
@Twinkletoes one of my early spikes used junctions for directories which worked great. Unfortunately we also need something for individual files currently. So maybe junctions if available for directories, the copy/symlink/hardlink as possible for files that need to be brought in |
individual files can be junctioned (is that a word?) |
@Twinkletoes interesting, for some reason this was failing for me.. |
@Twinkletoes i've added an issue for a test suite, this way we can iterate much quicker. #3 |
Just noticed that there is a need for improving windows experience in broccoli and ember and thought I could provide some help with testing this library. Here are results for running tests from @stefanpenner PR:
Although running the example code from README.md:
works for the first time then (2nd attempt) it gives similar error message I posted in #2. Is this intentional that destination folder is not getting cleaned before copying/linking? I am sorry if I'm getting something wrong here. Here is the fill stack trace:
|
i seem to remember that junctions and/or softlinks and/or hardlinks are limited to users with administrator-privileges. Sadly, I can't find any documentation on that. |
I've already tried implement junction for symlink-or-copy, Before
After
|
@inDream can you provide more information, eg. what sort of IO is going on during the build phase? Do you have SSD or HD, what sort of machine, what OS what node etc. We should likely script a plausible broccoli run, and compare various approaches and try and isolate the bottle necks. |
Log files with ProcessMonitor: |
@inDream thank you kindly |
@inDream I'm working on the same thing https://github.com/gblmarquez/node-symlink-or-copy/tree/windows-spike Maybe we could work together. |
I'm looking to help with this too but going through a major client rollout Bryan Crotaz On 15 Oct 2014, at 21:59, Gabriel Marquez notifications@github.com wrote: @inDream https://github.com/inDream I'm working on the same thing Maybe we could work together. — |
Is there a way to get ember-cli to use this branch as the dependency for node-symlink-or-copy? I can test this out on my machine at work. |
I've changed broccoli-merge-trees & reduced the build time from 51450ms to 3939ms. But I don't know I am doing right or not. This line caused error in windows.
|
@jonnii You can download the zip content from GitHub and replace the original folder. |
@inDream ah, im surprised mergeTree's doesn't already rely on symlink or copy... |
@inDream you are going to bring the dreams of the windows ember-cli community to reality! |
I'm pretty dubious of |
I tested my project using this branch and the performance is much better. To test it I just copyed the files in this brach to every "symlink-or-copy" folder inside my project.
|
Doc PR for Ember CLI here: ember-cli/ember-cli#2563 |
We're back into writing Ember stuff after an enforced break. What's the Bryan On 26 November 2014 at 00:47, Ray Tiley notifications@github.com wrote:
Bryan Crotaz |
I tried as @diogomafra said and the results are fantastic!
This is from a fairly large project with a lot of external dependencies (bower_components is over 20mb and our dist-folder on a debug build is 13mb) and we also have some custom broccoli-filters that seem to do just fine when testing this. |
And this is another test done on one of our support guys computers with the same app.
|
many windows people are going to be excited :) Also for reference thanks to one of our clients, I'll be doing 3 full windows + ember-cli days next week. Hopefully @joliss has a chance for feedback before then. |
Except Windows XP user :-(. I will continue to use a gulpjs file until my company have migrate to Windows 7,which may also not have administrator privileage |
@tsing80 well, we welcome more contributions to help improve the lives of windows XP users. Do you have any ideas or suggestions? Unfortunately even Microsoft has dropped support for Windows XP: http://windows.microsoft.com/en-us/windows/end-support-help our poor little team of OSS volunteers really doesn't have the bandwidth to support it unless someone champions it. |
} | ||
|
||
function testCanSymlink () { | ||
var canLinkSrc = path.join(__dirname, "canLinkSrc.tmp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole thing seems super-brittle... I think we should just return true if !isWindows, so at least we don't incur the brittleness on Mac/Linux.
I suspect __dirname might not always be writable, e.g. if the currently executing script was installed in a directory only writable by adminstrator. Is there a directory that is reliably writable? Would cwd generally work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think the global tmp dir is the only place we can safely do this.
So I'm thinking, the code to deal with the Unix/Windows differences is starting to look more and more gnarly, with |
@joliss how does this look now? |
var canLinkDest = path.join(tmpdir, "canLinkDest.tmp") | ||
|
||
try { | ||
fs.writeFileSync(canLinkSrc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This writes undefined
into the file. Perhaps pass an empty string as second argument to future-proof it?
Other than that it looks good to me.
@raytiley and @stefanpenner, are you going to be around for maintaining the Windows parts on this? I can't maintain it myself because I don't have a Windows machine around (one that's set up for development anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes we will maintain it.
Is it possible for us to get commit + release to NPM ability. We can be sure to swing big changes by you.
@joliss @stefanpenner I'm not going anywhere. |
Sweet. Do you want to squash the commits, and then do you want me to merge and release v1.0.1? |
@joliss - Yes, please. |
b3007ca
to
eb13924
Compare
I squashed this into one commit. @stefanpenner and @duizendnegen should also get credit, but I have no idea how to do that. |
just add @ prefixed names to the bottom of the commit. Ultimately you are pushing it over the finish line you are welcome to the primary credit :) |
Credit to: @stefanpenner and @duizendnegen
eb13924
to
1e06e53
Compare
Lovely, thanks everyone. It's out in v1.0.1. Happy Thanksgiving! |
It's a Thanksgiving Miracle!! 🎉 🎈 🎉 🎈 |
Following the instructions at Unknown version 1.0.1? G:\Projects\package-ui>npm install -g ember-cli@1.0.1 npm ERR! System Windows_NT 6.1.7601 On 28 November 2014 at 01:07, Jonathan Goldman notifications@github.com
Bryan Crotaz |
@Twinkletoes - It isn't a new version of ember-cli, just |
Ah - how do I install this into my local ember-cli installation? On 28 November 2014 at 01:15, Robert Jackson notifications@github.com
Bryan Crotaz |
My team and I are going to love this, great work! |
@Twinkletoes Remove your |
this isn't meant as a solution, but as a place to experiment with window support (as time permits)
symlinks apparently work if:
with more hacks i was able to get ^^ sorta booting, but I ran into other problems (like missing files) and I failed to have time to investigate further today