From 2bd56c431787dbdcd3ac64eee477964510b0ff85 Mon Sep 17 00:00:00 2001 From: Samvel Khalatyan Date: Fri, 23 Oct 2026 14:15:32 -0500 Subject: [PATCH] exclude man pages from jdk-lib jdk-lib generates a recursive fileset of library files from `/lib`. The `/lib` may hold files that are not dynamic libraries such as man page archives, e.g.: % find /usr/local/lib -type d -name man /usr/local/lib/perl5/5.42/perl/man /usr/local/lib/perl5/site_perl/man /usr/local/lib/node_modules/npm/node_modules/cssesc/man /usr/local/lib/node_modules/npm/man % find /usr/local/lib/perl5/5.42/perl/man -type f -name \*.so\* % find /usr/local/lib/perl5/5.42/perl/man -type f -name \*.gz | head -3 /usr/local/lib/perl5/5.42/perl/man/man1/perlcygwin.1.gz /usr/local/lib/perl5/5.42/perl/man/man1/perlform.1.gz /usr/local/lib/perl5/5.42/perl/man/man1/perlnumber.1.gz One of the problems is that perl5 uses colon in man pages: % find /usr/local/lib/perl5/5.42/perl/man -type f -name \*.gz | grep : | head -3 /usr/local/lib/perl5/5.42/perl/man/man3/Encode::JP.3.gz /usr/local/lib/perl5/5.42/perl/man/man3/Test2::Event::Plan.3.gz /usr/local/lib/perl5/5.42/perl/man/man3/Test::Builder.3.gz Bazel target names (including files in the fileset) does not allow columns, leading to errors like this: ERROR: /home/user/.cache/bazel/_bazel_example/2edd7b3f68d10f544e2471e3b7360f76/external/rules_java++toolchains+local_jdk/BUILD.bazel:51:10: @@rules_java++toolchains+local_jdk//:jdk-lib: invalid label 'lib/perl5/5.42/perl/man/man3/App::Cpan.3.gz' in element 14608 of attribute 'srcs' of 'filegroup': invalid target name ':Cpan.3.gz': target names may not contain ':' This change excludes `**/man/**` folders from jdk-lib. NO_ISSUE --- toolchains/jdk_build_file.bzl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchains/jdk_build_file.bzl b/toolchains/jdk_build_file.bzl index c0ed1608..e4fc673c 100644 --- a/toolchains/jdk_build_file.bzl +++ b/toolchains/jdk_build_file.bzl @@ -68,8 +68,11 @@ filegroup( ["lib/**", "release"], allow_empty = True, exclude = [ + # keep-sorted start + "lib/**/man/**", "lib/missioncontrol/**", "lib/visualvm/**", + # keep-sorted end ], ), )