rules_swift
rules_swift copied to clipboard
Remove space-in-path replacement
This replacement causes issues with importing indexstores.
In 965c37304cbc0263b6a5b0a945529c66a593c34c this replacement was added to work around issues with ar_wrapper. I don't see ar_wrapper used anywhere in Bazel, so I believe this is safe to remove.
Seems I'll need to find a way to escape some paths in tool invocations, and if not possible give up ☹️. Though it looks like it works in Bazel 6.0, so it might be something that we can only merge once we drop 5.x support.
This replacement causes issues with importing indexstores.
What issues does it cause?
Unit files have a hash based on the object file path. When we import unit files we need to make the object file path equal to what it would be if Xcode generates them. Xcode will generate these paths with spaces in their name, while rules_swift will replace the spaces.
So during an import we would have to undo this, but with index-import (which is just regex) we can't. Even if we could, theoretically there are some paths out there with __SPACE__ in their name.
And after saying all of that, I think I'll add something to index-import to address this for the time being.
https://github.com/MobileNativeFoundation/index-import/pull/65
We can merge this PR once we drop Bazel 5.x support.
Looks like there are new failures. I'll see if I'm able to address them.
So clang (at least on linux) requires quotes for spaces in the params file. Seeing if I can influence that, or if it will require a Bazel patch.
It looks like enabling the gcc_quoting_for_param_files feature should fix this, but I can't get it to change anything locally.
https://github.com/bazelbuild/bazel/pull/21699