-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6347c5f
commit 6562433
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,11 @@ def _build_aar(args): | |
|
||
subprocess.run(abi_build_command, env=temp_env, shell=False, check=True, cwd=REPO_DIR) | ||
|
||
# TODO: Remove | ||
abi_build_dir_files = os.listdir(abi_build_dir) | ||
Check warning Code scanning / lintrunner RUFF/F841 Warning
Local variable abi\_build\_dir\_files is assigned to but never used.
See https://docs.astral.sh/ruff/rules/unused-variable Check notice Code scanning / CodeQL Unused local variable Note
Variable abi_build_dir_files is not used.
|
||
print("[REMOVE]: {abi_build_dir=} contents:") | ||
print(abi_jnilibs_dir_files) | ||
Check failure Code scanning / lintrunner RUFF/F821 Error
Undefined name abi\_jnilibs\_dir\_files.
See https://docs.astral.sh/ruff/rules/undefined-name |
||
|
||
# create symbolic links for libonnxruntime.so and libonnxruntime4j_jni.so | ||
# to jnilibs/[abi] for later compiling the aar package | ||
abi_jnilibs_dir = os.path.join(jnilibs_dir, abi) | ||
|
@@ -139,8 +144,15 @@ def _build_aar(args): | |
# add double check with os.path.islink | ||
if os.path.exists(target_lib_name) or os.path.islink(target_lib_name): | ||
os.remove(target_lib_name) | ||
print(f"[REMOVE]: Making sym link from {os.path.join(abi_build_dir, build_config, lib_name)} to " | ||
f"{target_lib_name}") | ||
os.symlink(os.path.join(abi_build_dir, build_config, lib_name), target_lib_name) | ||
|
||
# TODO: Remove | ||
abi_jnilibs_dir_files = os.listdir(abi_jnilibs_dir) | ||
print("[REMOVE]: {abi_jnilibs_dir=} contents:") | ||
print(abi_jnilibs_dir_files) | ||
|
||
# copy executables for each abi, in case we want to publish those as well | ||
# some of them might not exist, e.g., if we skip building the tests | ||
abi_exe_dir = os.path.join(exe_dir, abi) | ||
|
@@ -150,12 +162,19 @@ def _build_aar(args): | |
for exe_name in execs_to_copy: | ||
src_exe_path = os.path.join(abi_build_dir, build_config, exe_name) | ||
if not os.path.exists(src_exe_path): | ||
print(f"[REMOVE]: Source exe path does not exist: {src_exe_path}") | ||
continue | ||
|
||
os.makedirs(abi_exe_dir, exist_ok=True) | ||
dest_exe_path = os.path.join(abi_exe_dir, exe_name) | ||
print(f"[REMOVE]: Copying {src_exe_path} to {dst_exe_path}") | ||
Check failure Code scanning / lintrunner RUFF/F821 Error
Undefined name dst\_exe\_path.
See https://docs.astral.sh/ruff/rules/undefined-name |
||
shutil.copyfile(src_exe_path, dest_exe_path) | ||
|
||
# TODO: Remove | ||
abi_exe_dir_files = os.listdir(abi_exe_dir) | ||
print("[REMOVE]: {abi_exe_dir=} contents:") | ||
print(abi_exe_dir_files) | ||
|
||
# we only need to define the header files path once | ||
if not header_files_path: | ||
header_files_path = os.path.join(abi_build_dir, build_config, "android", "headers") | ||
|