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

python2.7: Return full path from find_library #33972

Conversation

aneeshusa
Copy link
Contributor

Motivation for this change

Fixes #7307. (Also fixes #33971 in a different way; would love to get both patches in.)

The upstream cpython patch to implement this behavior got reverted as it caused issues on some niche platforms, but I think Nixpkgs can punt on those issues for now.

cc @edolstra and @FRidh who have put in patches around Python's find_library previously.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@FRidh
Copy link
Member

FRidh commented Jan 17, 2018

We should go through the patches and see where they can be merged. This file is touched in several patches. Furthermore, whether we get an absolute path back or not does not matter; occurrences of find_library should be patched with a hardcoded path to the library, because that is needed for during runtime.

@aneeshusa
Copy link
Contributor Author

@FRidh I agree most cases should have a hardcoded path to the library. The point of this patch is to work for Salt, where the final Python file will both be used locally but also can be copied directly to a target system and used as part of salt-ssh. Since the target machine may not have Nix, we can't just hardcode the path to a Nix libcrypto.

I just used this patch to bootstrap several RPis via salt-ssh. #33971 will also address this in a different way if you prefer that.

I personally like to keep patches separate when possible to make it easier to update them.

@mmahut
Copy link
Member

mmahut commented Aug 10, 2019

Are there any updates on this pull request, please?

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@aneeshusa
Copy link
Contributor Author

I am not using Salt or Python 2.7 any more.

@aneeshusa aneeshusa closed this Sep 29, 2020
@aneeshusa aneeshusa deleted the python27-return-full-path-from-find_library branch September 29, 2020 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[python] ctypes.util.find_library should return full path to the library
5 participants