Restore the sdbus-cpp submodule when consumed as a git dependency - #10
Merged
Conversation
`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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depending on this package by git URL fails to build:
dart pub getdoes not fetch git submodules, sonative/third_party/sdbus-cpparrives empty. CMake configure fails withnothing to add_subdirectory, leaving no
build.ninja, and the failure surfacesone 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.gititthrows with an explanation rather than letting CMake fail obscurely.
pub.dev archives were never affected.
dart pub publishbundles thesubmodule 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.