oortcloud / meteorite

Installer & smart package manager for Meteor
http://oortcloud.github.com/meteorite/
MIT License
841 stars 106 forks source link

Windows updates: seconds attempt #248

Open yeputons opened 10 years ago

yeputons commented 10 years ago

@tmeasday @seanmwalker @sdarnell I think that it's time to create a new pull request so that we can see all changes in one place. I've disabled meteor pinning for Windows and added some line endings heuristics which tries to preserve type of EOLs in smart.lock, smart.json and .gitignore (os.EOL is used by default). meteorite create-project creates stub project with system-specific EOLs.

No spaces folder:

  1. All tests are passed on Linux (126)
  2. All tests are passed on Windows (123, yellow warning is displayed before tests)

Folder with spaces (it implies that HOME directory have spaces during testing too):

  1. Three meteor-pinning tests are failing on Linux because of old Meteor testing versions (these versions themselves are not able to correctly run from folder with spaces).
  2. Lots of tests are failing on Windows because of featurist/spawn-cmd#3 (spaces issue). However, creating and working with projects which have spaces in path is OK and works fine, because we run git by its name during regular work, not by its absolute path and therefore this path is not getting quoted.

Things left to do:

Waiting for your comments, code review and thoughts on the second TODO thing.

Spiralis commented 10 years ago

As for all I can say this looks good. Does seem like the second issue might be resolved (featurist/spawn-cmd#3), but the issue is still open it seems.

Hades32 commented 10 years ago

The usage of junctions makes it mandatory to run mrt as administrator. This is not very nice and should at least be mentioned in the readme.

"Ordinary" symbolic links can AFAIK be created by normal users, but that has also drawbacks. I think there are some libraries that fake unix style symbolic links, maybe that would be a better approach?

yeputons commented 10 years ago

@Hades32 are you sure about directory junctions? It's not the same as symbolic/hard link on Windows. I've just tried to create one under a restricted user and it succeeded, while creation of hard link to file/directory failed because of lack of rights.

Moreover, this branch of Meteorite works just fine under restricted user too.

seanmwalker commented 10 years ago

@Hades32 were you using a directory path outside of your users directory? (A folder outside of C:\users{your username} for instance. You can find your user directory with the USERPROFILE environment variable if you're not sure)

Hades32 commented 10 years ago

Well, I tested it that way:

C:\Temp\syn>mklink /D SymbolicDirectory RealDirectory
Ihre Berechtigungen reichen nicht aus, um diesen Vorgang auszuführen. (NO PERMISSION)

C:\Temp\syn>mklink /J JunctionDirectory RealDirectory
Verbindung erstellt für JunctionDirectory <<===>> RealDirectory (SUCCESS)

C:\Temp\syn>mklink /H HardDirectory RealDirectory
Zugriff verweigert (ACCESS DENIED)

So, yes, I'm testing outside of my user directory, but I'm the owner of the directory and I'm administrator (just running an ordinary (not elevated) prompt.

yeputons commented 10 years ago

@Hades32 so what's the problem? Meteorite use the second way (directory junctions) and your log says it's OK, isn't it?

Hades32 commented 10 years ago

Well, maybe I made some false assumptions there, but my problem essentially is this:

C:\Temp\fahrtenbuch>meteorite

Stand back while Meteorite does its thing
V router
    tag: https://github.com/tmeasday/meteor-router.git#v0.6.1

fs.js:730
  return binding.symlink(preprocessSymlinkDestination(destination, type),
                 ^
Error: EPERM, operation not permitted 'C:\Users\Martin\AppData\Local\.meteorite\packages\router\tmeasday\meteor-router\8ec75fec7affdefc787d19f23b36fd6d1d44ef04'

    at Object.fs.symlinkSync (fs.js:730:18)
    at C:\OtherProgs\meteorite\lib\dependencies\package.js:131:10
    at C:\OtherProgs\meteorite\lib\sources\git.js:84:15
    at GitSource._load (C:\OtherProgs\meteorite\lib\sources\git.js:142:12)
    at C:\OtherProgs\meteorite\lib\sources\git.js:82:18
    at C:\OtherProgs\meteorite\lib\sources\git.js:98:5
    at C:\OtherProgs\meteorite\lib\sources\git.js:264:5
    at ChildProcess.exithandler (child_process.js:645:7)
    at ChildProcess.EventEmitter.emit (events.js:117:20)
    at maybeClose (child_process.js:753:16)
yeputons commented 10 years ago

@Hades32 are you able to reproduce this issue in another directory? Say, clean check out of some project in your home directory? Are you able to manually create directory junction between the path Meteorite displayed and corresponding directory in packages/?

Hades32 commented 10 years ago

Interestingly I cannot reproduce inside my user directory. As both are owned by the same user I don't really understand why though. I AM able to create a junction between above path and the packages dir - so that doesn't really give a hint either... But at least I can now comfortably work when I use my user directory - thanks for that!

rudolfb commented 10 years ago

@yeputons Just wanted to thank you for your work in getting mrt working under Windows.

Managed to get your branch working by doing the following on my Windows 8 workstation:

Cloned the oortcloud/meteorite repo Switched to your branch: https://github.com/oortcloud/meteorite/tree/windows-updates

Needed to install the prerequisite npm packages, and then meteorite:

$ npm install -g ddp,underscore,wrench,fstream,optimist,prompt,colors,async,rolling_timeout_exec,which,exit,spawn-cmd,mocha,connect,meteorite
$ npm install -g meteorite

Had to change some of the package version numbers in the package.json:

After this, I got your code working, as long as theC:\Users\[User]\AppData\Roaming\npm is on one's path.

meteorite did not work for me, but if I use mrt.cmd, e.g. mrt.cmd add luma-ui or simply mrt.cmd, then the commands all seem to work.

Sometimes after issuing a mrt.cmd update it seemed as if the process got hung up. Pressed CTRL-C, then reissued the command and everything was fine. But I had this happen using a meteor update as well, so I doubt this has something to do with your modifications.

All in all it seems to work. Tried these steps on a second PC successfully as well. As long as the C:\Users\rb\AppData\Roaming\npm is on my path, then calling mrt.cmd works fine for me.

Again, thanks.

Regards

Rudolf

Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. Alle Rechte vorbehalten.

PS C:\Users\rb> npm install -g ddp,underscore,wrench,fstream,optimist,prompt,colors,async,rolling_timeout_exec,which,exi
t,spawn-cmd,mocha,connect
C:\Users\rb\AppData\Roaming\npm\which -> C:\Users\rb\AppData\Roaming\npm\node_modules\which\bin\which
C:\Users\rb\AppData\Roaming\npm\_mocha -> C:\Users\rb\AppData\Roaming\npm\node_modules\mocha\bin\_mocha
C:\Users\rb\AppData\Roaming\npm\mocha -> C:\Users\rb\AppData\Roaming\npm\node_modules\mocha\bin\mocha
rolling_timeout_exec@0.0.1 C:\Users\rb\AppData\Roaming\npm\node_modules\rolling_timeout_exec

which@1.0.5 C:\Users\rb\AppData\Roaming\npm\node_modules\which

spawn-cmd@0.0.2 C:\Users\rb\AppData\Roaming\npm\node_modules\spawn-cmd

colors@0.6.2 C:\Users\rb\AppData\Roaming\npm\node_modules\colors

underscore@1.6.0 C:\Users\rb\AppData\Roaming\npm\node_modules\underscore

async@0.9.0 C:\Users\rb\AppData\Roaming\npm\node_modules\async

wrench@1.5.8 C:\Users\rb\AppData\Roaming\npm\node_modules\wrench

exit@0.1.2 C:\Users\rb\AppData\Roaming\npm\node_modules\exit

fstream@0.1.28 C:\Users\rb\AppData\Roaming\npm\node_modules\fstream
+-- inherits@2.0.1
+-- graceful-fs@3.0.2
+-- rimraf@2.2.8
+-- mkdirp@0.3.5

optimist@0.6.1 C:\Users\rb\AppData\Roaming\npm\node_modules\optimist
+-- wordwrap@0.0.2
+-- minimist@0.0.10

ddp@0.7.0 C:\Users\rb\AppData\Roaming\npm\node_modules\ddp
+-- ddp-underscore-patched@0.8.1-2
+-- ddp-ejson@0.8.1-3
+-- faye-websocket@0.7.2 (websocket-driver@0.3.5)

connect@3.0.2 C:\Users\rb\AppData\Roaming\npm\node_modules\connect
+-- utils-merge@1.0.0
+-- parseurl@1.1.3
+-- debug@1.0.3 (ms@0.6.2)
+-- finalhandler@0.0.2 (escape-html@1.0.1, debug@1.0.2)

mocha@1.20.1 C:\Users\rb\AppData\Roaming\npm\node_modules\mocha
+-- diff@1.0.7
+-- growl@1.7.0
+-- commander@2.0.0
+-- mkdirp@0.3.5
+-- debug@1.0.4 (ms@0.6.2)
+-- jade@0.26.3 (commander@0.6.1, mkdirp@0.3.0)
+-- glob@3.2.3 (inherits@2.0.1, graceful-fs@2.0.3, minimatch@0.2.14)

prompt@0.2.13 C:\Users\rb\AppData\Roaming\npm\node_modules\prompt
+-- revalidator@0.1.8
+-- pkginfo@0.3.0
+-- read@1.0.5 (mute-stream@0.0.4)
+-- utile@0.2.1 (async@0.2.10, deep-equal@0.2.1, rimraf@2.2.8, i@0.3.2, ncp@0.4.2, mkdirp@0.5.0)
+-- winston@0.6.2 (cycle@1.0.3, stack-trace@0.0.9, eyes@0.1.8, async@0.1.22, pkginfo@0.2.3, request@2.9.203)
PS C:\Users\rb> npm install -g meteorite
C:\Users\rb\AppData\Roaming\npm\mrt -> C:\Users\rb\AppData\Roaming\npm\node_modules\meteorite\bin\mrt.js

> meteorite@0.7.4 postinstall C:\Users\rb\AppData\Roaming\npm\node_modules\meteorite
> sh ./completions/postinstall.sh

meteorite@0.7.4 C:\Users\rb\AppData\Roaming\npm\node_modules\meteorite
+-- rolling_timeout_exec@0.0.1
+-- async@0.2.9
+-- colors@0.6.0-1
+-- underscore@1.3.3
+-- wrench@1.3.9
+-- optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10)
+-- fstream@0.1.28 (inherits@2.0.1, graceful-fs@3.0.2, rimraf@2.2.8, mkdirp@0.3.5)
+-- ddp@0.4.6 (node-srp@0.0.1, faye-websocket@0.7.2, meteor-ejson@0.6.3)
+-- prompt@0.2.11 (revalidator@0.1.8, pkginfo@0.3.0, read@1.0.5, utile@0.2.1, winston@0.6.2)
PS C:\Users\rb>