Skip to content

Commit 0fa023f

Browse files
committed
fix folder create
1 parent 252b347 commit 0fa023f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

backends/qualcomm/scripts/download_qnn_sdk.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,6 @@ def _extract_tar(archive_path: pathlib.Path, prefix: str, target_dir: pathlib.Pa
240240
GLIBC_REEXEC_GUARD = "QNN_GLIBC_REEXEC"
241241
MINIMUM_LIBC_VERSION = GLIBC_VERSION
242242

243-
RPM_URL = (
244-
"https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/35/"
245-
"Everything/x86_64/os/Packages/g/glibc-2.34-7.fc35.x86_64.rpm"
246-
)
247-
248243

249244
def _get_glibc_libdir() -> pathlib.Path:
250245
glibc_root = _get_staging_dir(f"glibc-{GLIBC_VERSION}")
@@ -285,9 +280,18 @@ def _stage_prebuilt_glibc():
285280
_get_glibc_libdir().mkdir(parents=True, exist_ok=True)
286281
rpm_path = _get_staging_dir("glibc") / "glibc.rpm"
287282
work_dir = _get_staging_dir("glibc") / "extracted"
283+
rpm_url = (
284+
"https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/35/"
285+
"Everything/x86_64/os/Packages/g/glibc-2.34-7.fc35.x86_64.rpm"
286+
)
288287

289-
# Download
290-
subprocess.check_call(["curl", "-fsSL", RPM_URL, "-o", str(rpm_path)])
288+
rpm_path.parent.mkdir(parents=True, exist_ok=True)
289+
logger.info("[glibc] Downloading %s -> %s", rpm_url, rpm_path)
290+
try:
291+
urllib.request.urlretrieve(rpm_url, rpm_path)
292+
except Exception as e:
293+
logger.error("[glibc] Failed to download %s: %s", rpm_url, e)
294+
raise
291295

292296
# Extract
293297
if work_dir.exists():

0 commit comments

Comments
 (0)