# Paraview Superbuild fails because of git

**URL:** https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741
**Category:** ParaView Support
**Created:** [January 19, 2024, 5:53pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741 "2024-01-19T17:53:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MaxMRichter](https://discourse.paraview.org/user_avatar/discourse.paraview.org/maxmrichter/32/12962_2.png) [@MaxMRichter](https://discourse.paraview.org/u/MaxMRichter)
#### Post date: [January 19, 2024, 5:53pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741/1 "2024-01-19T17:53:47Z")

</div>

Hey! I am trying to build paraview with the superbuild on Arch Linux. I have enabled all available packages but some of them fail because of the following error

```auto
FAILED: superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix /home/max/paraview/build/superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix
cd /home/max/paraview/build/superbuild/zlib/src && /usr/bin/git --git-dir= apply --whitespace=fix -p1 /home/max/paraview/paraview-superbuild/superbuild/projects/patches/zlib-pcfile-rel-prefix.patch && /usr/bin/cmake -E touch /home/max/paraview/build/superbuild/zlib/stamp/zlib-zlib-patch-pcfile-rel-prefix
warning: unable to access '/config': Is a directory
warning: unable to access '/config': Is a directory
fatal: unknown error occurred while reading the configuration files

```

but this is just one example of many packages which fail to compile, or even download, because of a similar error.  
I have already pinpointed that it might be a wrong git config but deleting all .gitconfig files and my .git config directory from my system and reinstalling git does not solve the problem.  
If i use the same steps on my laptop it is working by the way.

Did anybody ever had this kind of issue or knows some help?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [January 19, 2024, 8:29pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741/2 "2024-01-19T20:29:39Z")

</div>

Do you have some kind of `git` wrapper or hook globally installed? Where is the `warning` coming from?r

---

<div class="post-metadata">

### Author: ![MaxMRichter](https://discourse.paraview.org/user_avatar/discourse.paraview.org/maxmrichter/32/12962_2.png) [@MaxMRichter](https://discourse.paraview.org/u/MaxMRichter)
#### Post date: [January 20, 2024, 8:07pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741/3 "2024-01-20T20:07:21Z")

</div>

What do you mean by git wrapper? I have installed VS code with the git extension, could that be interfering? I don’t have any hooks since i have deleted the `~/.git` folder.

The warning is coming from the compiler downloading packages and i think also from applying patches. This particular error seems to stem from such a patch. I use basically the standard way of compiling, i.e.

```auto
git clone --recursive https://gitlab.kitware.com/paraview/paraview-superbuild.git
mkdir build
cd build
ccmake ../paraview-superbuild -GNinja # Making configurations
ninja

```

And some of the packages (e.g. `zlib, bzip, ffi` etc) are not compiling because of a similar error as in the original post.

---

<div class="post-metadata">

### Author: ![MaxMRichter](https://discourse.paraview.org/user_avatar/discourse.paraview.org/maxmrichter/32/12962_2.png) [@MaxMRichter](https://discourse.paraview.org/u/MaxMRichter)
#### Post date: [January 20, 2024, 8:48pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741/4 "2024-01-20T20:48:58Z")

</div>

Okay wow i found the issue (more or less)  
The problem arises from the `--git-dir=` command from the patch application `git apply`. I found a very brain dead workaround by, after configuration with cmake and ninja, just deleting the `--git-dir=` from all the patches in the `build.ninja` file.  
I still don’t know whats wrong with my git configuration but this solves the issue. What is this command useful anyways? Would it be maybe better to throw it away all together?

Anyways thanks for trying to help me!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [February 7, 2024, 1:50pm UTC](https://discourse.paraview.org/t/paraview-superbuild-fails-because-of-git/13741/5 "2024-02-07T13:50:29Z")

</div>

> [@MaxMRichter](#):
>
> What is this command useful anyways? Would it be maybe better to throw it away all together?

So `git apply` first looks for a git repository to apply the given patch to. However, we’re _never_ doing that, so instead we say “(_Jedi hand wave_) there’s no Git repository here, act like `patch`” so that we can avoid having to figure out how to otherwise apply a diff on a barebones Windows installation. It seems like something is very unhappy in your configuration with an empty path passed here as it doesn’t check “does `git-dir` exist?” before trying to look for a configuration file for it. Finding out what, exactly, is looking for a repository config file here would be good. `strace -o strace.log -f -e file git --git-dir apply --allow-empty /dev/null` may help.
