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

Set PXR_USD_WINDOWS_DLL_PATH on Windows #5949

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

ericmehl
Copy link
Collaborator

@ericmehl ericmehl commented Jul 9, 2024

This sets the PXR_USD_WINDOWS_DLL_PATH environment variable if it has not been set already. That variable helps USD setup the Python binary search paths, making sure it finds for our USD installation. Some users were finding that USD was attempting to load binaries from other installations they have on their system which was causing errors.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

bin/gaffer.cmd Outdated
@@ -19,6 +19,9 @@ call :prependToPath "%GAFFER_ROOT%\ops" IECORE_OP_PATHS

call :prependToPath "%GAFFER_ROOT%\resources\IECoreUSD" PXR_PLUGINPATH_NAME
call :prependToPath "%GAFFER_ROOT%\materialX" PXR_MTLX_STDLIB_SEARCH_PATHS
if "%PXR_USD_WINDOWS_DLL_PATH%" EQU "" (
set PXR_USD_WINDOWS_DLL_PATH=%GAFFER_ROOT%/lib
Copy link
Member

Choose a reason for hiding this comment

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

One question about this - we already call add_dll_directory() for GAFFER_ROOT/lib, right? So is this about stopping USD using PATH more than it is about getting USD to use GAFFER_ROOT/lib? If so, would it be more accurate to set the env -var to ""?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I guess this is more about preventing PATH entries from getting used since we're already setting the right binary path. I amended the commit and the commit wording and changelog entry to reflect that.

I also verified this works by pointing my PATH at a conflicting USD installation, checking that it fails without this patch and that the patch fixes it.

If this variable is set, USD will not add the entries from `PATH` to the
Python binary search paths. We set it to an empty string because the
`Gaffer` module adds the proper binary path and our intention here is
only to prevent USD from adding `PATH` entries.
@johnhaddon johnhaddon merged commit 282c2b4 into GafferHQ:1.4_maintenance Jul 10, 2024
2 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.

2 participants