GNOME Bugzilla – Bug 789596
gstreamer build fails if .git isn't in the expected place
Last modified: 2018-11-03 16:13:06 UTC
Because of: https://cgit.freedesktop.org/gstreamer/gstreamer/tree/autogen.sh#n37 If the .git directory is not at the top of the repository then this will fail. There are multiple reasons why this might be the case: the repository might be a submodule of some other, or the working dir may have been checked out to a different place. This also affects the meson build system, see: https://cgit.freedesktop.org/gstreamer/gstreamer/tree/meson.build#n454 And it also affects all gstreamer plugin repositories which use the common submodule. The actual location of the .git directory can be found with: git rev-parse --git-dir
--absolute-git-dir would be better as it predictably gives you an absolute path, but it needs a newer version of git.
Please feel free to propose a patch. Does the failure just affect the commit hooks?
Created attachment 367095 [details] [review] autogen.sh.in: fix pre-commit hook install if autogen lives in a subdir (for common submodule) Could you check if this works right for you in autogen.sh (The patch won't be useful to you since it only modifies the template file for autogen.sh): # Install GNU indent-based pre-commit hook for doing clean commits that # maintain the GStreamer coding style. # # Don't assume this autogen.sh or the common module is at the top-level # of the git checkout, it might be a unified git repo with the gstreamer # code living in a subdirectory within the git repository. if git --version 2>/dev/null >/dev/null; then gitdir=`git rev-parse --git-dir` curprefix=`git rev-parse --show-prefix` # will have trailing slash if test ! \( -x "$gitdir/hooks/pre-commit" -a -L "$gitdir/hooks/pre-commit" \); then rm -f "$gitdir/hooks/pre-commit" if ! ln -s "../../$curprefix""common/hooks/pre-commit.hook" "$gitdir/hooks/pre-commit" 2> /dev/null then echo "Failed to create commit hook symlink, copying instead ..." cp "../../$curprefix""common/hooks/pre-commit.hook" "$gitdir/hooks/pre-commit" fi fi fi
Yes, works for me. The error is gone and gstreamer builds correctly. I didn't test with the plugin repos.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/12.