Skip to content

Commit

Permalink
Ignore platform constraints so yarn_install result is the same across…
Browse files Browse the repository at this point in the history
… platforms for host!=exec and host!=target builds
  • Loading branch information
jesses-canva authored and christianscott committed Nov 15, 2023
1 parent f901acf commit b915935
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/npm_install/npm_install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ def _yarn_install_impl(repository_ctx):

yarn_args = []

if repository_ctx.attr.ignore_platform:
yarn_args.append("--ignore-platform")

# Set frozen lockfile as default install to install the exact version from the yarn.lock
# file. To perform an yarn install use the vendord yarn binary with:
# `bazel run @nodejs//:yarn install` or `bazel run @nodejs//:yarn install -- -D <dep-name>`
Expand Down Expand Up @@ -905,6 +908,10 @@ to yarn so that the local cache is contained within the external repository.
mandatory = True,
allow_single_file = True,
),
"ignore_platform": attr.bool(
default = False,
doc = "Use the --ignore-platform flag for yarn install. Skips platform checks when installing packages.",
),
}),
environ = PROXY_ENVVARS,
doc = """Runs yarn install during workspace setup.
Expand Down

0 comments on commit b915935

Please sign in to comment.