Skip to content

Commit

Permalink
chore(build): Disable concurrency in pack.sh (aws#2723)
Browse files Browse the repository at this point in the history
There appear to be a file system race condition during dotnet project
builds where parallel instances race for the same files, resulting in
sporadic build failures due to not being able to access a file (that was
cleaned up by another process already).

Disabling parallelism seems to be the easiest way forward, and also the
cheapest way to validate the root cause was correctly identified.

The `buildspec.yml` will allow skipping pack.sh if the `SKIP_PACK`
environment variable is set.
  • Loading branch information
RomainMuller authored Jun 3, 2019
1 parent 0c72ef3 commit e8e3803
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ phases:
- /bin/bash ./build.sh
post_build:
commands:
- "[ -f .BUILD_COMPLETED ] && /bin/bash ./pack.sh"
- "[ -f .BUILD_COMPLETED ] && [ -z "${SKIP_PACK:-}" ] && /bin/bash ./pack.sh"
artifacts:
files:
- "**/*"
Expand Down
2 changes: 1 addition & 1 deletion pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ scopes=$(lerna ls 2>/dev/null | grep -v "(private)" | cut -d" " -f1 | xargs -n1
# Run the "cdk-package" script in all modules. For jsii modules, this invokes jsii-pacmak which generates and builds multi-language
# outputs. For non-jsii module, it will just run "npm pack" and place the output in dist/npm
# (which is similar to how pacmak outputs it).
lerna run ${scopes} --sort --stream package
lerna run ${scopes} --sort --concurrency=1 --stream package

# Collect dist/ from all modules into the root dist/
for dir in $(find packages -name dist | grep -v node_modules); do
Expand Down

0 comments on commit e8e3803

Please sign in to comment.