[Nix-dev] Git + gettextWithExpat incompatibility

Mikhail volhovm.cs at gmail.com
Tue Feb 16 19:23:12 CET 2016


Hi!

I've discovered an interesting bug. Here's how it's possible to
reproduce it:

1. Install both `gettextWithExpat` and `git` package using nix-env or
declaration in `configuration.nix`. I've tried different git versions,
all them work this way. Not sure about `gettextWithExpat` versions, but
I'm using 0.19.6 with `nixos-unstable` channel on my system.
2. cd into any git repository directory
3. Run `git rebase` or `git stash` with any arguments (except options,
`--help` works well). Git will do nothing and return code 0.

Here's an illustration of how it works:
```
[volhovm at avishai:~/code]$ mkdir testGit
[volhovm at avishai:~/code]$ cd testGit/
[volhovm at avishai:~/code/testGit]$ git init
Initialized empty Git repository in /home/volhovm/code/testGit/.git/
[volhovm at avishai:~/code/testGit]$ nix-env -q
gettext-expat-gettext-0.19.6
git-minimal-2.7.0
#other stuff
[volhovm at avishai:~/code/testGit]$ git rebase asoehuasnotuehsoathueao
[volhovm at avishai:~/code/testGit]$ echo $?
0
[volhovm at avishai:~/code/testGit]$ git stash asoehuasnoteu
[volhovm at avishai:~/code/testGit]$ echo $?
0
[volhovm at avishai:~/code/testGit]$ nix-env -e gettext-expat-gettext
uninstalling ‘gettext-expat-gettext-0.19.6’
[volhovm at avishai:~/code/testGit]$ git rebase aoeuaoeuaoe
fatal: Needed a single revision
invalid upstream aoeuaoeuaoe
[volhovm at avishai:~/code/testGit]$ echo $?
1
[volhovm at avishai:~/code/testGit]$ git stash aoeuaoeuaeo
usage: git stash list [<options>]
   or: git stash show [<stash>]
   or: git stash drop [-q|--quiet] [<stash>]
   or: git stash ( pop | apply ) [--index] [-q|--quiet] [<stash>]
   or: git stash branch <branchname> [<stash>]
   or: git stash [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
		       [-u|--include-untracked] [-a|--all] [<message>]]
   or: git stash clear
[volhovm at avishai:~/code/testGit]$ echo $?
1
```

I used strace to discover what's going on and it appeared that `git
rebase aoeuaoeuaoeu` with and without `gettextWithExpat` installed gives
almost identical output (differs in addresses only), except for the last
~6 lines, which are:

With `gettextExpat` installed:
```
read(4, "", 1)                          = 0
close(4)                                = 0
wait4(13438, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 13438
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13438,
si_uid=1000, si_status=0, si_utime=0, si_stime=0} ---
exit_group(0)                           = ?
+++ exited with 0 +++
```

Without:
```
read(4, "", 1)                          = 0
close(4)                                = 0
wait4(13271, fatal: Needed a single revision
invalid upstream aoeuaoeu
[{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 13271
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13271,
si_uid=1000, si_status=1, si_utime=0, si_stime=0} ---
exit_group(1)                           = ?
+++ exited with 1 +++
```

I wonder if this issue is related to nixOS or git. What are your
thoughts about it?

-- 
Volkhov Mikhail
M3#38 IFMO study group 17'
Computer Technologies Department


More information about the nix-dev mailing list