Skip to content

Commit

Permalink
fix: set ROSETTA_MAX_WORKER_COUNT in pack.sh (#16738)
Browse files Browse the repository at this point in the history
Remove global environment variables that are set in buildspec.yml files
as these interfere with more granular settings set in pack.sh, and
instead move all settings there.

The max heap size (8G) configured in pack.sh was overridden by the one
set in buildspec.yml because the last time the option is passed wins,
and pack.sh _prepends_ to `NODE_OPTIONS`.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Romain Marcadier authored Sep 30, 2021
1 parent 7f7be08 commit 5d06641
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
6 changes: 0 additions & 6 deletions buildspec-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ version: 0.2

# This buildspec is intended to be used by GitHub PR builds.

env:
variables:
# Globally allow node to use a lot of memory
NODE_OPTIONS: --max-old-space-size=4096
JSII_ROSETTA_MAX_WORKER_COUNT: 8

phases:
install:
commands:
Expand Down
6 changes: 0 additions & 6 deletions buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ version: 0.2

# This buildspec is intended to be run by CodePipeline builds.

env:
variables:
# Globally allow node to use a lot of memory
NODE_OPTIONS: --max-old-space-size=4096
JSII_ROSETTA_MAX_WORKER_COUNT: 8

phases:
install:
commands:
Expand Down
1 change: 1 addition & 0 deletions pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
set -eu
export PATH=$PWD/node_modules/.bin:$PATH
export NODE_OPTIONS="--max-old-space-size=8192 ${NODE_OPTIONS:-}"
export JSII_ROSETTA_MAX_WORKER_COUNT="${JSII_ROSETTA_MAX_WORKER_COUNT:-8}"
root=$PWD

# Get version and changelog file name (these require that .versionrc.json would have been generated)
Expand Down

0 comments on commit 5d06641

Please sign in to comment.