Skip to content

Commit f3fd1e4

Browse files
jbedardangular-robot[bot]
authored andcommitted
build: update bazel pkg tars to .tgz file extension
1 parent 9b6d190 commit f3fd1e4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

scripts/build-bazel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export default async function (
139139
for (const target of targets) {
140140
const packageDir = target.replace(/\/\/packages\/(.*):npm_package_archive/, '$1');
141141
const bazelOutDir = join(bazelBin, 'packages', packageDir, 'npm_package');
142-
const tarPath = `${bazelBin}/packages/${packageDir}/npm_package_archive.tar.gz`;
142+
const tarPath = `${bazelBin}/packages/${packageDir}/npm_package_archive.tgz`;
143143
const packageJsonPath = `${bazelOutDir}/package.json`;
144144
const packageName = require(packageJsonPath).name;
145145
const destDir = `${distRoot}/${packageName}`;

tools/defaults.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
5959
in the same folder to exist.
6060
6161
Args:
62-
name: Name of the pkg_npm rule. '_archive.tar.gz' is appended to create the tarball.
62+
name: Name of the pkg_npm rule. '_archive.tgz' is appended to create the tarball.
6363
pkg_deps: package.json files of dependent packages. These are used for local path substitutions when --config=local is set.
6464
use_prodmode_output: False to ship ES5 devmode output, True to ship ESM output. Defaults to False.
6565
**kwargs: Additional arguments passed to the real pkg_npm.
@@ -116,7 +116,7 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
116116
)
117117

118118
# Copy package.json files to bazel-out so we can use their bazel-out paths to determine
119-
# the corresponding package npm package tar.gz path for substitutions.
119+
# the corresponding package npm package tgz path for substitutions.
120120
copy_to_bin(
121121
name = "package_json_copy",
122122
srcs = [pkg_json],
@@ -195,7 +195,7 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
195195
pkg_tar(
196196
name = name + "_archive",
197197
srcs = [":%s" % name],
198-
extension = "tar.gz",
198+
extension = "tgz",
199199
strip_prefix = "./%s" % name,
200200
visibility = visibility,
201201
)

tools/link_package_json_to_tarballs.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ load("@aspect_bazel_lib//lib:utils.bzl", "to_label")
88
def link_package_json_to_tarballs(name, src, pkg_deps, out):
99
"""Substitute tar paths into a package.json file for the packages it depends on.
1010
11-
src and pkg_deps must be labels in the bazel-out tree for the derived path to the npm_package_archive.tar.gz to be correct.
11+
src and pkg_deps must be labels in the bazel-out tree for the derived path to the npm_package_archive.tgz to be correct.
1212
1313
Args:
1414
name: Name of the rule
@@ -41,7 +41,7 @@ def link_package_json_to_tarballs(name, src, pkg_deps, out):
4141
# for the tar for this package as that would create a circular dependency.
4242
pkg_label = to_label(pkg_dep)
4343
if pkg_label.package != src_pkg:
44-
pkg_tar = "@%s//%s:npm_package_archive.tar.gz" % (pkg_label.workspace_name, pkg_label.package)
44+
pkg_tar = "@%s//%s:npm_package_archive.tgz" % (pkg_label.workspace_name, pkg_label.package)
4545
srcs.append(pkg_tar)
4646

4747
# Deriving the absolute path to the tar in the execroot requries different
@@ -53,7 +53,7 @@ def link_package_json_to_tarballs(name, src, pkg_deps, out):
5353
name = "%s_%s_filter" % (name, i),
5454
srcs = srcs,
5555
cmd = """
56-
TAR=$$(dirname $$({abs_path_sandbox} || {abs_path_nosandbox}))/npm_package_archive.tar.gz
56+
TAR=$$(dirname $$({abs_path_sandbox} || {abs_path_nosandbox}))/npm_package_archive.tgz
5757
PKGNAME=$$(cat $(execpath {pkg_name}))
5858
if [[ "$$TAR" != *bazel-out* ]]; then
5959
echo "ERROR: package.json passed to substitute_tar_deps must be in the output tree. You can use copy_to_bin to copy a source file to the output tree."

0 commit comments

Comments
 (0)