mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Exclude pdb from nuspec unless it's the winml package. (#10638)
This commit is contained in:
parent
e076f3a125
commit
ecf064f135
1 changed files with 7 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ def is_this_file_needed(ep, filename):
|
|||
# ep: cuda, tensorrt, None
|
||||
# files_list: a list of xml string pieces to append
|
||||
# This function has no return value. It updates files_list directly
|
||||
def generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list):
|
||||
def generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list, include_pdbs):
|
||||
for child in nuget_artifacts_dir.iterdir():
|
||||
if not child.is_dir():
|
||||
continue
|
||||
|
|
@ -52,7 +52,8 @@ def generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list):
|
|||
if child.name == get_package_name('win', cpu_arch, ep):
|
||||
child = child / 'lib'
|
||||
for child_file in child.iterdir():
|
||||
if child_file.suffix in ['.dll', '.pdb', '.lib'] and is_this_file_needed(ep, child_file.name):
|
||||
suffixes = ['.dll', '.lib', '.pdb'] if include_pdbs else ['.dll', '.lib']
|
||||
if child_file.suffix in suffixes and is_this_file_needed(ep, child_file.name):
|
||||
files_list.append('<file src="' + str(child_file) +
|
||||
'" target="runtimes/win-%s/native"/>' % cpu_arch)
|
||||
for cpu_arch in ['x86_64', 'arm64']:
|
||||
|
|
@ -397,6 +398,8 @@ def generate_files(list, args):
|
|||
# Process onnxruntime import lib, dll, and pdb
|
||||
if is_windows_build:
|
||||
nuget_artifacts_dir = Path(args.native_build_path) / 'nuget-artifacts'
|
||||
# the winml package includes pdbs. for other packages exclude them.
|
||||
include_pdbs = includes_winml
|
||||
if nuget_artifacts_dir.exists():
|
||||
# Code path for ADO build pipeline, the files under 'nuget-artifacts' are
|
||||
# downloaded from other build jobs
|
||||
|
|
@ -405,7 +408,7 @@ def generate_files(list, args):
|
|||
else:
|
||||
ep_list = [None]
|
||||
for ep in ep_list:
|
||||
generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list)
|
||||
generate_file_list_for_ep(nuget_artifacts_dir, ep, files_list, include_pdbs)
|
||||
is_ado_packaging_build = True
|
||||
else:
|
||||
# Code path for local dev build
|
||||
|
|
@ -413,7 +416,7 @@ def generate_files(list, args):
|
|||
runtimes + ' />')
|
||||
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.dll') +
|
||||
runtimes + ' />')
|
||||
if os.path.exists(os.path.join(args.native_build_path, 'onnxruntime.pdb')):
|
||||
if include_pdbs and os.path.exists(os.path.join(args.native_build_path, 'onnxruntime.pdb')):
|
||||
files_list.append('<file src=' + '"' + os.path.join(args.native_build_path, 'onnxruntime.pdb') +
|
||||
runtimes + ' />')
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue