From 7fa1472f8400ca8e60984bf977892123affd5c10 Mon Sep 17 00:00:00 2001 From: eoinm Date: Sat, 25 Apr 2020 11:17:21 +1000 Subject: [PATCH 1/7] Inject common LD_LIBRARY_PATHs into add_maya_test cmake function --- cmake/test.cmake | 10 ++++++++++ plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmake/test.cmake b/cmake/test.cmake index 0db26b1c50..6e0c01402d 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -32,6 +32,7 @@ endfunction() # MAYA_PLUG_IN_PATH # MAYA_SCRIPT_PATH # PXR_PLUGINPATH_NAME +# LD_LIBRARY_PATH # Note that the format of these name/value pairs should # be the same as that used with # `set_property(TEST test_name APPEND PROPERTY ENVIRONMENT ...)` @@ -129,6 +130,7 @@ finally: MAYA_PLUG_IN_PATH MAYA_SCRIPT_PATH PXR_PLUGINPATH_NAME + LD_LIBRARY_PATH ) # Set initial empty values for all path vars @@ -178,6 +180,14 @@ finally: "${CMAKE_INSTALL_PREFIX}/plugin/al/lib/usd") list(APPEND mayaUsd_varname_PXR_PLUGINPATH_NAME "${CMAKE_INSTALL_PREFIX}/plugin/al/plugin") + if (IS_LINUX AND CMAKE_SKIP_RPATH) + list(APPEND mayaUsd_varname_LD_LIBRARY_PATH + "$ENV{LD_LIBRARY_PATH}") + list(APPEND mayaUsd_varname_LD_LIBRARY_PATH + "${CMAKE_INSTALL_PREFIX}/lib") + list(APPEND mayaUsd_varname_LD_LIBRARY_PATH + "${CMAKE_INSTALL_PREFIX}/plugin/al/lib") + endif() # inherit PATH and PYTHONPATH from ENV to get USD entries # these should come last (esp PYTHONPATH, in case another module is overriding diff --git a/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h b/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h index 40c3ae68e5..770683beb2 100644 --- a/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h +++ b/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h @@ -22,7 +22,7 @@ #define AL_USDMAYA_VERSION_MAJOR 1 #define AL_USDMAYA_VERSION_MINOR 0 -#define AL_USDMAYA_VERSION_PATCH 0 +#define AL_USDMAYA_VERSION_PATCH 2 #define AL_USDMAYA_VERSION_STR xstr(AL_USDMAYA_VERSION_MAJOR) "." \ xstr(AL_USDMAYA_VERSION_MINOR) "." \ From 37e12d72c9d32a8bf9f8855807e662aa1a7b730a Mon Sep 17 00:00:00 2001 From: Eoin Murphy Date: Sat, 25 Apr 2020 11:39:28 +1000 Subject: [PATCH 2/7] remove patch version update --- plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h b/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h index 770683beb2..40c3ae68e5 100644 --- a/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h +++ b/plugin/al/lib/AL_USDMaya/AL/usdmaya/Version.h @@ -22,7 +22,7 @@ #define AL_USDMAYA_VERSION_MAJOR 1 #define AL_USDMAYA_VERSION_MINOR 0 -#define AL_USDMAYA_VERSION_PATCH 2 +#define AL_USDMAYA_VERSION_PATCH 0 #define AL_USDMAYA_VERSION_STR xstr(AL_USDMAYA_VERSION_MAJOR) "." \ xstr(AL_USDMAYA_VERSION_MINOR) "." \ From f8cf4f7a692f89aa83f9c5ba6b8e548825a11506 Mon Sep 17 00:00:00 2001 From: eoinm Date: Sun, 17 May 2020 17:25:08 +1000 Subject: [PATCH 3/7] update AL tests to accept additional LD_LIBRARY_PATH var --- .../al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt | 1 + plugin/al/plugin/AL_USDMayaTestPlugin/CMakeLists.txt | 1 + plugin/al/plugin/AL_USDMayaTestPlugin/py/CMakeLists.txt | 4 ++++ plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt | 1 + plugin/al/translators/pxrUsdTranslators/tests/CMakeLists.txt | 1 + plugin/al/translators/tests/CMakeLists.txt | 1 + .../al/usdtransaction/AL/usd/transaction/tests/CMakeLists.txt | 4 ++++ 7 files changed, 13 insertions(+) diff --git a/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt b/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt index 80099e50e0..f6a2a26c22 100644 --- a/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt +++ b/plugin/al/mayautils/AL/maya/tests/mayaplugintest/CMakeLists.txt @@ -95,4 +95,5 @@ mayaUsd_add_test(${TARGET_NAME} ENV "MAYA_PLUG_IN_PATH=${MAYAUTILS_TEST_MAYAPLUGIN_INSTALL_PATH}" "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) diff --git a/plugin/al/plugin/AL_USDMayaTestPlugin/CMakeLists.txt b/plugin/al/plugin/AL_USDMayaTestPlugin/CMakeLists.txt index ddd8a3328b..731331e930 100644 --- a/plugin/al/plugin/AL_USDMayaTestPlugin/CMakeLists.txt +++ b/plugin/al/plugin/AL_USDMayaTestPlugin/CMakeLists.txt @@ -138,6 +138,7 @@ mayaUsd_add_test(${TARGET_NAME} PYTHON_COMMAND "${pycode}" ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) if(NOT SKIP_USDMAYA_TESTS) diff --git a/plugin/al/plugin/AL_USDMayaTestPlugin/py/CMakeLists.txt b/plugin/al/plugin/AL_USDMayaTestPlugin/py/CMakeLists.txt index a745f5148c..79ef4d2573 100644 --- a/plugin/al/plugin/AL_USDMayaTestPlugin/py/CMakeLists.txt +++ b/plugin/al/plugin/AL_USDMayaTestPlugin/py/CMakeLists.txt @@ -2,23 +2,27 @@ mayaUsd_add_test(TestALUSDMayaPython_ProxyShape PYTHON_MODULE testProxyShape ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) mayaUsd_add_test(TestALUSDMayaPython_Translators PYTHON_MODULE testTranslators ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) mayaUsd_add_test(TestALUSDMayaPython_LayerManager PYTHON_MODULE testLayerManager ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) mayaUsd_add_test(TestALUSDMayaPython_ImportModule PYTHON_MODULE testUSDMayaPythonModuleOnly ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" NO_STANDALONE_INIT ) \ No newline at end of file diff --git a/plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt b/plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt index 2327b3606b..c511ce1a9d 100644 --- a/plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt +++ b/plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt @@ -51,4 +51,5 @@ mayaUsd_add_test(${TARGET_NAME} COMMAND $ ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) diff --git a/plugin/al/translators/pxrUsdTranslators/tests/CMakeLists.txt b/plugin/al/translators/pxrUsdTranslators/tests/CMakeLists.txt index d6535393d1..072c11ec6a 100644 --- a/plugin/al/translators/pxrUsdTranslators/tests/CMakeLists.txt +++ b/plugin/al/translators/pxrUsdTranslators/tests/CMakeLists.txt @@ -6,4 +6,5 @@ mayaUsd_add_test(${TEST_NAME} "PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}" "TEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}" "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) diff --git a/plugin/al/translators/tests/CMakeLists.txt b/plugin/al/translators/tests/CMakeLists.txt index f47a8a25e2..5088345b2e 100644 --- a/plugin/al/translators/tests/CMakeLists.txt +++ b/plugin/al/translators/tests/CMakeLists.txt @@ -2,4 +2,5 @@ mayaUsd_add_test(TestAdditionalTranslators PYTHON_MODULE testTranslators ENV "PXR_PLUGINPATH_NAME=${ADDITIONAL_PXR_PLUGINPATH_NAME}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) diff --git a/plugin/al/usdtransaction/AL/usd/transaction/tests/CMakeLists.txt b/plugin/al/usdtransaction/AL/usd/transaction/tests/CMakeLists.txt index 7c838264bf..df18693f41 100644 --- a/plugin/al/usdtransaction/AL/usd/transaction/tests/CMakeLists.txt +++ b/plugin/al/usdtransaction/AL/usd/transaction/tests/CMakeLists.txt @@ -48,10 +48,14 @@ target_include_directories(${USDTRANSACTION_TEST_EXECUTABLE_NAME} mayaUsd_add_test(${USDTRANSACTION_TEST_NAME} COMMAND ${USDTRANSACTION_TEST_EXECUTABLE_NAME} + ENV + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) mayaUsd_add_test(${USDTRANSACTION_PYTHON_TEST_NAME} COMMAND ${MAYA_PY_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR} + ENV + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) if (TARGET all_tests) From abf6b71e611f15e96026e37f28102d4971e29198 Mon Sep 17 00:00:00 2001 From: eoinm Date: Sun, 17 May 2020 20:04:55 +1000 Subject: [PATCH 4/7] add LD_LIBRARY path to non-AL tests --- test/lib/CMakeLists.txt | 2 ++ test/lib/ufe/CMakeLists.txt | 1 + test/lib/usd/schemas/CMakeLists.txt | 2 ++ test/lib/usd/utils/CMakeLists.txt | 2 ++ 4 files changed, 7 insertions(+) diff --git a/test/lib/CMakeLists.txt b/test/lib/CMakeLists.txt index 7cfd4b5f50..4ba54ee659 100644 --- a/test/lib/CMakeLists.txt +++ b/test/lib/CMakeLists.txt @@ -16,6 +16,8 @@ foreach(script ${test_script_files}) mayaUsd_get_unittest_target(target ${script}) mayaUsd_add_test(${target} PYTHON_MODULE ${target} + ENV + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) endforeach() diff --git a/test/lib/ufe/CMakeLists.txt b/test/lib/ufe/CMakeLists.txt index 67e8b5a4bf..6bb59655a1 100644 --- a/test/lib/ufe/CMakeLists.txt +++ b/test/lib/ufe/CMakeLists.txt @@ -57,6 +57,7 @@ foreach(script ${test_script_files}) ENV "MAYA_PLUG_IN_PATH=${CMAKE_CURRENT_BINARY_DIR}/ufeTestPlugins" "UFE_PREVIEW_VERSION_NUM=${UFE_PREVIEW_VERSION_NUM}" + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) # Assign a ctest label to these tests for easy filtering. diff --git a/test/lib/usd/schemas/CMakeLists.txt b/test/lib/usd/schemas/CMakeLists.txt index a617a9acd7..6dc8b829c1 100644 --- a/test/lib/usd/schemas/CMakeLists.txt +++ b/test/lib/usd/schemas/CMakeLists.txt @@ -18,5 +18,7 @@ foreach(script ${test_script_files}) mayaUsd_get_unittest_target(target ${script}) mayaUsd_add_test(${target} PYTHON_MODULE ${target} + ENV + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) endforeach() diff --git a/test/lib/usd/utils/CMakeLists.txt b/test/lib/usd/utils/CMakeLists.txt index c16b6c23c9..f57d6ed496 100644 --- a/test/lib/usd/utils/CMakeLists.txt +++ b/test/lib/usd/utils/CMakeLists.txt @@ -30,4 +30,6 @@ target_link_libraries(${TARGET_NAME} # ----------------------------------------------------------------------------- mayaUsd_add_test(${TARGET_NAME} COMMAND $ + ENV + "LD_LIBRARY_PATH=${ADDITIONAL_LD_LIBRARY_PATH}" ) From 872ebae2c6bded88dacf93aafc94c18ef6a209e7 Mon Sep 17 00:00:00 2001 From: eoinm Date: Sun, 17 May 2020 20:29:16 +1000 Subject: [PATCH 5/7] update docs --- doc/build.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/build.md b/doc/build.md index 23a0647fcb..4dea813152 100644 --- a/doc/build.md +++ b/doc/build.md @@ -234,6 +234,18 @@ setuptools 39.0.1 shiboken2 5.12.1 ``` +##### dependencies on Linux DSOs when running tests +Normally either runpath or rpath are used to reference dependencies such as the USD libraries. + +If for some reason you don't want to use either of these options, and switch them off with: +``` +CMAKE_SKIP_RPATH=TRUE +``` +..you can inject LD_LIBRARY_PATH into any of the mayaUSD_add_test calls by setting the ADDITIONAL_LD_LIBRARY_PATH cmake variable to $ENV{LD_LIBRARY_PATH} or similar. +There is a related ADDITIONAL_PXR_PLUGINPATH_NAME cmake var which can be used if schemas are installed in a non-standard location + + + # How to Load Plug-ins in Maya The provided module file (*.mod) facilitates setting various environment variables for plugins and libraries. After the project is successfully built, ```mayaUsd.mod``` is installed inside the install directory. In order for Maya to discover this mod file, ```MAYA_MODULE_PATH``` environment variable needs to be set to point to the location where the mod file is installed. From 8218a43dd2fe01380610e924838cee01cc0c640c Mon Sep 17 00:00:00 2001 From: eoinm Date: Tue, 19 May 2020 12:33:59 +1000 Subject: [PATCH 6/7] tweak build doc --- doc/build.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/build.md b/doc/build.md index 4dea813152..295e1e4c18 100644 --- a/doc/build.md +++ b/doc/build.md @@ -235,13 +235,15 @@ shiboken2 5.12.1 ``` ##### dependencies on Linux DSOs when running tests -Normally either runpath or rpath are used to reference dependencies such as the USD libraries. + +Normally either runpath or rpath are used on some DSOs in this library to specify explicit on other libraries (such as USD itself) If for some reason you don't want to use either of these options, and switch them off with: ``` CMAKE_SKIP_RPATH=TRUE ``` -..you can inject LD_LIBRARY_PATH into any of the mayaUSD_add_test calls by setting the ADDITIONAL_LD_LIBRARY_PATH cmake variable to $ENV{LD_LIBRARY_PATH} or similar. +To allow your tests to run, you can inject LD_LIBRARY_PATH into any of the mayaUSD_add_test calls by setting the ADDITIONAL_LD_LIBRARY_PATH cmake variable to $ENV{LD_LIBRARY_PATH} or similar. + There is a related ADDITIONAL_PXR_PLUGINPATH_NAME cmake var which can be used if schemas are installed in a non-standard location From 2f8137820cbfa24681da51b995609b6e5abfa54e Mon Sep 17 00:00:00 2001 From: eoinm Date: Sun, 17 May 2020 17:24:43 +1000 Subject: [PATCH 7/7] remove special handling of LD_LIBRARY_PATH for AL plugin --- cmake/test.cmake | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cmake/test.cmake b/cmake/test.cmake index 6e0c01402d..1cb47a6520 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -180,14 +180,6 @@ finally: "${CMAKE_INSTALL_PREFIX}/plugin/al/lib/usd") list(APPEND mayaUsd_varname_PXR_PLUGINPATH_NAME "${CMAKE_INSTALL_PREFIX}/plugin/al/plugin") - if (IS_LINUX AND CMAKE_SKIP_RPATH) - list(APPEND mayaUsd_varname_LD_LIBRARY_PATH - "$ENV{LD_LIBRARY_PATH}") - list(APPEND mayaUsd_varname_LD_LIBRARY_PATH - "${CMAKE_INSTALL_PREFIX}/lib") - list(APPEND mayaUsd_varname_LD_LIBRARY_PATH - "${CMAKE_INSTALL_PREFIX}/plugin/al/lib") - endif() # inherit PATH and PYTHONPATH from ENV to get USD entries # these should come last (esp PYTHONPATH, in case another module is overriding