Skip to content

Search PREFIX for libhwy so conda-build links the extension correctly - #42

Merged
hmaarrfk merged 1 commit into
ramonaoptics:mainfrom
hmaarrfk:fix-prefix-hwy-search
Aug 9, 2026
Merged

hmaarrfk merged 1 commit into
ramonaoptics:mainfrom
hmaarrfk:fix-prefix-hwy-search

Conversation

@hmaarrfk

@hmaarrfk hmaarrfk commented Aug 9, 2026

Copy link
Copy Markdown
Member

Prepared by Mark Harfouche's Claude bot; Mark Harfouche (@hmaarrfk) reviews via the GitHub interface.

setup.py's libhwy search only consulted CONDA_PREFIX (an activated developer environment); under conda-build the host prefix is PREFIX and CONDA_PREFIX is not set for build scripts, so the conda-forge 0.10.2 builds underlinked the extension, which failed at import with undefined symbol: hwy::GetChosenTarget(). Search both variables.

The conda-forge recipe backports this exact commit as a patch for 0.10.2 (replacing a CONDA_PREFIX=$PREFIX shim); the next release makes the patch unnecessary.

https://claude.ai/code/session_015rdawfurPCmefzjoeFfuC4

<details><summary>Claude's draft</summary>

setup.py's libhwy search only consulted CONDA_PREFIX, which covers an
activated developer environment but not conda-build: there the host
prefix is exposed as PREFIX and CONDA_PREFIX is not set for build
scripts, so the extension silently underlinked and failed at import
with "undefined symbol: hwy::GetChosenTarget()" on conda-forge CI.
Search both variables. The conda-forge 0.10.2 recipe carries this as
a patch until the next release ships it.

Resume this Claude session:
```
cd /home/mark/git/jp2k
claude --resume 487c1e20-36f3-416f-8be1-437c25ed67fe
```
</details>
hmaarrfk added a commit to hmaarrfk/ojph-feedstock that referenced this pull request Aug 9, 2026
<details><summary>Claude's draft</summary>

Replace the CONDA_PREFIX=PREFIX workaround in build.sh/bld.bat with a
proper source patch backporting ramonaoptics/ojph#42: setup.py now
searches PREFIX (the conda-build host prefix) in addition to
CONDA_PREFIX when locating libhwy, so the extension links it without
environment tricks. The patch applies cleanly to the 0.10.2 sdist and
should be dropped with the next upstream release.

Resume this Claude session:
```
cd /home/mark/git/jp2k
claude --resume 487c1e20-36f3-416f-8be1-437c25ed67fe
```
</details>
@hmaarrfk
hmaarrfk merged commit dc9fb0a into ramonaoptics:main Aug 9, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant