Skip to content

Commit

Permalink
setup python dist to remove internal build suffix for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Oct 9, 2024
1 parent da614c6 commit 48aa2f6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ stages:
- script: echo '##vso[task.prependpath]/tmp/arm-toolchain/aarch64-none-linux-gnu/libc/usr/bin'
- script: echo $PATH
- script: stat /tmp/arm-toolchain/bin/aarch64-none-linux-gnu-gcc
- script: python scripts/mk_unix_dist.py --nodotnet --nojava --arch=arm64
- script: python scripts/mk_unix_dist.py --nodotnet --arch=arm64
- task: CopyFiles@2
inputs:
sourceFolder: dist
Expand Down
15 changes: 15 additions & 0 deletions src/api/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,25 @@ def run(self):
self.execute(_copy_sources, (), msg="Copying source files")
_sdist.run(self)

# The Azure Dev Ops pipelines use internal OS version tagging that don't correspond
# to releases.

internal_build_re = re.compile("((.+)\_7")

class bdist_wheel(_bdist_wheel):

def remove_build_machine_os_version(self, platform, os_version_tag):
if platform in ["osx", "darwin", "sequoia"]:
m = internal_build_re.search(os_version_tag):
if m:
return m.group(1)
return os_version_tag


def finalize_options(self):
if BUILD_ARCH is not None and BUILD_PLATFORM is not None:
os_version_tag = '_'.join(BUILD_OS_VERSION[:2]) if BUILD_OS_VERSION is not None else 'xxxxxx'
os_version_tag = self.remove_build_machine_os_version(BUILD_PLATFORM, os_version_tag)
TAGS = {
# linux tags cannot be deployed - they must be auditwheel'd to pick the right compatibility tag based on imported libc symbol versions
("linux", "x86_64"): "linux_x86_64",
Expand Down

0 comments on commit 48aa2f6

Please sign in to comment.