aws / aws/aws-cdk

(cli): Parallelize dependencies build when possible in ./../../scripts/buildup

Open
#21,102 3 comments 2 reactions 1 assignee Claimed by @rix0rrr View on GitHub
effort/medium feature-request p2 package/tools
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the feature

The current ./../../scrupts/buildup script resolves the dependency graph of all other CDK packages that the current package depends and invokes their build command in the correct order (starting from the lowest level dependency, up to the current package, in whose folder the script was executed).

This makes contributions to the CDK framework quite tedious, since, if I want to contribute to the AWS Batch package, for example, I need to wait for 64 other packages to be built first. I understand that this is unavoidable but can certainly be optimized.

### Use Case

Contributing to the CDK framework regularly and want to speed up (optimize) a trivial daily activity that is required as part of this.

### Proposed Solution

While computing the current tree of dependencies that need compiling, instead of outputting a flat array of correctly ordered packages that need to be compiled in the correct order, the script should output a flat array of arrays (associative array), where each package in the sub-array can be built in parallel with its direct siblings.

For example, if Package A depends on Package X, Y, Z and package Z depends on K, L, M, the current implementation will compile the packages in the following order, not starting the next package compilation until the previous one finishes:

- K, L, M, X, Y, Z, A

My suggestion is to parallelize the compilation in the following batches:

- K, L, M
- X, Y, Z
- A

### Other Information

It all boils down to some improvements to the scripts/buildup script

### Acknowledgements

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2

### Environment details (OS name and version, etc.)

MacOS

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.