yonaskolb / yonaskolb/XcodeGen

member of multiple groups indicates a malformed project or loss of `compilerFlags`

Open
#782 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

We are looking to move away from pods. As part of the process, we care converting the pods to yml so we can generate Xcode project files. This is a precautionary step in case we ever want to be able to debug a pod.

I'm working on FBSDKCoreKit, which has one file which doesn't use ARC. However, I am having a difficult time getting it to work right.

It's either my syntax/ordering or perhaps a bug.

If I use this to define the sources

    sources:
      - path: ../Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal_NoARC/FBSDKDynamicFrameworkLoader.m
        compilerFlags: "-fno-objc-arc"
      - path: ../Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit
        includes: "**/*.[hm]"
        excludes: Internal_NoARC/FBSDKDynamicFrameworkLoader.m

I receive a warning like the following. The build will work, however.

2020-02-13 14:03:55.266 xcodebuild[4804:1782108] warning: The file reference for "../Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal_NoARC" is a member of multiple groups ("FBSDKCoreKit" and ""); this indicates a malformed project. Only the membership in one of the groups will be preserved (but membership in targets will be unaffected). If you want a reference to the same file in more than one group, please add another reference to the same path.

Note that I've gotten rid of the excludes and the same error message will result.

I tried to re-order, but ordering does seem to matter, since if I re-order like the following

    sources:
      - path: ../Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit
        includes: "**/*.[hm]"
        excludes: Internal_NoARC/FBSDKDynamicFrameworkLoader.m
      - path: ../Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal_NoARC/FBSDKDynamicFrameworkLoader.m
        compilerFlags: "-fno-objc-arc"

-fno-objc-arc will not be set.

Screen Shot 2020-02-13 at 2 09 14 PM

Is my syntax incorrect? Or is this a case where xcodegen cannot properly handle it? Or do I just accept the warning and ignore it?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the project generation with the two YAML sources variants and inspect the resulting Xcode project warning about duplicate group membership. Compare the generated project behavior with and without excludes; done means the malformed-project warning is resolved and -fno-objc-arc remains applied to FBSDKDynamicFrameworkLoader.m.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift, yaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.