-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add initial Windows support #17
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3376eb2
Get the correct URL to download Node.js on Windows
TooTallNate 4cb264d
Add support for Windows to `installNode()`
TooTallNate 6afc551
Don't invoke `npm`
TooTallNate a518a14
Ignore `*.swp` files
TooTallNate f6436c5
Implement `strip` option for `unzip()`
TooTallNate 64d00d1
Don't initialize runtimes into a temp dir
TooTallNate 91cecef
Invoke `bootstrap.js` instead of `bootstrap`
TooTallNate a5fa986
Don't freeze/unfreeze the lambda processes on Windows
TooTallNate 828c915
Use Windows `PATH` delimiter on Windows
TooTallNate 2384bf4
Unlink file while unzipping
TooTallNate 4d8b8a4
Add Node-compatible `bootstrap.ts` files for all runtimes
TooTallNate aa71792
Ignore `EPERM` cleanup failure in test case for Windows
TooTallNate 13b95fa
Fix `ENOENT` error when setting `cwd` to a dir that does not exist
TooTallNate f9e2b8f
Merge remote-tracking branch 'origin/master' into add/windows-support
TooTallNate 4f63942
Merge remote-tracking branch 'origin/master' into add/windows-support
TooTallNate 0228c47
Still invoke `bootstrap` on non-Windows
TooTallNate c6b5d92
Use `isWin` var
TooTallNate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const bootstrap = join(__dirname, 'bootstrap'); | ||
spawn(bootstrap, [], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const nodeBin = join(__dirname, 'bin', 'node'); | ||
const bootstrap = join(__dirname, '..', 'nodejs', 'bootstrap.js'); | ||
spawn(nodeBin, [ bootstrap ], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const nodeBin = join(__dirname, 'bin', 'node'); | ||
const bootstrap = join(__dirname, '..', 'nodejs', 'bootstrap.js'); | ||
spawn(nodeBin, [ bootstrap ], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
// Delegate out to the provided `bootstrap` file within the lambda | ||
const bootstrap = join(process.env.LAMBDA_TASK_ROOT, 'bootstrap'); | ||
spawn(bootstrap, [], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
// `PYTHONPATH` is *not* a restricted env var, so only set the | ||
// default one if the user did not provide one of their own | ||
if (!process.env.PYTHONPATH) { | ||
process.env.PYTHONPATH = process.env.LAMBDA_RUNTIME_DIR; | ||
} | ||
|
||
const bootstrap = join(__dirname, 'bootstrap.py'); | ||
spawn('python', [ bootstrap ], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const pythonBin = join(__dirname, 'bin', 'python'); | ||
const bootstrap = join(__dirname, '..', 'python', 'bootstrap.py'); | ||
spawn(pythonBin, [ bootstrap ], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const pythonBin = join(__dirname, 'bin', 'python'); | ||
const bootstrap = join(__dirname, '..', 'python', 'bootstrap.py'); | ||
spawn(pythonBin, [ bootstrap ], { stdio: 'inherit' }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { join } from 'path'; | ||
import { spawn } from 'child_process'; | ||
|
||
const pythonBin = join(__dirname, 'bin', 'python'); | ||
const bootstrap = join(__dirname, '..', 'python', 'bootstrap.py'); | ||
spawn(pythonBin, [ bootstrap ], { stdio: 'inherit' }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why not always use
bootstrap.js
? Why is Windows different 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.
This is so bizarre that it would definitely warrant a comment
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.
Basically there's two implementations of these "bootstrap" logic. Ideally just temporarily, and we use the .js ones for all platforms, but for now running the .js ones on unix was causing tests to fail. So consider this just an in-progress transition to that while we get Windows initially/incrementally working.