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

Developer Guide: Unable to build aws-cdk-lib locally on Windows 10 x64 #26740

Closed
hot9cups opened this issue Aug 13, 2023 · 6 comments
Closed
Labels
aws-cdk-lib Related to the aws-cdk-lib package closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@hot9cups
Copy link

hot9cups commented Aug 13, 2023

Describe the issue

I'm following the developer guide, and am trying to build aws-cdk-lib locally.
When I run the command npx lerna run build --scope=aws-cdk-lib to do that, I receive the following error:

PS C:\Users\WIN 10\Desktop\github things\aws-cdk> npx lerna run build --scope=aws-cdk-lib
lerna notice cli v7.0.2
lerna notice filter including "aws-cdk-lib"
lerna info filter [ 'aws-cdk-lib' ]        

   ×    1/2 dependent project tasks failed (see below)
   √    1/2 dependent project tasks succeeded [1 read from cache]

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 


> @aws-cdk/node-bundle:build

yarn run v1.22.19
$ projen build
\"" was unexpected at this time.
👾 unable to evaluate environment variable PATH=$(npx -c "node -e \"console.log(process.env.PATH)\""): unknown error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 —————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 

 >  Lerna (powered by Nx)   Ran target build for project aws-cdk-lib and 10 task(s) they depend on (2s)

    ×    1/2 failed
    √    1/2 succeeded [1 read from cache]

I'm trying to do this on Windows 10 x64. This is the very first step in the guide so I'm not quite sure what I could have done wrong leading upto this.

Links

https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md#setup

@hot9cups hot9cups added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Aug 13, 2023
@github-actions github-actions bot added the aws-cdk-lib Related to the aws-cdk-lib package label Aug 13, 2023
@hot9cups
Copy link
Author

In an attempt to mitigate the problem, I tried making use of Dev-containers that's mentioned in the developer guide, here, just to remove any dependencies on my local machine that might be causing issues.

However opening the repo in dev-container throws an error during the container build too:

error An unexpected error occurred: "EPERM: operation not permitted, chmod '/workspaces/aws-cdk/packages/@aws-cdk-testing/cli-integ/node_modules/.bin/cdk-build'".
info If you think this is a bug, please open a bug report with the information provided in "/workspaces/aws-cdk/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[1155390 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands.

This is when I'm already running VSCode with admin privileges.

@pahud
Copy link
Contributor

pahud commented Aug 14, 2023

If you use Windows for development environment, we recommend using Gidpod or Amazon CodeCatalyst DevEnv as mentioned in the contributing guide:

Windows, as a development environment, has known performance and compatibility issues. To help in this case, consider using Gitpod or Amazon CodeCatalyst DevEnv instead.

https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md

@pahud pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Aug 14, 2023
@pahud pahud changed the title (Developer Guide): (Unable to build aws-cdk-lib locally) Developer Guide: Unable to build aws-cdk-lib locally on Windows 10 x64 Aug 14, 2023
@pahud pahud added effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Aug 14, 2023
@github-actions
Copy link

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Aug 16, 2023
@hot9cups
Copy link
Author

Hi @pahud

Given the shortcomings of Windows and lack of local-development options available as highlighted above, I decided to continue doing this on my M1 Macbook Pro.

Now, when I run the command npx lerna run build --scope=aws-cdk-lib, here's the error I get:

➜  aws-cdk git:(main) npx lerna run build --scope=aws-cdk-lib 
lerna notice cli v7.1.5
lerna notice filter including "aws-cdk-lib"
lerna info filter [ 'aws-cdk-lib' ]

   ✔    11/11 dependent project tasks succeeded [0 read from cache]

   Hint: you can run the command with --verbose to see the full dependent project outputs

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————


> aws-cdk-lib:build

yarn run v1.22.19
$ cdk-build
  ...ces/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.bundled.js  24.2kb
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: fixtures/test1/external-link.txt: Cannot open: Permission denied
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: fixtures/symlinks/external-dir-link: Cannot open: Permission denied
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: fixtures/symlinks/external-link.txt: Cannot open: Permission denied
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Ignoring unknown extended header keyword 'SCHILY.dev'
tar: Ignoring unknown extended header keyword 'SCHILY.ino'
tar: Ignoring unknown extended header keyword 'SCHILY.nlink'
tar: Exiting with failure status due to previous errors
Error: 'ts-node -P tsconfig.dev.json region-info/build-tools/generate-static-data.ts && (cp -f $(node -p '"'"'require.resolve("aws-sdk/apis/metadata.json")') custom-resources/lib/aws-custom-resource/sdk-api-metadata.json && rm -rf custom-resources/test/aws-custom-resource/cdk.out) && esbuild --bundle custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.ts --target=node18 --platform=node --external:'@aws-sdk/*' --outfile=custom-resources/lib/aws-custom-resource/runtime/aws-sdk-v3-handler.bundled.js && (rm -rf core/test/fs/fixtures && cd core/test/fs && tar -xzf fixtures.tar.gz) && (rm -rf assets/test/fs/fixtures && cd assets/test/fs && tar -xzvf fixtures.tar.gz) && ./scripts/airlift-custom-resource-handlers.sh' exited with error code 2
Build failed.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  Lerna (powered by Nx)   Ran target build for project aws-cdk-lib and 11 task(s) they depend on (1m)
 
    ✖    1/12 failed
    ✔    11/12 succeeded [0 read from cache]

Can you help me understand what's wrong?
All I've done is checkout the package from github, open it in dev-containers through vs-code, and run the build command, and it seems to fail out-of-the-box unfortunately.

@hot9cups
Copy link
Author

Also this issue is closed, could we re-open?

@frattallone
Copy link
Contributor

I'm facing the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws-cdk-lib Related to the aws-cdk-lib package closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. documentation This is a problem with documentation. effort/medium Medium work item – several days of effort p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

3 participants