File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -678,9 +678,27 @@ def _create_linkstamp(linkstamp, headers):
678678 _cc_internal .check_private_api (allowlist = _PRIVATE_STARLARKIFICATION_ALLOWLIST )
679679 return create_linkstamp (linkstamp , headers )
680680
681+ _PATH_ESCAPE_REPLACEMENTS = {
682+ "_" : "_U" ,
683+ "/" : "_S" ,
684+ "\\ " : "_B" ,
685+ ":" : "_C" ,
686+ "@" : "_A" ,
687+ }
688+
681689def _escape_label (* , label ):
682690 _cc_internal .check_private_api (allowlist = _PRIVATE_STARLARKIFICATION_ALLOWLIST )
683- return _cc_internal .escape_label (label = label )
691+ path = label .package + ":" + label .name
692+ if label .repo_name :
693+ path = label .repo_name + "@" + path
694+ result = []
695+ for idx in range (len (path )):
696+ c = path [idx ]
697+ result .append (_PATH_ESCAPE_REPLACEMENTS .get (
698+ c ,
699+ c , # no escaping by default
700+ ))
701+ return "" .join (result )
684702
685703def _cc_toolchain_features (* , toolchain_config_info , tools_directory ):
686704 _cc_internal .check_private_api (allowlist = _PRIVATE_STARLARKIFICATION_ALLOWLIST )
You can’t perform that action at this time.
0 commit comments