Skip to content

Commit

Permalink
Exclude inputs from java_runtime.hermetic_src when hermetic is disa…
Browse files Browse the repository at this point in the history
…bled

As noticed by fmeum in #19140 (comment)

PiperOrigin-RevId: 553198526
Change-Id: I47f0ae35c84508d4b64dc82f6f1058fe62c0d683
  • Loading branch information
cushon authored and copybara-github committed Aug 2, 2023
1 parent a76763c commit 4aaa734
Showing 1 changed file with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@ def create_deploy_archive(
input_files = []
input_files.extend(build_info_files)

transitive_input_files = [
resources,
classpath_resources,
runtime_classpath,
runfiles,
]

single_jar = semantics.find_java_toolchain(ctx).single_jar

manifest_lines = list(manifest_lines)
Expand Down Expand Up @@ -209,14 +216,15 @@ def create_deploy_archive(
if multi_release:
args.add("--multi_release")

hermetic_files = runtime.hermetic_files
if hermetic and runtime.lib_modules != None and hermetic_files != None:
if hermetic and runtime.lib_modules != None and runtime.hermetic_files != None:
java_home = runtime.java_home
lib_modules = runtime.lib_modules
hermetic_files = runtime.hermetic_files
args.add("--hermetic_java_home", java_home)
args.add("--jdk_lib_modules", lib_modules)
args.add_all("--resources", hermetic_files)
input_files.append(lib_modules)
transitive_input_files.append(hermetic_files)

if shared_archive == None:
shared_archive = runtime.default_cds
Expand All @@ -228,13 +236,7 @@ def create_deploy_archive(
args.add_all("--add_exports", add_exports)
args.add_all("--add_opens", add_opens)

inputs = depset(input_files, transitive = [
resources,
classpath_resources,
runtime_classpath,
runfiles,
hermetic_files,
])
inputs = depset(input_files, transitive = transitive_input_files)

ctx.actions.run(
mnemonic = "JavaDeployJar",
Expand Down

0 comments on commit 4aaa734

Please sign in to comment.