margelo / margelo/react-native-nitro-sqlite

Prefix native C++ filenames to prevent dependency collisions

Open
#332 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
565
Forks
53
Avg merge
1d 21h
Merged PRs (30d)
18

Description

Several of NitroSQLite's project-owned C++ files use generic basenames such as utils.hpp, macros.hpp, types.hpp, logs.hpp, and operations.cpp. These names can collide with files from other native dependencies in the same React Native build; this was observed when NitroSQLite and op-sqlite were installed together.

Oscar Franco reported the collision in #312, including clashes around utils, macros, and ThreadPool. C++ namespaces do not protect filenames or build artifacts, so project-owned native files should use a stable NitroSQLite-specific prefix.

Proposed change

  • Identify non-generated, non-vendored .cpp and .hpp files exposed to consumer builds.
  • Prefix generic filenames with NitroSQLite or RNNitroSQLite.
  • Update includes, include guards, CocoaPods source declarations, and Android build references.
  • Keep generated Nitrogen and vendored SQLite files unchanged unless investigation shows that they are also collision-prone and can be renamed safely.
  • Confirm where the reported ThreadPool collision originates because the current NitroSQLite tree does not contain a project-owned file with that name.

Acceptance criteria

  • An application can build NitroSQLite alongside a dependency containing generic C++ filenames such as utils.hpp and macros.hpp.
  • The iOS and Android example builds pass after the rename.
  • Published project-owned headers no longer use generic, unprefixed filenames.

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

Inspect the non-generated, non-vendored .cpp and .hpp files, including utils.hpp, macros.hpp, types.hpp, logs.hpp, and operations.cpp, then trace their includes, include guards, CocoaPods declarations, and Android build references. Confirm the source of the reported ThreadPool collision. Done means project-owned published headers are prefixed and the iOS and Android example builds pass alongside a dependency with generic filenames.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, react-native, sqlite
Domain
build-system, mobile-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.