Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo
@ 2020-03-26 17:38 Piraty
  2020-04-09  4:03 ` sgn
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Piraty @ 2020-03-26 17:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

New issue by Piraty on void-packages repository

https://github.com/void-linux/void-packages/issues/20393

Description:
### Expected behavior
xbps-src doesn't care if run from the main repo or a worktree
### Actual behavior
xbps-src complains about not being run from a git repository a lot during builds.
```
fatal: not a git repository: <...>
```

I'm not 100% sure it leads to fatal build errors, but I remember to see build failures happen in worktrees which didn't occur when building in the main repo (I have yet to find a case to prove this); this might have been related to incorrect SOURCE_DATE_EPOCH derivation or similar...

### Steps to reproduce the behavior
```
cd void-packages

branch=random-branch
main_repo="$(pwd)"

git branch $branch ; git worktree add /tmp/VOID-$branch $branch
cd /tmp/VOID-$branch $branch

# bootstrap using main hostdir (to not fetch binary-bootstrap again)
XBPS_HOSTDIR="$main_repo/hostdir" ./xbps-src binary-bootstrap
./xbps-src pkg which
```

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: xbps-src: does not recognize a git-worktree as a git-repo
  2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
@ 2020-04-09  4:03 ` sgn
  2020-04-09  8:12 ` Piraty
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-04-09  4:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/20393#issuecomment-611315658

Comment:
Worktree create by `git-worktree(1)` will use a file named `.git`, contains:

    gitdir: $XBPS_DISTDIR/.git/worktrees/<worktree-name>

In chroot, we couldn't navigate to that path, hence the errors.

We could fix this by mounting outer `$XBPS_DISTDIR` to inner

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: xbps-src: does not recognize a git-worktree as a git-repo
  2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
  2020-04-09  4:03 ` sgn
@ 2020-04-09  8:12 ` Piraty
  2020-04-09  8:21 ` sgn
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Piraty @ 2020-04-09  8:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

New comment by Piraty on void-packages repository

https://github.com/void-linux/void-packages/issues/20393#issuecomment-611395264

Comment:
is the chroot really required to know if there's a git directory? @xtraeme ?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: xbps-src: does not recognize a git-worktree as a git-repo
  2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
  2020-04-09  4:03 ` sgn
  2020-04-09  8:12 ` Piraty
@ 2020-04-09  8:21 ` sgn
  2020-08-19 16:29 ` sgn
  2020-08-19 16:29 ` [ISSUE] [CLOSED] " sgn
  4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-04-09  8:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 859 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/20393#issuecomment-611399337

Comment:
On 2020-04-09 01:13:10-0700, Piraty <notifications@github.com> wrote:
> is the chroot really required to know if there's a git directory? @xtraeme ?

There're 2 information xbps-src needs to get from git:

- `SOURCE_DATE_EPOCH` (`common/environment/setup/git.sh`),
  this can be work-around by calculate it from outside,
  then export into chroot
- `gitrev` metadata for the package
  (`common/hooks/post-install/05-generate-gitrevs.sh`),
  this will be run in `pkg` step,
  we can work-around by calculate it from outside of chroot, export
  into chroot.

After done all this steps, we no longer need git inside chroot,
thus, `chroot-git` packages is no longer required, and, can be removed
from base-chroot.

-- 
Danh


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: xbps-src: does not recognize a git-worktree as a git-repo
  2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
                   ` (2 preceding siblings ...)
  2020-04-09  8:21 ` sgn
@ 2020-08-19 16:29 ` sgn
  2020-08-19 16:29 ` [ISSUE] [CLOSED] " sgn
  4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-08-19 16:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/issues/20393#issuecomment-676529738

Comment:
Partial fixed. The repo in git-worktree doesn't install into sub-repo, though.
I tend to think it's a feature, though.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ISSUE] [CLOSED] xbps-src: does not recognize a git-worktree as a git-repo
  2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
                   ` (3 preceding siblings ...)
  2020-08-19 16:29 ` sgn
@ 2020-08-19 16:29 ` sgn
  4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-08-19 16:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Closed issue by Piraty on void-packages repository

https://github.com/void-linux/void-packages/issues/20393

Description:
### Expected behavior
xbps-src doesn't care if run from the main repo or a worktree
### Actual behavior
xbps-src complains about not being run from a git repository a lot during builds.
```
fatal: not a git repository: <...>
```

I'm not 100% sure it leads to fatal build errors, but I remember to see build failures happen in worktrees which didn't occur when building in the main repo (I have yet to find a case to prove this); this might have been related to incorrect SOURCE_DATE_EPOCH derivation or similar...

### Steps to reproduce the behavior
```
cd void-packages

branch=random-branch
main_repo="$(pwd)"

git branch $branch ; git worktree add /tmp/VOID-$branch $branch
cd /tmp/VOID-$branch $branch

# bootstrap using main hostdir (to not fetch binary-bootstrap again)
XBPS_HOSTDIR="$main_repo/hostdir" ./xbps-src binary-bootstrap
./xbps-src pkg which
```

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-19 16:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26 17:38 [ISSUE] xbps-src: does not recognize a git-worktree as a git-repo Piraty
2020-04-09  4:03 ` sgn
2020-04-09  8:12 ` Piraty
2020-04-09  8:21 ` sgn
2020-08-19 16:29 ` sgn
2020-08-19 16:29 ` [ISSUE] [CLOSED] " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).