Skip to content

Commit 5b4ecb3

Browse files
authored
Read sysroot glibc version without conda CLI in build.sh (#3126)
The Linux jobs of the `Conda package` workflow started failing at the wheel install step (e.g. [this run](https://github.com/IntelPython/dpnp/actions/runs/40190014878/job/121158805605)) with: ``` ERROR: dpnp-...-3-cp313-cp313-manylinux___x86_64.whl is not a supported wheel on this platform. ``` The `ubuntu-latest` runner image switched from `ubuntu-24.04` to `ubuntu-26.04`. The new image does not ship Miniconda, so `conda` is no longer on `PATH`. `conda-recipe/build.sh` used `conda list '^sysroot_linux-64$'` to get the glibc version for the `manylinux` platform tag. Under rattler-build that call now fails with `conda: command not found`, both version parts end up empty, and `wheel tags` produces the invalid `manylinux___x86_64` tag. This PR reads the `sysroot_linux-64` version from the `conda-meta` record in `${BUILD_PREFIX}` instead. The package is a build requirement (`stdlib('c')`) in both `rattler_recipe.yaml` and `meta.yaml`, so the record is there under both rattler-build and conda-build. The script now also fails early with a clear error if the version cannot be detected, instead of silently producing a broken tag. It also skips the `conda list` call, which took ~30 seconds per build.
1 parent 888e36a commit 5b4ecb3

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ This release is compatible with NumPy 2.5.
126126
* Fixed importing `dpnp.scipy.sparse` re-enabling the GIL on free-threaded Python builds, because its pybind11 extension did not declare free-threading support [#3101](https://github.com/IntelPython/dpnp/pull/3101)
127127
* Fixed the CuPy-based `dpnp.scipy` tests under `dpnp/tests/third_party/cupyx/scipy_tests/` missing from the `dpnp` package, so they never ran against an installed package [#3102](https://github.com/IntelPython/dpnp/pull/3102)
128128
* Fixed a `RuntimeError` raised by kernels of the `blas`, `statistics`, `ufunc` and `window` extensions and of the legacy backend launched over more than `INT_MAX` work-items when built with DPC++ compiler 2026.2 or newer [#3104](https://github.com/IntelPython/dpnp/pull/3104)
129+
* Fixed the Linux conda build producing a wheel with an invalid `manylinux___x86_64` platform tag when the `conda` CLI is not on `PATH` [#3126](https://github.com/IntelPython/dpnp/pull/3126)
129130

130131
### Security
131132

‎conda-recipe/build.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@ export ICPXCFG
1212
ICXCFG="$(pwd)/icpx_for_conda.cfg"
1313
export ICXCFG
1414

15-
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
16-
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
15+
# Get sysroot glibc version from the build env metadata (no conda CLI needed)
16+
SYSROOT_META=("${BUILD_PREFIX}"/conda-meta/sysroot_linux-64-*.json)
17+
if [[ "${SYSROOT_META[0]##*/}" =~ ^sysroot_linux-64-([0-9]+)\.([0-9]+) ]]; then
18+
GLIBC_MAJOR="${BASH_REMATCH[1]}"
19+
GLIBC_MINOR="${BASH_REMATCH[2]}"
20+
else
21+
echo "Error: unable to detect sysroot_linux-64 version in ${BUILD_PREFIX}" >&2
22+
exit 1
23+
fi
1724

1825
if [ -e "_skbuild" ]; then
1926
${PYTHON} setup.py clean --all

0 commit comments

Comments
 (0)