Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't require xcodegen settings preset files. All configuration shoul… #84

Merged
merged 1 commit into from
Oct 17, 2018

Conversation

rahul-malik
Copy link
Collaborator

…d be

specified by xchammer.[yaml|yml] files

@rahul-malik rahul-malik force-pushed the rmalik-remove-presets branch 2 times, most recently from 6f76738 to 88b10b6 Compare October 16, 2018 22:20
struct XCBuildSettings: Encodable {
var copts: [String] = []
var productName: First<String>?
var productName: First<String>? = First("$(TARGET_NAME)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if we allocate this, it sets it to target name as the default? If we want to always set it to TARGET_NAME we should just remove the variable if it isn't necessary

@@ -454,10 +454,13 @@ public class XcodeTarget: Hashable, Equatable {
return xcTargetName + ".xctest"
case .AppExtension, .XPCService, .Watch1App, .Watch2App, .Watch1Extension, .Watch2Extension, .TVAppExtension:
return xcTargetName + ".appex"
case .StaticLibrary:
case .StaticLibrary, .Tool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope but it's correct

default:
fatalError()
print("ERR: Product type \(productType)")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

return xcTargetName
case .Bundle:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this one? I thought bundles weren't built

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually hit this case

settings.productName <>= self.bundleName.map { First($0) }

if settings.productName == nil {
settings.productName = First(self.extractBuiltProductName())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this code path ever be hit? It doesn't seem like it if you set the value in the initializer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will now that there isn't a default value

@@ -163,6 +166,11 @@ struct XCBuildSettings: Encodable {
var useHeaderMap: First<String>? = First("NO")
var testTargetName: First<String>?
var pythonPath: First<String>?
var sdkRoot: First<String>?
var targetedDeviceFamily: OrderedArray<String> = OrderedArray.empty

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: remove spaces?

@@ -163,6 +166,11 @@ struct XCBuildSettings: Encodable {
var useHeaderMap: First<String>? = First("NO")
var testTargetName: First<String>?
var pythonPath: First<String>?
var sdkRoot: First<String>?
var targetedDeviceFamily: OrderedArray<String> = OrderedArray.empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's an OrderedArray?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ordered array is poorly named, it's basically an implementation of ordered set that conform to a few protocols used to serialize build settings. We wanted uniqueness with consistent ordering which is why this was originally written, happy to revisit

@kastiglione
Copy link
Contributor

Didn't mean to accept, just meant to leave a comment.

@kastiglione
Copy link
Contributor

What's the deal with all the scheme changes and developer machine specific path changes?

@rahul-malik rahul-malik force-pushed the rmalik-remove-presets branch 2 times, most recently from 82e57f0 to cf35e3e Compare October 17, 2018 22:00
…d be

specified by xchammer.[yaml|yml] files

- Update sample project
- Make Product name fallback the target name
- Add target device families and sdk root for ios, watchos, tvos, macos
@rahul-malik
Copy link
Collaborator Author

@kastiglione - Filed tickets to address the scheme changes and dev machine paths

@rahul-malik rahul-malik deleted the rmalik-remove-presets branch October 17, 2018 23:14
@jerrymarino
Copy link
Collaborator

@rahul-malik - there is a ton of errors on the CI and locally from XcodeGen

XCHammer: ** Completed read_aspects in 20.9972s
XCHammer: ** Completed query_genfiles in 2.2947s
XCHammer: Generating project UrlGet
XCHammer: ** Completed compute_deps_hash in 0.3823s
XCHammer: Converting to XcodeGen specification
Unknown product type: genrule. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent
Unknown product type: entitlements. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent
Unknown product type: entitlements. Unable to extract xcode equivalent
Unknown product type: objc_bundle. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent
Unknown product type: _ios_test_bundle. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent
Unknown product type: filegroup. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: entitlements. Unable to extract xcode equivalent
Unknown product type: _ios_test_bundle. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent
Unknown product type: swift_runtime_linkopts. Unable to extract xcode equivalent
Unknown product type: apple_binary. Unable to extract xcode equivalent

@rahul-malik
Copy link
Collaborator Author

I added that print statement, it’s not an error

@jerrymarino
Copy link
Collaborator

Ah ok - can you submit a followup to remove? People might be confused because we support all of the things that are emitted as unknown product type. The function extractProductType() is only for Bazel notions that map to Xcode Targets, which many don't.

jerrymarino added a commit that referenced this pull request Oct 23, 2018
should be (#84)"

This reverts commit ed81cc2.

This commit caused build errors in Pinterest that weren't tested in the
OSS CI. This PR is simply documentation of the issue.

The outcome of addresssing this PR is to understand _why_ it happened,
and finding the best solution to address it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants