From 323ecd5cf0b8b4a64dcc0eafcc210c4df52c9a54 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 03:39:10 +0000 Subject: [PATCH 1/2] Implement install_slang_compiler() in ci.py --- .github/workflows/ci.py | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index 578b5d672..2bc5899ec 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -4,8 +4,10 @@ import glob import io +import json import lzma import os +import platform import shlex import shutil import subprocess @@ -101,10 +103,38 @@ def install_fonts() -> None: def install_slang_compiler() -> None: - # TODO: Install the latest slang compiler binary release from https://github.com/shader-slang/slang - # It needs to be installed so that we can use the header files and - # libraries via pkgconf - ... + os_name = 'macos' if is_macos else 'linux' + machine = platform.machine().lower() + arch = 'aarch64' if machine in ('aarch64', 'arm64') else 'x86_64' + + api_req = Request( + 'https://api.github.com/repos/shader-slang/slang/releases/latest', + headers={'Accept': 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28'}, + ) + release = json.loads(download_with_retry(api_req)) + version = release['tag_name'].lstrip('v') + + asset_name = f'slang-{version}-{os_name}-{arch}.tar.gz' + url = '' + for asset in release['assets']: + if asset['name'] == asset_name: + url = asset['browser_download_url'] + break + if not url: + raise SystemExit(f'Could not find slang release asset: {asset_name}') + + install_dir = '/tmp/slang' + os.makedirs(install_dir, exist_ok=True) + data = download_with_retry(url) + with tarfile.open(fileobj=io.BytesIO(data), mode='r:gz') as tf: + try: + tf.extractall(install_dir, filter='fully_trusted') + except TypeError: + tf.extractall(install_dir) + + pc_dir = os.path.join(install_dir, 'lib', 'pkgconfig') + pp = os.environ.get('PKG_CONFIG_PATH', '') + os.environ['PKG_CONFIG_PATH'] = f'{pc_dir}:{pp}' if pp else pc_dir def install_deps() -> None: From f80a36e42eeac7a2488aa5743333ed348ce3dd21 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Jun 2026 03:40:53 +0000 Subject: [PATCH 2/2] Address code review: use url=None, add TypeError comment --- .github/workflows/ci.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.py b/.github/workflows/ci.py index 2bc5899ec..e9c9bad5b 100644 --- a/.github/workflows/ci.py +++ b/.github/workflows/ci.py @@ -115,12 +115,12 @@ def install_slang_compiler() -> None: version = release['tag_name'].lstrip('v') asset_name = f'slang-{version}-{os_name}-{arch}.tar.gz' - url = '' + url = None for asset in release['assets']: if asset['name'] == asset_name: url = asset['browser_download_url'] break - if not url: + if url is None: raise SystemExit(f'Could not find slang release asset: {asset_name}') install_dir = '/tmp/slang' @@ -130,6 +130,7 @@ def install_slang_compiler() -> None: try: tf.extractall(install_dir, filter='fully_trusted') except TypeError: + # filter parameter not supported on older Python versions tf.extractall(install_dir) pc_dir = os.path.join(install_dir, 'lib', 'pkgconfig')