rules_swift icon indicating copy to clipboard operation
rules_swift copied to clipboard

Remove space-in-path replacement

Open brentleyjones opened this issue 3 years ago • 9 comments

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.

brentleyjones avatar Sep 06 '22 16:09 brentleyjones

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.

brentleyjones avatar Sep 06 '22 16:09 brentleyjones

This replacement causes issues with importing indexstores.

What issues does it cause?

thii avatar Sep 07 '22 01:09 thii

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.

brentleyjones avatar Sep 07 '22 02:09 brentleyjones

And after saying all of that, I think I'll add something to index-import to address this for the time being.

brentleyjones avatar Sep 07 '22 02:09 brentleyjones

https://github.com/MobileNativeFoundation/index-import/pull/65

We can merge this PR once we drop Bazel 5.x support.

brentleyjones avatar Sep 07 '22 19:09 brentleyjones

Looks like there are new failures. I'll see if I'm able to address them.

brentleyjones avatar Mar 13 '24 22:03 brentleyjones

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.

brentleyjones avatar Mar 14 '24 14:03 brentleyjones

It looks like enabling the gcc_quoting_for_param_files feature should fix this, but I can't get it to change anything locally.

brentleyjones avatar Mar 14 '24 15:03 brentleyjones

https://github.com/bazelbuild/bazel/pull/21699

brentleyjones avatar Mar 14 '24 16:03 brentleyjones