Skip to content

Commit a4298ad

Browse files
committed
add a better log message and normalize os and arch values
1 parent 159c432 commit a4298ad

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

python/private/pypi/hub_builder.bzl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
load("//python/private:full_version.bzl", "full_version")
44
load("//python/private:normalize_name.bzl", "normalize_name")
5+
load("//python/private:repo_utils.bzl", "repo_utils")
56
load("//python/private:version.bzl", "version")
67
load("//python/private:version_label.bzl", "version_label")
78
load(":attrs.bzl", "use_isolated")
@@ -314,7 +315,10 @@ def _platforms(module_ctx, *, python_version, config, target_platforms):
314315
)
315316

316317
target_platforms = sorted({
317-
p.format(os = module_ctx.os.name, arch = module_ctx.os.arch): None
318+
p.format(
319+
os = repo_utils.get_platforms_os_name(module_ctx),
320+
arch = repo_utils.get_platforms_cpu_name(module_ctx),
321+
): None
318322
for p in target_platforms
319323
})
320324

python/private/pypi/requirements_files_by_platform.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def requirements_files_by_platform(
142142
if logger:
143143
logger.debug(lambda: "Platforms from pip args: {}".format(platforms_from_args))
144144

145+
input_platforms = platforms
145146
default_platforms = platforms
146147

147148
if platforms_from_args:
@@ -227,9 +228,10 @@ def requirements_files_by_platform(
227228
configured_platforms[p] = file
228229

229230
elif logger:
230-
logger.debug(lambda: "File {} will be ignored because there are no configured platforms: {}".format(
231+
logger.info(lambda: "File {} will be ignored because there are no configured platforms: {} out of {}".format(
231232
file,
232233
default_platforms,
234+
input_platforms,
233235
))
234236
continue
235237

0 commit comments

Comments
 (0)