+1 to " In general I am happy to use linux style '/' paths for all paths unless an issue is discovered and in those cases use os.path.join."
That's the guidance I was giving before becoming platform support maintainer and others told me that was a problem even though I never saw one. Not sure if the problems never existed or were specific to msys or what. Do others agree with this or are others aware of issues? If folks agree, I'd be happy to update point 1 of the guidance along the lines of how George put it. Dave -----Original Message----- From: Nash, George [mailto:[email protected]] Sent: Thursday, May 4, 2017 10:14 AM To: Mats Wichmann <mats at wichmann.us>; Dave Thaler <dthaler at microsoft.com>; IoTivity Developer List <iotivity-dev at lists.iotivity.org> Subject: RE: [dev] sconscript consistency (#1 or potentially several) I have been using scons for years and I have seen very few instances that using '/' for path has caused issues. Also you can get the root file for a path anytime using env.Dir("#"). This returns a scons node if you need the string a string you can Call str(env.Dir('#')). In general I am happy to use linux style '/' paths for all paths unless an issue is discovered and in those cases use os.path.join. Every time I have seen an issue using '/' in scons was in a builder for a 3rd party tool. I just fixed the builder. George -----Original Message----- From: iotivity-dev-bounces at lists.iotivity.org [mailto:[email protected]] On Behalf Of Mats Wichmann Sent: Wednesday, May 3, 2017 5:31 PM To: Dave Thaler <dthaler at microsoft.com>; IoTivity Developer List <iotivity-dev at lists.iotivity.org> Subject: Re: [dev] sconscript consistency (#1 or potentially several) On 05/03/2017 06:27 PM, Dave Thaler wrote: > The platform support wiki > page<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.iotivity.org%2Fplatform_support&data=02%7C01%7Cdthaler%40microsoft.com%7C8be88406a333499087c008d49310e850%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636295148410778555&sdata=A7elvU9t0GJxKrYjysa%2BIPP5ArjHWbs1zK2pCDMgKtw%3D&reserved=0> > has this: > > > Use of os.path.join in SConscript files The path separator differs > across platforms ('/' vs '\'). There has been some confusion about when to > use os.path.join in SConscript files. In short: > 1. Use os.path.join when constructing paths passed as arguments to a > compiler, such as when constructing CPPPATH or LIBS > 2. Don't use os.path.join when constructing paths interpreted by Python > itself, such as via an env.SConscript() call > > > > Point 2 is what you're asking about, so no objection that's already the > guidance. > > Separately point 1 might need elaboration since the "#..." syntax of a file > relative to the SConstruct file seems to be processed by scons, so the part > about "when constructing CPPPATH" may not be correct, maybe scons > pre-processes it before passing it to the compiler, in which case > os.path.join isn't needed there either. > > If someone can explain how "#..." works for CPPPATH, I'm happy to update > point 1 above. > > > > But for your question about point 2, please go ahead. > this one was only for the SConscript calls, not for other paths. _______________________________________________ iotivity-dev mailing list iotivity-dev at lists.iotivity.org https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.iotivity.org%2Fmailman%2Flistinfo%2Fiotivity-dev&data=02%7C01%7Cdthaler%40microsoft.com%7C8be88406a333499087c008d49310e850%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636295148410788563&sdata=DPGferop4XO35H4gVFoV9wNGOs3FmJuG8SEK9oPHG%2F4%3D&reserved=0
