firebase / firebase/firebase-ios-sdk

Build failure on macOS (case-insensitive FS): nanopb BUILD file conflicts with Xcode build/ directory

Open
#16,156 3 comments 0 reactions 0 assignees View on GitHub
Swift Package Manager
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

## Description

The Firebase iOS SDK depends on `firebase/nanopb` which contains a file named `BUILD` (a Bazel build file) at the repository root. On macOS with the default case-insensitive APFS filesystem, this conflicts with Xcode's build system which needs to create a `build/` directory inside the package checkout for intermediate build products.

## Error

```
error: File exists but is not a directory: .../checkouts/nanopb/build
error: File exists but is not a directory: .../checkouts/nanopb/build/EagerLinkingTBDs
error: File exists but is not a directory: .../checkouts/nanopb/build/ExplicitPrecompiledModules
```

## Root Cause

- `firebase/nanopb` (the archived fork) has a file named `BUILD` at the root
- macOS APFS (case-insensitive, the default) treats `BUILD` and `build` as the same entry
- Xcode's build system tries to create `build/` directory → fails because `BUILD` file exists
- The upstream `nanopb/nanopb` already fixed this by using `BUILD.bazel` instead

## Suggested Fix

Update the nanopb dependency in `Package.swift` to point to the upstream `nanopb/nanopb` (which uses `BUILD.bazel`), or unarchive `firebase/nanopb` and rename `BUILD` → `BUILD.bazel`.

## Environment

- macOS 15.x (Sequoia), APFS case-insensitive (default)
- Xcode 16.x / 26.x
- Firebase iOS SDK 11.x via Swift Package Manager
- Affects both `xcodebuild` CLI and Xcode IDE builds

## Reproduction

1. Create a new iOS project
2. Add `firebase-ios-sdk` via SPM (any product, e.g., FirebaseAnalytics)
3. Build with Xcode on macOS with default APFS filesystem
4. Observe the build failure

## Workaround

After package resolution, rename the conflicting file:
```bash
find DerivedData/*/SourcePackages/checkouts -name "BUILD" -not -type d -exec mv {} {}.bazel \;
```

This must be re-applied after every clean build or package update.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.