Skip to content
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

Repo build and dev env doesn’t work on Windows 10 #55

Closed
leepa opened this issue Jun 6, 2018 · 7 comments · Fixed by #17513
Closed

Repo build and dev env doesn’t work on Windows 10 #55

leepa opened this issue Jun 6, 2018 · 7 comments · Fixed by #17513
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort management/devenv Related to CDK development/build environment p1

Comments

@leepa
Copy link
Contributor

leepa commented Jun 6, 2018

pkglint doesn't work on Windows it seems - or something is running chmod which obviously does not exist.

C:\Users\lpack\Documents\Code\aws-cdk>node --version
v8.11.2
lerna info lifecycle prepare
lerna sill runScript prepare pkglint
lerna sill runScriptInDir prepare [] pkglint
lerna sill getExecOpts { cwd: 'C:\\Users\\lpack\\Documents\\Code\\aws-cdk\\packages\\pkglint' }
lerna sill pkglint
lerna ERR! execute Error occured with 'pkglint' while running 'npm run prepare'
lerna ERR! npm run prepare [pkglint] Output from stdout:

> [email protected] prepare C:\Users\lpack\Documents\Code\aws-cdk\packages\pkglint
> tsc && tslint -p . && chmod +x bin/pkglint


lerna ERR! npm run prepare [pkglint] Output from stderr:
'chmod' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: `tsc && tslint -p . && chmod +x bin/pkglint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lpack\AppData\Roaming\npm-cache\_logs\2018-06-06T21_16_29_706Z-debug.log

lerna ERR! execute Error occured with 'pkglint' while running 'npm run prepare'
{ Error: Command failed: npm run prepare
'chmod' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] prepare: `tsc && tslint -p . && chmod +x bin/pkglint`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\lpack\AppData\Roaming\npm-cache\_logs\2018-06-06T21_16_29_706Z-debug.log

> [email protected] prepare C:\Users\lpack\Documents\Code\aws-cdk\packages\pkglint
> tsc && tslint -p . && chmod +x bin/pkglint


    at Promise.all.then.arr (C:\Users\lpack\Documents\Code\aws-cdk\node_modules\lerna\node_modules\execa\index.js:236:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  code: 1,
  killed: false,
  stdout: '\n> [email protected] prepare C:\\Users\\lpack\\Documents\\Code\\aws-cdk\\packages\\pkglint\n> tsc && tslint -p . && chmod +x bin/pkglint\n\n',
  stderr: '\'chmod\' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! [email protected] prepare: `tsc && tslint -p . && chmod +x bin/pkglint`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the [email protected] prepare script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     C:\\Users\\lpack\\AppData\\Roaming\\npm-cache\\_logs\\2018-06-06T21_16_29_706Z-debug.log\n',
  failed: true,
  signal: null,
  cmd: 'npm run prepare',
  timedOut: false,
  pkg:
   Package {
     _package:
      { name: 'pkglint',
        version: '0.6.0',
        private: true,
        description: 'Validate and fix package.json files',
        main: 'lib/index.js',
        types: 'lib/index.d.ts',
        repository: [Object],
        pkglint: [Object],
        bin: [Object],
        scripts: [Object],
        keywords: [Array],
        author: [Object],
        license: 'Apache-2.0',
        devDependencies: [Object],
        dependencies: [Object] },
     _location: 'C:\\Users\\lpack\\Documents\\Code\\aws-cdk\\packages\\pkglint' },
  exitCode: 1 }

C:\Users\lpack\Documents\Code\aws-cdk>node --version
v8.11.2

C:\Users\lpack\Documents\Code\aws-cdk>
@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 7, 2018

The built packages should work on Windows, but not necessarily the build itself.

Any chance you can see your way to using WSL?

@leepa
Copy link
Contributor Author

leepa commented Jun 7, 2018

@rix0rrr from a developer experience point of view, WSL would not really work here as a developer would likely want to use their native IDEs for development.

Of course, there's no reason why built packages themselves wouldn't work but I'll have a play.

@eladb eladb changed the title Windows 10 Install and Build doesn't work Repo build and dev env doesn’t work on Windows 10 Jun 11, 2018
@eladb eladb added bug This issue is a bug. management/devenv Related to CDK development/build environment labels Dec 17, 2018
@john-shaskin
Copy link
Contributor

I'm running into the same thing, and am thinking of wrapping a Docker image around the build process, as a workaround.

@eladb
Copy link
Contributor

eladb commented Apr 2, 2019

Recommend to use the docker instructions in the contribution guide on Windows. Closing for now.

@eladb eladb closed this as completed Apr 2, 2019
@dankmemes2020
Copy link

Hi @eladb @NGL321 can we reopen this issue? There are no Docker instructions in the contribution guide anymore, so building the CDK on Windows doesn't work. Also, it's impossible to use WSL 1 because building the CDK requires docker to be running and accessible. (WSL 2 gets around this by allowing you to interface with the docker daemon from within a WSL container).

Even scripts like foreach.sh don't work on Windows environments, even with WSL - Windows will happily open Bash up when you give it a #!/bin/bash to execute, but things like path escaping are done with / in mind as the path separator, so the scripts error out on Windows. I think also awslint fails to build because pkglint finds that the repository.directory is wrong, again due to a path separator issue. In theory, this is all TS so it should be cross-platform, but the build system and tools weren't written with Windows in mind.

@eladb
Copy link
Contributor

eladb commented Jul 25, 2021

Yes, reopening. Thanks

@eladb eladb reopened this Jul 25, 2021
@eladb eladb added p1 effort/small Small work item – less than a day of effort labels Jul 25, 2021
@mergify mergify bot closed this as completed in #17513 Apr 8, 2022
mergify bot pushed a commit that referenced this issue Apr 8, 2022
Small changes to make builds work in Windows Subsystem for Linux (WSL). Verified by **partial** building in Windows 10 + Ubuntu 18.04 WSL.

fixes #55
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

otaviomacedo pushed a commit that referenced this issue Apr 11, 2022
Small changes to make builds work in Windows Subsystem for Linux (WSL). Verified by **partial** building in Windows 10 + Ubuntu 18.04 WSL.

fixes #55
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
StevePotter pushed a commit to StevePotter/aws-cdk that referenced this issue Apr 27, 2022
…7513)

Small changes to make builds work in Windows Subsystem for Linux (WSL). Verified by **partial** building in Windows 10 + Ubuntu 18.04 WSL.

fixes aws#55
----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. effort/small Small work item – less than a day of effort management/devenv Related to CDK development/build environment p1
Projects
None yet
5 participants