You are not logged in.

#1 2022-08-03 16:26:36

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 64

[Solved] fatal: not a git repository (or any parent up to mount point

Today I created my first ever Arch package and it worked the first time around! What I mean is that the package building succeeded and it got the correct files installed, and all is fine. There was however a (harmless) error message.

My package is very simple. Below is an even simpler outline of what it does. It is not the real package, the $$$$$ are not in the real package.

build(){
  cd "$srcdir"/$$$$$$$
  ./configure 
  make 
}

package(){
  cd "$srcdir"/$$$$$$$
  make $$$$$$$$$$ install
}

Below is the the error message I got.
The line "Creating config.mak and config.h" is the last line of the ./configure step.
The line "make -C $$$$$$$$ all" is the first line of the make step (in build()).
The two middle lines are the error message for which I am looking for an explanation.

Creating config.mak and config.h
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
make -C $$$$$$$$ all

My guess for the cause of the error message is that makepkg somehow looks for a .git folder off the folder where PKGBUILD is and it does not find any there, nor in the folders further up in the tree all the way to /. This package being new and personal it is not in AUR or any git repo.

Is that the correct explanation? I looked at the man page for makepkg and I could not see anything about it checking for git repos.

Last edited by archdub (2022-08-03 19:31:30)

Offline

#2 2022-08-03 16:31:41

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [Solved] fatal: not a git repository (or any parent up to mount point

Please post the complete, unedited PKGBUILD you are trying to build.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-08-03 16:54:28

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 64

Re: [Solved] fatal: not a git repository (or any parent up to mount point

As I said before, the package building succeeded (with "makepkg -si"), but I got a harmless error message that I am trying to figure out.

Below is the full PKGBUILD.

# QEmacs - most recent upstream version is at Github

pkgname=qemacs-mine-github
pkgdesc="QEmacs (Quick Emacs) is a very small editor with Emacs look and feel, syntax highlighting, and dired mode with preview window."

# I want a version string that increases monotonically regardless, so it starts
# with the date of the commit (as time only increases) followed by an underscore
# and the version string stored in the VERSION file in the source code.
pkgver=20220321_5.3alpha
pkgrel=1

arch=('x86_64')
url="https://github.com/qemacs/qemacs"
license=('LGPL2.1')
depends=('libpng' 'libxv')
optdepends=('jp2a: for converting JPG images to ASCII')
makedepends=('texi2html')
provides=('qemacs')
conflicts=('qemacs' 'qemacs-cvs')

_COMMIT="1418387ce8becf419aaad84fc0cc54d1f0dae436"
source=("https://github.com/qemacs/qemacs/archive/$_COMMIT.zip")
sha512sums=('1697d3dc4a87d4e91bd6e431d651238725cbfe160639ca668e1bfaa3340cadb4311994ddfe5187bb02996125cb44b8f6aa0cecdf9d026907e48f3ffb6cfde0e4')

build(){
  cd "$srcdir"/qemacs-$_COMMIT
  # TODO: check what parameters should be given to ./configure
  ./configure --prefix=/usr --enable-x11 --enable-xv --enable-xshm --enable-xrender
  # TODO: do we need -j1?
  make -j1
}

package(){
  cd "$srcdir"/qemacs-$_COMMIT
  make DESTDIR=$pkgdir prefix="/usr/" datadir="/usr/share" mandir="/usr/share/man" install
  install -Dm644 config.eg $pkgdir/usr/share/qe/config.eg
  install -Dm644 qe-doc.html $pkgdir/usr/share/qe/qe-doc.html
  install -Dm644 README.md $pkgdir/usr/share/qe/README.md
  install -Dm644 TODO.md $pkgdir/usr/share/qe/TODO.md
}

Offline

#4 2022-08-03 18:14:56

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,391

Re: [Solved] fatal: not a git repository (or any parent up to mount point

line 555 and 566 of the Makefile try to run git, but there is no git repo available. You can do a git init before the configure call.

Last edited by Stefan Husmann (2022-08-03 18:15:28)

Offline

#5 2022-08-03 19:28:36

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 64

Re: [Solved] fatal: not a git repository (or any parent up to mount point

Stefan Husmann wrote:

line 555 and 566 of the Makefile try to run git, but there is no git repo available. You can do a git init before the configure call.

Thanks, you found it. Because this is my first PKGBUILD I suspected I had made a mistake, it turns out it is an issue with the Makefile. There is a target there called 'force' which causes git to be called. I have no idea whats is the purpose, I will ask upstream. I will mark this issue as solved.

Offline

#6 2022-08-04 12:59:24

archdub
Member
From: Dublin, Ireland
Registered: 2018-03-04
Posts: 64

Re: [Solved] fatal: not a git repository (or any parent up to mount point

Upstream was quick, and has released a new version with a fix for the git issue. My new PKGBUILD is below (I changed the package name).

# QEmacs - new version at Github

pkgname=qemacs-new
pkgdesc="QEmacs (Quick Emacs) is a very small editor with Emacs look and feel, syntax highlighting, UTF-8, dired mode with preview window, and many other features."

# I want a version string that increases monotonically regardless, so it starts
# with the date of the commit (as time only increases) followed by an underscore
# and the version string stored in the VERSION file in the source code.
pkgver=20220804_5.3.1
pkgrel=1

arch=('x86_64')
url="https://github.com/qemacs/qemacs"
license=('LGPL2.1')
depends=('libpng' 'libxv')
optdepends=('jp2a: for converting JPG images to ASCII')
makedepends=('texi2html')
provides=('qemacs')
conflicts=('qemacs' 'qemacs-cvs')

_COMMIT="fedd90496c6e0567cb58c236a1d763c47e8baf96"
source=("https://github.com/qemacs/qemacs/archive/$_COMMIT.zip")
sha512sums=('6b11360d00850e3e57fae3f2774847e8fe54a3741f366922c04720061519e9aac195bbffbd81125d9e4724c41e9d817a69eed1ba66740dec5d57ab12aeed7942')

build(){
  cd "$srcdir"/qemacs-$_COMMIT
  # TODO: check what parameters should be given to ./configure
  ./configure --prefix=/usr --enable-x11 --enable-xv --enable-xshm --enable-xrender
  # TODO: do we need -j1?
  make -j1
}

package(){
  cd "$srcdir"/qemacs-$_COMMIT
  make DESTDIR=$pkgdir prefix="/usr/" datadir="/usr/share" mandir="/usr/share/man" install
  install -Dm644 config.eg $pkgdir/usr/share/qe/config.eg
  install -Dm644 qe-doc.html $pkgdir/usr/share/qe/qe-doc.html
  install -Dm644 README.md $pkgdir/usr/share/qe/README.md
}

Offline

Board footer

Powered by FluxBB