You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two cases where I need to make a tweaked toolchain - clang-analyze, and afl. In both cases, these programs work by replacing clang (or gcc) with their own wrapper program, which runs the regular compiler, and then add their own magic on top of that.
When using tundra, is there some official mechanism for defining your own toolchain (similar to clang.lua, or gcc.lua), which is part of your source code tree, and not part of the stock tundra distribution?
The best thing I've come up with so far is this (example here is for afl):
Create a file in my project: build/tundra/tools/afl.lua
Add a new Config that uses the afl toolchain.
Run tundra like so, to compile my project called "Test": TUNDRA_LUA_PATH=`pwd`/build/?.lua tundra2 linux-afl-release Test
It would be useful if one didn't need to setup the TUNDRA_LUA_PATH environment variable. Does it make sense that one could add some kind of lua call, which would add a new directory to the lua search path? You could then call that function at the top of your tundra.lua file, to add in your project-specific lua scripts.
I know this may seem a bit pedantic - I mean what's wrong with just setting TUNDRA_LUA_PATH for this niche case? However, I think it would be a good principle if one could easily add extra augmentations on top of tundra, in the form of lua scripts that are private to the source tree.
You can add tool paths using the ScriptDir property. This way they’re loaded just like built in tools and there’s no need for env hacks. Let me know if this doesn’t work for you.
I have two cases where I need to make a tweaked toolchain -
clang-analyze
, andafl
. In both cases, these programs work by replacing clang (or gcc) with their own wrapper program, which runs the regular compiler, and then add their own magic on top of that.When using tundra, is there some official mechanism for defining your own toolchain (similar to
clang.lua
, orgcc.lua
), which is part of your source code tree, and not part of the stock tundra distribution?The best thing I've come up with so far is this (example here is for
afl
):build/tundra/tools/afl.lua
afl
toolchain.TUNDRA_LUA_PATH=`pwd`/build/?.lua tundra2 linux-afl-release Test
It would be useful if one didn't need to setup the TUNDRA_LUA_PATH environment variable. Does it make sense that one could add some kind of lua call, which would add a new directory to the lua search path? You could then call that function at the top of your
tundra.lua
file, to add in your project-specific lua scripts.I know this may seem a bit pedantic - I mean what's wrong with just setting TUNDRA_LUA_PATH for this niche case? However, I think it would be a good principle if one could easily add extra augmentations on top of tundra, in the form of lua scripts that are private to the source tree.
afl.lua
contents:The text was updated successfully, but these errors were encountered: