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

Replace "incorrect" types to make project generation work with xcodeproj #8

Merged
merged 2 commits into from
Mar 9, 2019

Conversation

fdiaz
Copy link
Collaborator

@fdiaz fdiaz commented Mar 8, 2019

Buck currently outputs an XML for project.pbxproj where runOnlyForDeploymentPostprocessing and dstSubfolderSpec are treated as integer.

			<key>runOnlyForDeploymentPostprocessing</key>
			<integer>1</integer>
			<key>dstSubfolderSpec</key>
			<integer>16</integer>

When trying to open the .xcodeproj file with xcodeproj we're getting:

[Xcodeproj] Type checking error: got Fixnum for attribute: Attribute dstSubfolderSpec (type: simple, classes: [String], owner class: PBXCopyFilesBuildPhase)

This seems to be a bug in xcodeproj itself.

To work around this, I'm forcing these 2 keys to have Strings as values instead of Int. After doing this, xcodeproj can succesfully open our project.

cc @dfed @bachand @shepting

@fdiaz fdiaz merged commit c74a6f0 into buck-tiger-team Mar 9, 2019
@fdiaz fdiaz deleted the fd/fix-types-projectgen branch March 9, 2019 02:03
@dfed
Copy link
Collaborator

dfed commented Apr 1, 2019

@fdiaz any reason not to contribute this back to facebook/buck?

@donholly
Copy link

donholly commented May 7, 2019

@fdiaz did you end up submitting this to facebook/buck? Running into this issue myself now and I think it'd be a pain to move over to airbnb/buck for us as all of our scripts expect to install buck from Homebrew :(

donholly added a commit to Clubroom/buck that referenced this pull request May 8, 2019
@fdiaz
Copy link
Collaborator Author

fdiaz commented May 10, 2019

I've been just lazy but I need to do this! I'll do this tomorrow. Thanks for the reminder @donholly !

@donholly
Copy link

@fdiaz 🙏 awesome news - thank you!

We ended up having to fork Buck as well and pulled this change into ours. We also came across a similar issue for ProxyType - have you run into this one?

Clubroom@8fa5ae5

@fdiaz
Copy link
Collaborator Author

fdiaz commented May 10, 2019

@donholly we started moving away from xcodeproj so we haven't run into this anymore. It's highly likely this happens in different places though since Buck and xcodeproj seem to be working under different assumptions for the XML output.

@fdiaz
Copy link
Collaborator Author

fdiaz commented May 10, 2019

Upstream PR facebook#2257

facebook-github-bot pushed a commit to facebook/buck that referenced this pull request Jan 14, 2020
Summary:
Buck currently outputs an XML for `project.pbxproj` where `runOnlyForDeploymentPostprocessing` and `dstSubfolderSpec` are treated as `integer`.

```
			<key>runOnlyForDeploymentPostprocessing</key>
			<integer>1</integer>
			<key>dstSubfolderSpec</key>
			<integer>16</integer>
```

When trying to open the `.xcodeproj` file with [xcodeproj](https://github.com/CocoaPods/Xcodeproj) we're getting:

> [Xcodeproj] Type checking error: got `Fixnum` for attribute: Attribute `dstSubfolderSpec` (type: `simple`, classes: `[String]`, owner class: `PBXCopyFilesBuildPhase`)

This [seems to be a bug](CocoaPods/Xcodeproj#475) in xcodeproj itself.

To work around this, I'm forcing these 2 keys to have Strings as values instead of Int. After doing this, `xcodeproj` can succesfully open our project.

This was all already done in our [fork of buck here](airbnb#8)

 ---

I'm also including here donholly commit in their fork that adds the same workaround for the same issue in PBXContainerItemProxy Clubroom@8fa5ae5
Pull Request resolved: #2257

Test Plan: Imported from GitHub, without a Test Plan: line.

Reviewed By: williamtwilson, v-jizhang

Pulled By: v-jizhang

shipit-source-id: 90ec5e0dab4922d70b5b01013a548384aa0d0f3b
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.

3 participants