简体   繁体   中英

WAF: recursive find_program()

I am very new to WAF . I have configuration function like:


def configure(ctx):
    ########################################################################
    # **/myexe does not work too; also abs path in path_list does not work!
    
    ctx.find_program('myexe', var='MYEXE', path_list=['mydir/here'])

and it does not find myexe binary. Only if I pass 'mydir/here/this_dir'! It seems that find_program() is not recursive. How to do it in recursive way? Maybe another method?

find_program is not recursive, meaning that it doesn't look for subdirectories of the ones you provide. It's for efficiency and security reasons. That the same when your OS look for binaries, it looks in a path list (usually through the PATH environment variable) but not recursively in subdirectories. A hacker can put a modified command in a subdirectory that will be used instead of the real one. That why the current directory is never in PATH:)

As waf is python, and if you absolutely want to get that behavior, you can implement it:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM