-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarball with tar_scm service fetch from github ends up almost empty #228
Comments
I cannot reproduce the problem, even if I install e26b0ae. But I´m wondering about your settings - you have set the CACHEDIRECTORY, but maybe you might want to disable this. When running in osc, the local osc working copy will include the directory of the clone and also be used for caching. But I also have to admit, that this is no explaination for this problem and why I cannot reproduce it. Maybe you could disable the CACHEDIRECTORY in your setting and try if the problem still exists. /etc/obs/services/tar_scm |
I am running into this too and I have some more information. This is reproduceable if CACHEDIRECTORY is set to anything but the empty string in ~/.obs/tar_scm and if the env var OSC_VERSION is set to anything: http://paste.opensuse.org/5156bb0a When CACHEDIRECTORY is set, a bare clone is made: obs-service-tar_scm/TarSCM/scm/git.py Lines 85 to 86 in de861d8
When it prepares a working copy from the CACHEDIRECTORY, it uses --no-checkout, which causes the working copy to start empty: obs-service-tar_scm/TarSCM/scm/git.py Line 283 in de861d8
Then it is supposed to check out the given revision which would make it no longer empty, but if OSC_VERSION is set (which happens when invoked by osc) there is this funny behavior with git-stash on an un-checked-out tree, where restoring the stash causes the tree to be empty again even after the hard reset: obs-service-tar_scm/TarSCM/scm/git.py Lines 46 to 60 in de861d8
The result is that when this is invoked by |
@cmurphy Thanks for your detailed explaination. Now I see the problem, but as already said: I don't see any use case in using a CACHEDIRECTORY within "osc" as in the osc case the git repo gets already cached in the osc working copy, but I would like to hear your comments. I only see, that you have to remove the local checkout in the osc working manually before triggering the next service run - thats an real disadvantage for me. Maybe we should throw an exception (or at least print a warning) if you try to use a CACHEDIRECTORY while calling from 'osc'? |
In my case I am pretty sure I didn't set CACHEDIRECTORY myself, something else must have generated ~/.obs/tar_scm but I'm not sure what. An error message warning about it would be an improvement, though maybe frustrating if either tar_scm or osc or some other tool is creating it without the user's knowledge. |
Nor osc neither obs-service-tar_scm should have created a file in your home. IMHO it is common sense, that rpms do not create files in users home directories (for good reason). |
Thanks @cmurphy for the great analysis! |
I reproduced this by accident just now ... @M0ses commented on 13 Jun 2018, 10:03 BST:
Sure - the cache is supposed to be global (or at least per-user) not per working copy. This is in case you have multiple osc branches of the same package, because then it means you only need one clone into the global cache, rather than one per package.
If that's true (why would it be?) then IMHO it's a bug.
Definitely not - IIRC I originally designed the cache for client-side usage. Server-side efficiency was just a bonus :-) I did some archaeology and the |
Here is the debug I obtained by manually hacking a workaround to #240:
At this point, popping the stash which removed the whole tree failed with conflicts. |
…USE#228) Thanks to openSUSE#209 sometimes our working tree will be empty. In that case don't try to stash a bunch of changes which effectively delete the whole working tree and then re-pop them after switching version. Fixes openSUSE#228.
…USE#228) Thanks to openSUSE#209 sometimes our working tree will be empty. In that case don't try to stash a bunch of changes which effectively delete the whole working tree and then re-pop them after switching version. Fixes openSUSE#228.
…USE#228) Thanks to openSUSE#209 sometimes our working tree will be empty. In that case don't try to stash a bunch of changes which effectively delete the whole working tree and then re-pop them after switching version. Fixes openSUSE#228.
only do git stash save/pop if we have a non-empty working tree (#228)
[Migrated this issue from osc]
Hi,
today, I tried to update my FreeRDP build as always in a checked out copy:
I already removed the cached repo from /var/cache/obs/tar_scm, just in case, but the resulting tarball is almost empty (second tar.xz file):
The checked out FreeRDP dir just contains the .git folder:
My versions are:
Content of _service:
The branch names of the FreeRDP github project didn't change to my knowledge. A normal git clone succeeds as usual.
This happens with obs-service-tar_scm-0.8.0.1520581079.e26b0ae-198.1.noarch here.
Reverting to obs-service-tar_scm-0.8.0.1507129410.0cb2d44-198.1 fixes this behaviour here.
If you compare the git commands of Git.prepare_working_copy in both versions:
hence, due to --no-checkout, the result is that the checked out directory is mostly empty for the "with reference" case.
Question is, why does this work for you, guys, does it?
The text was updated successfully, but these errors were encountered: