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

Change search_lib_dir's return type to Result #4043

Merged
merged 3 commits into from
Jun 22, 2024
Merged

Conversation

reswqa
Copy link
Contributor

@reswqa reswqa commented Apr 3, 2024

This closes #3952.

@reswqa reswqa marked this pull request as ready for review April 3, 2024 09:24
@reswqa
Copy link
Contributor Author

reswqa commented Apr 3, 2024

I didn't aware of how to test it, so codecov failed.

let mut sysconfig_paths = vec![];
for f in fs::read_dir(path).expect("Path does not exist") {
for f in fs::read_dir(path)
.context("failed to search the lib dir, please check your path and permissions.")?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should name the relevant environment variables here or possibly add more targeted calls to context at the call sites of search_lib_dir so the user knows what to check exactly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a reference to PYO3_CROSS_LIB_DIR

@davidhewitt
Copy link
Member

I pushed a commit to add a test and more clarity on the hints. Let's merge this; thanks @reswqa for getting this moving (and sorry I took so long to add input here)!

@davidhewitt davidhewitt added this pull request to the merge queue Jun 22, 2024
Merged via the queue into PyO3:main with commit c4d18e5 Jun 22, 2024
35 of 41 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.

panic when PYO3_CROSS_LIB_DIR is set to a missing path
3 participants