> Does it make sense to try to set things up so sconscripts are called only > once? or is that wasted effort?
Scripts that build output or download external tools make since to only call once. Calling these scripts multiple times may cause the build to be repeated or multiple downloads. At a minimum the dependency checks are run over and over which just wastes time. Scripts that setup and environment sometimes get called multiple times. If you have a script that sets up CPPPATH, CXXFLAGS, LDFLAGS, ect. you could have multiple locations that the script is called. Still it's rare to call an environment setup script multiple times typically you call it once and pass it to other SCons scripts that clone and modify. I do think it's worth the effort but it's a change that will be hard to do and also convince others to accept the change. -----Original Message----- From: iotivity-dev-bounces at lists.iotivity.org [mailto:[email protected]] On Behalf Of Mats Wichmann Sent: Thursday, May 4, 2017 2:49 PM To: IoTivity Developer List <iotivity-dev at lists.iotivity.org> Subject: [dev] Scons questions #1, if you use the env.Function() form of something, it implies you're passing env, right? I'm wondering because I see this construct: connectivity_env.SConscript('#common/SConscript'), exports = 'connectivity_env') is the exports part in this invocation redundant? #2, it seems scripts call other scripts (especially ones in extlibs) to make sure some dependency is in place, and occasionally to fetch some related variables. But it seems to me you should only need to do this once... if such subsidiary SConscripts properly export any needed things that should appear in the global environment. Does it make sense to try to set things up so sconscripts are called only once? or is that wasted effort? I did a quick hack to have each sconscript set a global variable based on its path, and on entry check if it was already set (fortunately making this change was easily scriptable so it was quite quite to try out). (fwiw this is conceptually what the Windows case does in the gtest sconscript to avoid multiple builds) Here are the reports of "been here already": XXX BUILD_COMMON_EXTBUILD already visited XXX OUT_LINUX_X86_64_RELEASE_RESOURCE_CSDK_CONNECTIVITY_SRC_IP_ADAPTER already visited XXX OUT_LINUX_X86_64_RELEASE_RESOURCE_CSDK_CONNECTIVITY_SRC_BT_LE_ADAPTER already visited XXX RESOURCE_CSDK_CONNECTIVITY_SRC_BT_LE_ADAPTER_LINUX already visited XXX RESOURCE_3PLIBS already visited XXX BUILD_COMMON_THREAD already visited XXX RESOURCE_3PLIBS already visited XXX RESOURCE_3PLIBS already visited XXX RESOURCE_3PLIBS already visited XXX BUILD_COMMON_THREAD already visited XXX RESOURCE_3PLIBS already visited XXX RESOURCE_3PLIBS already visited XXX BUILD_COMMON_THREAD already visited XXX RESOURCE_3PLIBS already visited XXX BUILD_COMMON_THREAD already visited XXX RESOURCE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX EXTLIBS_HIPPOMOCKS already visited XXX OUT_LINUX_X86_64_RELEASE_RESOURCE_UNITTESTS already visited XXX RESOURCE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_HIPPOMOCKS already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_GTEST already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX SERVICE_3PLIBS already visited XXX EXTLIBS_GTEST already visited _______________________________________________ iotivity-dev mailing list iotivity-dev at lists.iotivity.org https://lists.iotivity.org/mailman/listinfo/iotivity-dev
