Skip to content

Commit 57ee59a

Browse files
authored
Fix aarch64 nightly/release version override (#1518)
* Aarch64 fix overrdie passing from CI to build * Aarch64 fix overrdie passing from CI to build * Aarch64 fix overrdie passing from CI to build
1 parent 39740d9 commit 57ee59a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

aarch64_linux/aarch64_wheel_ci_build.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def complete_wheel(folder: str):
4848
os.system(f"mv /{folder}/wheelhouse/{repaired_wheel_name} /{folder}/dist/")
4949
else:
5050
repaired_wheel_name = wheel_name
51-
51+
5252
print(f"Copying {repaired_wheel_name} to artfacts")
5353
os.system(f"mv /{folder}/dist/{repaired_wheel_name} /artifacts/")
5454

@@ -85,12 +85,18 @@ def parse_arguments():
8585
build_vars = "CMAKE_SHARED_LINKER_FLAGS=-Wl,-z,max-page-size=0x10000 "
8686
os.system("python setup.py clean")
8787

88-
if branch == 'nightly' or branch == 'master':
89-
build_date = subprocess.check_output(['git', 'log', '--pretty=format:%cs', '-1'], cwd='/pytorch').decode().replace('-', '')
90-
version = subprocess.check_output(['cat', 'version.txt'], cwd='/pytorch').decode().strip()[:-2]
91-
build_vars += f"BUILD_TEST=0 PYTORCH_BUILD_VERSION={version}.dev{build_date} PYTORCH_BUILD_NUMBER=1 "
92-
if branch.startswith("v1.") or branch.startswith("v2."):
93-
build_vars += f"BUILD_TEST=0 PYTORCH_BUILD_VERSION={branch[1:branch.find('-')]} PYTORCH_BUILD_NUMBER=1 "
88+
override_package_version = os.getenv("OVERRIDE_PACKAGE_VERSION")
89+
if override_package_version is not None:
90+
version = override_package_version
91+
build_vars += f"BUILD_TEST=0 PYTORCH_BUILD_VERSION={version} PYTORCH_BUILD_NUMBER=1 "
92+
else:
93+
if branch == 'nightly' or branch == 'master':
94+
build_date = subprocess.check_output(['git', 'log', '--pretty=format:%cs', '-1'], cwd='/pytorch').decode().replace('-', '')
95+
version = subprocess.check_output(['cat', 'version.txt'], cwd='/pytorch').decode().strip()[:-2]
96+
build_vars += f"BUILD_TEST=0 PYTORCH_BUILD_VERSION={version}.dev{build_date} PYTORCH_BUILD_NUMBER=1 "
97+
if branch.startswith("v1.") or branch.startswith("v2."):
98+
build_vars += f"BUILD_TEST=0 PYTORCH_BUILD_VERSION={branch[1:branch.find('-')]} PYTORCH_BUILD_NUMBER=1 "
99+
94100
if enable_mkldnn:
95101
build_ArmComputeLibrary(git_clone_flags)
96102
print("build pytorch with mkldnn+acl backend")

0 commit comments

Comments
 (0)