Bug 265325 - kdesrc-build aborts in calligra with local change
Summary: kdesrc-build aborts in calligra with local change
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: 1.12.1
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 19:20 UTC by David Faure
Modified: 2011-02-04 20:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Faure 2011-02-03 19:20:21 UTC
Version:           1.12.1 (using Devel) 
OS:                Linux

Initial setup:
$ git remote -v
origin  git://anongit.kde.org/calligra (fetch)
origin  ssh://git@git.kde.org/calligra (push)
$ git branch   
* master

kdesrc-buildrc contents:

     git-repository-base kde-git kde:

module-set
  use-modules calligra
  repository kde-git
end module-set

with .gitconfig mapping that prefix as recommended by the kde sysadmins (i.e. to anongit for reading).

Result: 
$ kdesrc-build --src-only calligra
Error updating calligra, removing from list of packages to build.
 > calligra doesn't appear to be a git module whentrying to see if there are changes.

and then the checkout remains in the branch __kdesvn-build-remote-master

See http://www.davidfaure.fr/2011/calligra.output.txt for the -debug run
I'm confused because git diff --quiet works here. Returns 1 (there is actually a local change).

$ git stash list
stash@{0}: WIP on master: 9ac3416 Applix import: fix assert when parsing lines that use a shared formula.
stash@{1}: WIP on master: 44dc689 DOC: Added initial support for the TOC field.
Hmm, maybe this is why?

I'm confused, are some git commands missing from the --debug output?


Reproducible: Always
Comment 1 Michael Pyne 2011-02-03 23:04:05 UTC
I think I broke it in this commit [1]. safe_system() shift-rights the status code of system to strip the high-order bit being checked for in the exception error message, so now the check is wrong since just calling system() did the right thing.

Perhaps I'll be able to fix it during class this evening which I'm about to leave for. :-/

[1] https://projects.kde.org/projects/extragear/utils/kdesrc-build/repository/revisions/2b0d0d62481880ffc1e1f0e4820f2944b78610d3
Comment 2 Michael Pyne 2011-02-04 00:02:45 UTC
Git commit 7c2ee0f7141405c0c739518ce3997003708efcf2 by Michael Pyne.
Committed on 03/02/11 at 23:56.
Pushed by mpyne into branch 'master'.

Fix detection of whether git-stash is needed.

I broke the code that determines whether git-stash is determined in
commit 2b0d0d62481880ffc1e1f0e4820f2944b78610d3. The problem is that
the system() Perl function returns the exit code and miscellaneous
process exit data (such as whether the process failed to run, etc.)
and I actually needed that data.

In the commit I refer to, I switched to my safe_system() which only
returns the exit code and now kdesrc-build thought there was an error
running git, when instead git was returning the proper exit code for
a module with local changes. Thanks to dfaure for the report.

Not closing the bug here in case I merge this somewhere else later.

CCBUG:265325

M  +3    -2    kdesrc-build     

http://commits.kde.org/kdesrc-build/7c2ee0f7141405c0c739518ce3997003708efcf2
Comment 3 Michael Pyne 2011-02-04 04:05:37 UTC
David mentioned on IRC that he still has the issue even after commit 7c2ee0f. I've double-checked here and both leaving unstaged changes (git add hasn't been run yet) and leaving staged-but-uncommitted changes (no git-commit) cause kdesrc-build to properly run git-stash.

Note, you only see the info message if using --src-only or --no-async. If performing a normal run you should still get log files for stash-apply and stash-pop in the log/latest/$module directory though.

Also the only commands that should not show up in --debug output are the raw Perl system() calls, and that is limited to the 2 git --diff variants, git show-ref in the git_has_branch subroutine, svn-status for the old Coverity support, and ssh-add for SSH agent checking.

Please reopen if you are able to get a more reliable way of reproducing so I can track down the rest. :)
Comment 4 David Faure 2011-02-04 20:33:03 UTC
Holy crap, I suck. Somehow kdesrc-build got installed into the kdesupport prefix, and all my "updating and reinstalling kdesrc-build" was updating the one in the kde prefix. I noticed this when starting to insert debug output into kdesrc-build :-)

You were right, your commit fixed this, I just didn't test it properly. My apologies.