Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py $LIB_ROOT dependency finding interface broken in 9.5.0 #7182

Closed
joshchngs opened this issue May 24, 2023 · 4 comments
Closed

setup.py $LIB_ROOT dependency finding interface broken in 9.5.0 #7182

joshchngs opened this issue May 24, 2023 · 4 comments
Labels

Comments

@joshchngs
Copy link

What did you do?

I'm using Pillow as a transient dependency of matplotlib inside a Nix Flake which uses poetry2nix.
Pillow updated from 9.4.0 to 9.5.0 because of matplotlib's loose specification.

What did you expect to happen?

Transparent update. Rebuild & move on.

What actually happened?

Pillow 9.5.0 fails to find zlib when building.

What are your OS, Python and Pillow versions?

  • OS: macOS 13.3.1 (a) - but Nix is the more relevant point here
  • Python: 3.11
  • Pillow: 9.5.0

This is how Nix injects the correct paths to the native dependencies: https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/python-modules/pillow/generic.nix#L59

So, Pillow's setup.py ends up looking like:

ZLIB_ROOT = "/nix/store/7n13ddp1m3340ls4x3zx9qkjhqidi08x-zlib-1.2.13/lib", "/nix/store/adgjjsasw9f8bvxwqfmv6fbssw1rdc08-zlib-1.2.13-dev/include"

setup.py L471 effectively sets:

lib_root = "/nix/store/7n13ddp1m3340ls4x3zx9qkjhqidi08x-zlib-1.2.13/lib"
include_root = "/nix/store/adgjjsasw9f8bvxwqfmv6fbssw1rdc08-zlib-1.2.13-dev/include"

04cf5e2 broke this usage pattern, because in this case it will now iterate over each string's characters and add them as lib/include paths.

It looks to me that this bug is already resolved by fe4e52d , which is not yet released. The commit message reads like a refactor, so @radarhere I'm not sure if you've spotted that there is actually a functional change?

So, if that commit goes out on the next release everything is fine, but right now 9.5.0 is broken with any system which assigns the (lib_root, include_root) tuple pattern to the ${LIB}_ROOT globals.

@radarhere
Copy link
Member

fe4e52d was a part of #7069.

I think the functionality change you're requesting actually came in d94239a, an earlier part of that PR?

@radarhere
Copy link
Member

I think that earlier commit, and the PR in general, make it clear that we are aware this was a functional change.

@joshchngs does that answer your question?

@joshchngs
Copy link
Author

Yes, that makes sense. I didn't see the link to the PR. The blame for those lines just says "Rearranged code".

I don't have a question, I just wanted to flag that the current release is broken, at least for Nix users.

@radarhere
Copy link
Member

Pillow 10.0.0 has been released with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants