Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

script/bootstrap on win32 - #963

Closed
anaisbetts wants to merge 2 commits into
masterfrom
bootstrap-on-win32
Closed

anaisbetts wants to merge 2 commits into
masterfrom
bootstrap-on-win32

Conversation

@anaisbetts

Copy link
Copy Markdown
Contributor

This PR gets script/bootstrap running on Windows. Here's how far we've got so far:

C:\atom\atom [bootstrap-on-win32]> .\script\bootstrap.ps1

> [email protected] prepublish C:\atom\atom\vendor\apm
> grunt clean lint coffee

Running "clean" task

Running "coffeelint:src" (coffeelint) task
>> 21 files lint free.

Running "coffeelint:test" (coffeelint) task
>> 2 files lint free.

Running "coffee:glob_to_multiple" (coffee) task
File lib/apm-cli.js created.
File lib/apm.js created.
File lib/cleaner.js created.
File lib/command.js created.
File lib/config.js created.
File lib/couch/app.js created.
File lib/developer.js created.
File lib/fetcher.js created.
File lib/fs.js created.
File lib/init.js created.
File lib/installer.js created.
File lib/link-lister.js created.
File lib/linker.js created.
File lib/lister.js created.
File lib/publisher.js created.
File lib/rebuilder.js created.
File lib/test.js created.
File lib/tree.js created.
File lib/uninstaller.js created.
File lib/unlinker.js created.
File lib/updater.js created.

Done, without errors.
[email protected] node_modules\atom-package-manager
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], oauth-
[email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected],
 [email protected], [email protected], [email protected])
└── [email protected]
Installing [email protected] ✓
Installing modules ✗

> [email protected] preinstall C:\atom\atom
> true

TODO

  • Start hacking into apm to figure out what's failing
  • Create shim Windows versions of modules we're pulling in if needed

If this script ever becomes complicated, we should port it to Python so it
works everywhere (since Python is required for atom-shell anyways). For now,
it was so dumb that I just rewrote it in PowerShell
@zcbenz

zcbenz commented Oct 15, 2013

Copy link
Copy Markdown
Contributor

I was working on a similar thing, but instead of writing it in powershell script, I tried to write all the scripts in js, see the bash-scripts-to-js branch.

Using node.js for the scripts could avoid duplicating code on win32, but it also made the script much uglier. Which way do you think we should take? /cc @kevinsawicki @nathansobo .

@kevinsawicki

Copy link
Copy Markdown
Contributor

I would prefer coffeescript or js but if it makes it ugly and more cumbersome then I am okay staying with something more native.

@zcbenz

zcbenz commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

After more tries of converting scripts to js, I think it's a bad idea, node's asynchronous child_process module just make things inevitably ugly. I now think using powershell scripts on Windows is a much better way.

@anaisbetts

Copy link
Copy Markdown
Contributor Author

I wrote this particular one in PowerShell only because it was so small, if we start getting more interesting scripts we could write them in Python (since you need Py on Windows to build Atom Shell anyways)

@mcolyer

mcolyer commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

@zcbenz What if we used grunt or async to take some of the rough edges off? I think having our bootstrap in JS is a really helpful as it cuts down on the stuff people need to know.

If you've got something that's ugly I'm happy to take a look and see if I can't pretty it up a bit.

@zcbenz

zcbenz commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

@mcolyer The bootstrap script is called before apm install, so I don't think we can use grunt or any third party module for it, my js version of bootstrap can be found in the bash-scripts-to-js branch. I'm free to the choice of language.

@mcolyer

mcolyer commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

Can't we just vendor a copy of the minimal dependencies that we need?

@anaisbetts

Copy link
Copy Markdown
Contributor Author

@mcolyer Do we have a lot of scripts we need to port? From my search, it's really only script/bootstrap which is like 20 lines of code, as well as some stuff in jasmine-focused:

C:\atom\atom> ls -r | ?{$_.Name.EndsWith(".sh")} | %{$_.FullName}

C:\atom\atom\atom.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\node-gyp\gyp\tools\emacs\run-unit-tests.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\lib\utils\completion.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\node_modules\node-gyp\gyp\tools\emacs\run-unit-tests.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\node_modules\request\node_modules\node-uuid\benchmark\bench.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\node_modules\rimraf\test\run.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\node_modules\rimraf\test\setup.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\scripts\clean-old.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\scripts\doc-build.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\scripts\install.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\scripts\release.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\npm\scripts\relocate.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\request\node_modules\node-uuid\benchmark\bench.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\rimraf\test\run.sh
C:\atom\atom\node_modules\atom-package-manager\node_modules\rimraf\test\setup.sh
C:\atom\atom\vendor\apm\node_modules\grunt\node_modules\dateformat\test\test_weekofyear.sh
C:\atom\atom\vendor\apm\node_modules\grunt\node_modules\rimraf\test\run.sh
C:\atom\atom\vendor\apm\node_modules\grunt\node_modules\rimraf\test\setup.sh
C:\atom\atom\vendor\apm\node_modules\grunt\test\fixtures\exec.sh
C:\atom\atom\vendor\apm\node_modules\jasmine-focused\node_modules\jasmine-node\specs.sh
C:\atom\atom\vendor\apm\node_modules\jasmine-focused\node_modules\jasmine-node\node_modules\jasmine-reporters\test\envjs.runner.sh
C:\atom\atom\vendor\apm\node_modules\jasmine-focused\node_modules\jasmine-node\node_modules\jasmine-reporters\test\phantomjs.runner.sh
C:\atom\atom\vendor\apm\node_modules\jasmine-focused\node_modules\jasmine-node\node_modules\walkdir\test.sh
C:\atom\atom\vendor\apm\node_modules\jasmine-focused\node_modules\jasmine-node\node_modules\walkdir\test\comparison\install_test_deps.sh
C:\atom\atom\vendor\apm\node_modules\node-gyp\gyp\tools\emacs\run-unit-tests.sh
C:\atom\atom\vendor\apm\node_modules\npm\lib\utils\completion.sh
C:\atom\atom\vendor\apm\node_modules\npm\node_modules\node-gyp\gyp\tools\emacs\run-unit-tests.sh
C:\atom\atom\vendor\apm\node_modules\npm\node_modules\request\node_modules\node-uuid\benchmark\bench.sh
C:\atom\atom\vendor\apm\node_modules\npm\node_modules\rimraf\test\run.sh
C:\atom\atom\vendor\apm\node_modules\npm\node_modules\rimraf\test\setup.sh
C:\atom\atom\vendor\apm\node_modules\npm\scripts\clean-old.sh
C:\atom\atom\vendor\apm\node_modules\npm\scripts\doc-build.sh
C:\atom\atom\vendor\apm\node_modules\npm\scripts\install.sh
C:\atom\atom\vendor\apm\node_modules\npm\scripts\release.sh
C:\atom\atom\vendor\apm\node_modules\npm\scripts\relocate.sh
C:\atom\atom\vendor\apm\node_modules\request\node_modules\node-uuid\benchmark\bench.sh
C:\atom\atom\vendor\apm\node_modules\rimraf\test\run.sh
C:\atom\atom\vendor\apm\node_modules\rimraf\test\setup.sh

@kevinsawicki

Copy link
Copy Markdown
Contributor

I think I'd like to get the bash-scripts-to-js branch merged and just have this script/bootstrap.ps1 call script/bootstrap the same way apm.cmd works.

@mcolyer

mcolyer commented Oct 18, 2013

Copy link
Copy Markdown
Contributor

@zcbenz that branch looks pretty complete (and I actually think the scripts you have are pretty readable as they are). Are there more scripts that require converting?

In the long run we're planning on moving apm to just being an standard npm and that should remove the parts of the bootstrap around updating the submodule. Which hopefully means that in the future the bootstrap will hopefully just be npm install apm;apm install .

@zcbenz

zcbenz commented Oct 19, 2013

Copy link
Copy Markdown
Contributor

Only scripts under script/construction had not been touched, I'll create a PR for the bash-scripts-to-js branch.

@mcolyer

mcolyer commented Oct 21, 2013

Copy link
Copy Markdown
Contributor

@paulcbetts you cool with closing this out in favor of #1003 ?

@anaisbetts

Copy link
Copy Markdown
Contributor Author

@mcolyer 🆒

@anaisbetts anaisbetts closed this Oct 21, 2013
@kevinsawicki
kevinsawicki deleted the bootstrap-on-win32 branch December 2, 2013 23:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants