Skip to content

Restore the sdbus-cpp submodule when consumed as a git dependency - #10

Merged
jwinarske merged 1 commit into
mainfrom
fix/git-dependency-submodule
Jul 23, 2026
Merged

Restore the sdbus-cpp submodule when consumed as a git dependency#10
jwinarske merged 1 commit into
mainfrom
fix/git-dependency-submodule

Conversation

@jwinarske

Copy link
Copy Markdown
Owner

Depending on this package by git URL fails to build:

ninja: error: loading 'build.ninja': No such file or directory
Command: cmake --build .../hooks_runner/shared/bluez_native/build/.../cmake/ --parallel

dart pub get does not fetch git submodules, so
native/third_party/sdbus-cpp arrives empty. CMake configure fails with
nothing to add_subdirectory, leaving no build.ninja, and the failure surfaces
one step later at cmake --build — pointing nowhere near the cause.

The hook now initializes the submodule when it is missing and the checkout
still has a .git, which pub's git cache retains. When there is no .git it
throws with an explanation rather than letting CMake fail obscurely.

pub.dev archives were never affected. dart pub publish bundles the
submodule contents as ordinary files; the dry-run archive contains the
sdbus-cpp sources. This is specific to git dependencies.

Found while adding this package as a dependency of another project, which is
the only way the path gets exercised.

`dart pub get` does not fetch git submodules, so a package depending on
this one by git URL received an empty native/third_party/sdbus-cpp. CMake
then had nothing to configure and the build failed at `cmake --build`
with a missing build.ninja, which points nowhere near the cause.

The build hook now initializes the submodule when it is missing and the
checkout still has a .git, and fails with an explanation when it does
not. pub.dev archives were never affected: publishing bundles the
submodule contents as ordinary files.

Signed-off-by: Joel Winarske <[email protected]>
@jwinarske
jwinarske merged commit 3c5a189 into main Jul 23, 2026
6 checks passed
@jwinarske
jwinarske deleted the fix/git-dependency-submodule branch July 23, 2026 02:13
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.

1 participant