Hi, I'm using rpkg 2.6 on Fedora 29. I have git version 2.20.1, which does support check-ignore. Upon running rpkg local I get the following error:
rpkg local
git_dir_pack: Your git version does not support check-ignore git_dir_pack failed with value 1
When using the following source line from the getting started template:
Source: {{{ git_dir_pack }}}
I can run rpkg local fine for rpkg itself, so seems like a misleading error message?
Yes, you are right. It's a misleading error message. Basically it means that git check-ignore --stdin gave something to stderr. When that happens, we assume that the check-ignore command is not there but of course, it might be something else. For example, if path examined for ignoring is outside of a git repository. But that's probably not the case here for you.
git check-ignore --stdin
check-ignore
I am right now struggling to realize what might be the cause. Where is the getting started template located, please? I will try to reproduce the problem locally.
Sure. Try cloning https://github.com/googleapis/google-cloud-cpp. I copied hello_rpkg.spec.rpkg over. I also tried renaming it to google-cloud-cpp.spec.rpkg. If I copy google-cloud-cpp.spec.rpkg back to hello_rpkg, it builds fine. So maybe there is something specific about that repository causing issues.
hello_rpkg.spec.rpkg
google-cloud-cpp.spec.rpkg
hello_rpkg
I tried it with git 2.20 and rpkg 2.6 but i didn't hit the problem.
I have this directory layout:
drwxr-xr-x. 10 root root 4096 Mar 17 18:00 . drwxr-xr-x. 1 root root 4096 Mar 17 17:57 .. drwxr-xr-x. 2 root root 4096 Mar 17 17:57 bazel -rw-r--r--. 1 root root 700 Mar 17 17:57 BUILD drwxr-xr-x. 7 root root 4096 Mar 17 17:57 ci -rw-r--r--. 1 root root 542 Mar 17 17:57 .clang-format -rw-r--r--. 1 root root 1651 Mar 17 17:57 .clang-tidy drwxr-xr-x. 3 root root 4096 Mar 17 17:57 cmake -rw-r--r--. 1 root root 1276 Mar 17 17:57 .cmake-format.py -rw-r--r--. 1 root root 6612 Mar 17 17:57 CMakeLists.txt -rw-r--r--. 1 root root 956 Mar 17 17:57 .codecov.yml -rw-r--r--. 1 root root 1961 Mar 17 17:57 CODE_OF_CONDUCT.md -rw-r--r--. 1 root root 12164 Mar 17 17:57 CONTRIBUTING.md drwxr-xr-x. 4 root root 4096 Mar 17 17:57 doc -rw-r--r--. 1 root root 455 Mar 17 17:57 .dockerignore -rw-r--r--. 1 root root 214 Mar 17 17:57 .editorconfig drwxr-xr-x. 8 root root 4096 Mar 17 18:00 .git drwxr-xr-x. 2 root root 4096 Mar 17 17:57 .github -rw-r--r--. 1 root root 367 Mar 17 17:57 .gitignore -rw-r--r--. 1 root root 108 Mar 17 17:57 .gitmodules drwxr-xr-x. 3 root root 4096 Mar 17 17:57 google -rw-r--r--. 1 root root 1930 Mar 17 17:57 hello_rpkg.spec.rpkg -rw-r--r--. 1 root root 23398 Mar 17 17:57 INSTALL.md -rw-r--r--. 1 root root 11357 Mar 17 17:57 LICENSE -rw-r--r--. 1 root root 17239 Mar 17 17:57 README.md drwxr-xr-x. 3 root root 4096 Mar 17 17:57 third_party -rw-r--r--. 1 root root 2412 Mar 17 17:57 .travis.yml -rw-r--r--. 1 root root 915 Mar 17 17:57 WORKSPACE
hello_rpkg.spec.rpkg i copied from https://pagure.io/hello_rpkg/tree/master and rpkg local invoked in that directory passes the srpm build phase (including git_dir_pack invocation) and fails with
git_dir_pack
/var/tmp/rpm-tmp.vlvjPg: line 31: make: command not found
in a f29 container.
Can you run the following command in the same dir as you ran rpkg local.
find /tmp/google-cloud-cpp | git check-ignore --stdin
Please, replace /tmp/google-cloud-cpp with the actual path to your local git repo you are testing.
/tmp/google-cloud-cpp
If I run find /tmp/google-cloud-cpp | git check-ignore --stdin from outside /tmp/google-cloud-cpp I get "not a git repository". If I run it inside /tmp/google-cloud-cpp I do get a listing of all the files. It ends with fatal: Pathspec '/tmp/google-cloud-cpp/third_party/googleapis/gapic' is in submodule 'third_party/googleapis'.
fatal: Pathspec '/tmp/google-cloud-cpp/third_party/googleapis/gapic' is in submodule 'third_party/googleapis'
OK, so that IS the issue. I forgot to mention when you clone the repository, please run git submodule update --init --recursive. It looks like rpkg doesn't like submodules?
git submodule update --init --recursive
Right, this is fixed in the trunk.
The question is, in your case, would you like the submodules to be packed or omitted? I've just found git_pack in the latest version of rpkg packs them but git_archive in that same version macro does not. I would like those to macros to behave the same way by default in this respect.
git_pack
git_archive
Currently, I would prefer omitting them as that seems easier to do but not sure if it is what you need.
As for the original problem though, would you like me to backport a patch into Fedora or would you be alright with using an experimental version of rpkg (v3) that I am currently working on?
If the latter, you can get the latest rpkg from here https://copr.fedorainfracloud.org/coprs/clime/rpkg-util-dev/
Hi, I'm fine with whatever you find easiest. I originally reported this issue when trying to get rpkg working, but we are planning on removing submodules from google-cloud-cpp altogether.
Thank you for taking a look and fixing the issue, btw.
Support for submodules is now implemented in in https://pagure.io/rpkg-util/c/b63e2820b587066a6c43003ce1893263c4c02c8e?branch=master
Let me know if I can do anything more.
Metadata Update from @clime: - Issue status updated to: Closed (was: Open)
@clime I'm working on an rpm that uses submodules and hitting this error. Are these changes available in a version of rpkg somewhere that I can install on F30?
@clime I managed to get it working by vendoring the dependency instead of using a git submodule for now.
Hey, fine. The submodule changes are not available anywhere right now, sadly. I am finishing up rpkg v3 so it's gonna be probly in f31 and available from a copr.
the bug is still is still present on 34, but it's fixed in the copr repo, any idea why it hasn't been updated yet ? or where i should go to ask about it
Hello, the version 3 with the fix is going to be present in f35 (finally).
aaa bless, thank you !
This issue has been migrated to GitHub: https://github.com/fedora-copr/rpkg-util/issues/17 Don't forget to subscribe for notifications about new comments.