After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789596 - gstreamer build fails if .git isn't in the expected place
gstreamer build fails if .git isn't in the expected place
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: dont know
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-28 16:28 UTC by Alistair Buxton
Modified: 2018-11-03 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
autogen.sh.in: fix pre-commit hook install if autogen lives in a subdir (for common submodule) (2.15 KB, patch)
2018-01-19 17:58 UTC, Tim-Philipp Müller
none Details | Review

Description Alistair Buxton 2017-10-28 16:28:46 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
Comment 1 Alistair Buxton 2017-10-28 17:07:47 UTC
--absolute-git-dir would be better as it predictably gives you an absolute path, but it needs a newer version of git.
Comment 2 Tim-Philipp Müller 2017-11-04 10:30:06 UTC
Please feel free to propose a patch.

Does the failure just affect the commit hooks?
Comment 3 Tim-Philipp Müller 2018-01-19 17:58:54 UTC
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
Comment 4 Alistair Buxton 2018-01-20 23:17:52 UTC
Yes, works for me. The error is gone and gstreamer builds correctly. I didn't test with the plugin repos.
Comment 5 GStreamer system administrator 2018-11-03 16:13:06 UTC
-- 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.