Skip to content

Package setup often creates compiler errors #952

@squarefrog

Description

@squarefrog

SDK version: 3.13.1

Environment: Development and Production

Describe the bug
We often encounter an issue when switching branches, we're no longer able to build our project unless we do a full clean and rebuild. This is due to our conformance of CustomerIO to a shared protocol to allow mocking. We're only able to import the public packages, and CustomerIO is declared in CioInternalCommon which is not publicly exposed, or re-exported.

While cleaning and rebuilding doesn't sound like an issue, this takes a long time and drastically reduces our developers productivity.

To Reproduce

The file that generally emits this error is in it's own package, and simply contains the following.

// implicitly imports CioInternalCommon
import CioDataPipelines

protocol PushServiceProtocol {
    static func initialize(withConfig config: SDKConfigBuilderResult)
    func identify(userId: String, traits: [String: Any]?)
}

extension CustomerIO: PushServiceProtocol {}

Other source files within this package import all of the following. Each of these has a dependence on CioInternalCommon.

import CioDataPipelines
import CioMessagingInApp
import CioMessagingPushAPN

Expected behavior
We should be able to switch branches without a 3rd party dependency breaking our build pipeline.

Screenshots

Image

Additional context
This has been an issue for us since the CioInternalCommon changes were merged into 2.10.2.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions