Re: tool located in site_scons\site_tools\toolname causes ImportError
"Arndt Pauschardt" <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <trinity-7349be0c-8929-4301-a021-dd86b50ed071-1549270726272@3c-app-webde-bs51> |
Hi, Mats I believe that this "env.Tool()" mechanism is very helpful in organizing any build system _beyond_ the default stuff of compiler toolchains: All the "attached" tasks of lint'ing, styling, massaging, ... source code pre-/-post an actual compile is imho best done through the Tool mechanism. I know about the PreAction/PostAction() methods, but I ended up with using Tools() most of the time. Re doc: I used other tools as an example along with the existing doc on the generate() thing to get going. Yes, improving the doc is always a good thing. To me, the currently 'biggest' issue with Tool() is the exist() method. My understanding of exists() is it is called _prior_ to generate() when attaching a Tool to an env. If exists() return False, no generate(), but an error message. This does not seem work, at least not the last time I tried: Regardless of what exists() returns, the generate() was run. I did not thoroughly followed up on this, lack of time and priority. I probably should have done this, but for the time being I simply ignored this and moved the "does-the-tool-actually-exist" logic into generate(). Of course I may have misunderstood the intended usage of exists(), too. Cheers Arndt Gesendet: Freitag, 01. Februar 2019 um 17:38 Uhr Von: "Mats Wichmann" <[email protected]> An: "SCons users mailing list" <[email protected]>, "Bill Deegan" <[email protected]> Betreff: Re: [Scons-users] tool located in site_scons\site_tools\toolname causes ImportError Shamelessly stealing the thread because I was just starting to work on a tool as well... On 2/1/19 7:53 AM, Bill Deegan wrote: > Let me see if I can reproduce it here. > Also curious if it affects py3.5, py3.6 and non-windows platforms. >> astyle.py : >> import os >> from SCons.Script import * >> def generate(env, **kw): >> def exists(env): >> return 0 This tool stuff isn't particularly thoroughly documented. the user guide just says the two functions have to exist in a tool, but not really what they're expected to do; the manpage has slightly more in the Configuration File Reference section. Is there anywhere else to look, other than just poking in other tools to see what they do? I'm happy to write something up in a PR once I figure it out, if anyone else thinks there would be any value to adding more verbiage to the user guide. _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users