I am working on running a wrapper around the gcc compiler,
Is there a way to use the wrapper for the https://github.com/f0rmiga/gcc-toolchain/tree/main where a default is present.
_PRIVATE_ATTRS = { "_wrapper_sh_template": attr.label( default = Label("//toolchain:wrapper.sh.tpl"), ), }I need to use a my wrapper with their exec command. I am creating a wrapper with the defs.bzl, my wrapper consists of a python script and the installation for the another executable.
:::::::::::::: defs.bzl :::::::::::::: def _wrapper_impl(repository_ctx): :::::::::::::: commands to install the tool in a <installation_dir> :::::::::::::: ins_dir = repository_ctx.path(<installation_dir>) py_path = repository_ctx.path(<python_script>) repository_ctx.template( "wrapper_sh", Label("//foo:wrapper_sh.tpl"), {"__ins_dir__":str(ins_dir), "__py_path__":str(py_path)}, executable=True, ) return None gcc_toolchain = repository_rule( _wrapper_impl, ) :::::::::::::: wrapper_sh.tpl :::::::::::::: <the args for the tool and the functions for the tool> exec __py_path__ __ins_dir__ <args to python> /usr/bin/gccI am calling this toolchain with a spearate platform
Since I am cutamising my template, I am facing difficulty to replace this functionality in the hermetic toolchain
I want to implement this wrapper when a particular config or a any parameter is called like --config=use_wrapper
Please help on this.
I tried to overwrite the template, but failed since the my other paths to be embedded on the template. Also I want to apply this functionality only when called, so it's always failing.
I have raised same at https://stackoverflow.com/questions/79001274/how-to-overwrite-the-default-toolchain-values