Skip to content

Allow loading dlls from PATH on windows and python>=3.8#1668

Closed
anderslanglands wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
anderslanglands:main
Closed

Allow loading dlls from PATH on windows and python>=3.8#1668
anderslanglands wants to merge 2 commits into
AcademySoftwareFoundation:mainfrom
anderslanglands:main

Conversation

@anderslanglands

Copy link
Copy Markdown

python 3.8 stopped loading DLLs from PATH, which breaks PyOpenColorIO when it and its dependencies have been built as shared libraries. This PR provides an optional (gated behind an env var) fix to shim the paths in PATH back in using os.add_dll_directory(). This is the same approach as taken by USD.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 10, 2022

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: anderslanglands / name: Anders Langlands (72b5c03)

@lgritz

lgritz commented Jul 10, 2022

Copy link
Copy Markdown
Collaborator

Is an analogous change required on all projects that have Python bindings?

@KelSolaar

Copy link
Copy Markdown
Contributor

Is an analogous change required on all projects that have Python bindings?

It directly related to that: AcademySoftwareFoundation/Imath#238

@anderslanglands

anderslanglands commented Jul 10, 2022 via email

Copy link
Copy Markdown
Author

@remia

remia commented Jul 12, 2022

Copy link
Copy Markdown
Collaborator

Thanks for the PR @anderslanglands! Looks like the commits are missing the sign-off to make GitHub action happy.

@anderslanglands

anderslanglands commented Jul 12, 2022 via email

Copy link
Copy Markdown
Author

@remia

remia commented Jul 13, 2022

Copy link
Copy Markdown
Collaborator

@anderslanglands you can use the --signoff flag when you commit from the CLI, if you want to sign-off the last commit you can also use git commit --amend --signoff. GUI tools will also typically provide a way to do this, I use git-gui which have a button next to the commit. You will probably need to force push to remove the un-signed commit from the PR entirely.

@anderslanglands

anderslanglands commented Jul 13, 2022 via email

Copy link
Copy Markdown
Author

@remia

remia commented Sep 5, 2022

Copy link
Copy Markdown
Collaborator

Hi @anderslanglands, just checking again, do you still plan to update this PR like you mentioned?

@doug-walker

Copy link
Copy Markdown
Collaborator

@anderslanglands , thanks for identifying this problem and proposing a solution. We fixed this issue in PR #1759, so I'll go ahead and close this PR now. Thanks again for your help!

@anderslanglands

anderslanglands commented Mar 18, 2023 via email

Copy link
Copy Markdown
Author

@JeanChristopheMorinPerso

Copy link
Copy Markdown
Member

As a side note, I think it's important to note that it should be opt-in, not opt-out. This can break a lot of things in an environment and should only be activated manually. Basically, it's forcing a behavior in the entire environment, which could potentially break packages which were not expecting that.

@doug-walker

Copy link
Copy Markdown
Collaborator

@JeanChristopheMorinPerso, thank you for your comment. We discussed this during the TSC meeting today and the group agreed that having the default be to emulate the Python 3.7 behavior is not what we want as it could be a security risk. I've created issue #1785 for continuing this discussion, if you or Anders have any further suggestions.

@JeanChristopheMorinPerso

Copy link
Copy Markdown
Member

Great! Thanks for the update @doug-walker!

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.

6 participants