diff --git a/.github/workflows/amd-aie-distro.yml b/.github/workflows/amd-aie-distro.yml index ed2111aed340..837685ee238c 100644 --- a/.github/workflows/amd-aie-distro.yml +++ b/.github/workflows/amd-aie-distro.yml @@ -89,7 +89,7 @@ jobs: LLVM_AIE_PROJECT_COMMIT="${{ inputs.LLVM_AIE_COMMIT }}" fi echo "LLVM_AIE_PROJECT_COMMIT=${LLVM_AIE_PROJECT_COMMIT}" | tee -a $GITHUB_OUTPUT - DATETIME=$(date +"%Y%m%d%H") + DATETIME=$(date +"%Y%m%d%H%M") echo "DATETIME=${DATETIME}" | tee -a $GITHUB_OUTPUT settings: @@ -282,7 +282,7 @@ jobs: run: | pip install pkginfo WHL=$(ls wheelhouse/llvm_aie-*whl) - echo "LLVM_AIE_WHEEL_VERSION=$(python -c "import pkginfo; w = pkginfo.Wheel('$WHL'); print(w.version.split('+')[0] + '+' + w.version.split('+')[1].rsplit('.', 1)[-1])")" | tee -a $GITHUB_OUTPUT + echo "LLVM_AIE_WHEEL_VERSION=$(python -c "import pkginfo; print(pkginfo.Wheel('$WHL').version)")" | tee -a $GITHUB_OUTPUT - name: Download cache from container ubuntu if: contains(matrix.OS, 'ubuntu') && contains(matrix.ARCH, 'x86_64') && (success() || failure()) diff --git a/.github/workflows/amd_aie_releases/setup.py b/.github/workflows/amd_aie_releases/setup.py index c46cf770dcbc..1d8366f54d6d 100644 --- a/.github/workflows/amd_aie_releases/setup.py +++ b/.github/workflows/amd_aie_releases/setup.py @@ -185,6 +185,15 @@ def build_extension(self, ext: CMakeExtension) -> None: ) shutil.rmtree(install_dir / "python_packages", ignore_errors=True) + # Record the source commit inside the wheel. PEP 440 forbids local + # version segments (`+sha`) on PyPI, so the SHA can no longer ride + # along in the version string; pin it here instead. + (install_dir / "commit.txt").write_text( + f"commit={commit_hash}\n" + f"datetime={llvm_datetime}\n" + f"version={version}\n" + ) + subprocess.run( [ "find", @@ -223,10 +232,10 @@ def build_extension(self, ext: CMakeExtension) -> None: now = datetime.now() llvm_datetime = os.getenv( - "DATETIME", f"{now.year}{now.month:02}{now.day:02}{now.hour:02}" + "DATETIME", f"{now.year}{now.month:02}{now.day:02}{now.hour:02}{now.minute:02}" ) -version = f"{llvm_version[0]}.{llvm_version[1]}.{llvm_version[2]}.{llvm_datetime}+{commit_hash}" +version = f"{llvm_version[0]}.{llvm_version[1]}.{llvm_version[2]}.{llvm_datetime}" llvm_url = f"https://github.com/Xilinx/llvm-aie/commit/{commit_hash}" build_temp = Path.cwd() / "build" / "temp"