bazel-xcode / bazel-xcode/PodToBUILD

"empty segment not permitted" when a podspec defines its source_files with trailing slash

Open
#104 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
330
Forks
68
PR merge metrics
No merged PRs in 30d

Description

As the title says, when you have a podspec that defines its source files with a trailing slash, you get the error `empty segment not permitted`. For example, trying to build the `Moya` (I realise this is a Swift library, but bear with me) yields:
```
ERROR: /path/to/project/ios/Vendor/Moya/BUILD:165:10: Traceback (most recent call last):
File "/path/to/project/ios/Vendor/Moya/BUILD", line 162
objc_library(name = "Core_cxx", enable_modules ..., <8 more arguments>)
File "/path/to/projectios/Vendor/Moya/BUILD", line 165, in objc_library
glob(["Sources/Moya//**/*.cc", "Sourc..."], <2 more arguments>)
empty segment not permitted
```

You'll notice that the glob's path is `Sources/Moya//**/*.cc` which yields the error. The Moya podspec defines its source files as:

```
s.subspec "Core" do |ss|
ss.source_files = "Sources/Moya/", "Sources/Moya/Plugins/"
ss.dependency "Alamofire", "5.0.0-rc.2"
ss.framework = "Foundation"
end
```

I've tested this with a simple spec for an obj-c project and the same error occurs when the trailing slash is added to the `source_files`. The error disappears if the podspec is updated to remove the trailing slash.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.