Bazel's File().path method will return forward-slashed paths; this means if you pass a flag like "/FI" + f.path it'll end up looking like /FIpath/to/thing; however, _convert_flags was converting all / to -, which ended up breaking the path. This makes sure to only replace the first/.
Bazel's
File().path
method will return forward-slashed paths; this means if you pass a flag like"/FI" + f.path
it'll end up looking like/FIpath/to/thing
; however,_convert_flags
was converting all/
to-
, which ended up breaking the path. This makes sure to only replace the first/
.