Bug 40990 - gear: сборка из git worktree
Summary: gear: сборка из git worktree
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: gear (show other bugs)
Version: unstable
Hardware: all Linux
: P5 normal
Assignee: Dmitry V. Levin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-23 01:05 MSK by Alexey Sheplyakov
Modified: 2022-01-14 19:22 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Sheplyakov 2021-09-23 01:05:57 MSK
При попытке запустить сборку из git worktree:

$ gear-hsh -v

выводится сообщение о якобы отсутствующем tag:

$ gear-hsh -v
mkdir: created directory '/tmp/.private/asheplyakov/gear.2QhBFuXH/out'
gear: .gear/rules line 1: Name "xorg-server-20210922" not found in tag list
gear: .gear/rules line 1: Failed to make archive

Хотя на самом деле он есть:

$ cat .gear/tags/list
735dbde48294f9d0a8c3d791c44df14da9b91fc0 xorg-server-20210922

$ git show 735dbde48294f9d0a8c3d791c44df14da9b91fc0 | sed -re '/^diff --git/,$ { d }'

commit 735dbde48294f9d0a8c3d791c44df14da9b91fc0
Author: Michel Dänzer <mdaenzer@redhat.com>
Date:   Fri Sep 17 11:55:52 2021 +0200

    xwayland/present: Move xwl_present_reset_timer call out of xwl_present_flip

    xwl_present_reset_timer checks if the pending flip is synchronous, so
    we need to call it after adding the pending flip to the flip queue.

    Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1219
    Fixes: b2a06e0700fa "xwayland/present: Drop sync_flip member of struct xwl_present_window"
    Tested-by: Olivier Fourdan <ofourdan@redhat.com>
    Acked-by: Olivier Fourdan <ofourdan@redhat.com>
Comment 1 Dmitry V. Levin 2021-09-23 01:13:10 MSK
Пожалуйста, запушьте куда-нибудь этот репозиторий, и дайте на него ссылку.
Comment 2 Alexey Sheplyakov 2021-09-23 02:37:58 MSK
#285718 EPERM #2 sisyphus gear.git=2.5.1-alt1
Comment 3 Dmitry V. Levin 2021-09-23 02:41:04 MSK
Попробуйте лучше http://git.altlinux.org/people/vseleznv/packages/?p=gear.git;a=commitdiff;h=worktree
Comment 4 Alexey Sheplyakov 2021-09-23 02:54:09 MSK
(In reply to Dmitry V. Levin from comment #1)
> Пожалуйста, запушьте куда-нибудь этот репозиторий, и дайте на него ссылку.

git clone -b p9 git://git.altlinux.org/gears/x/xorg-server.git
cd xorg-server
git worktree add --track -b sisyphus ../xorg-server-sisyphus origin/sisyphus
cd ../xorg-server-sisyphus
gear-hsh -v
Comment 5 Alexey Sheplyakov 2021-09-23 03:05:49 MSK
(In reply to Dmitry V. Levin from comment #3)
> Попробуйте лучше
> http://git.altlinux.org/people/vseleznv/packages/?p=gear.git;a=commitdiff;
> h=worktree

Сомневаюсь, что лучше.

Сходу видно, что при таком способе используется index от основной working copy:

http://git.altlinux.org/people/vseleznv/packages/?p=gear.git;a=blob;f=gear;h=05f1f1a0c6fbffe6d069532877b54a520447163c;hb=worktree#l847

echo $(git rev-parse --git-common-dir)/index
/home/asheplyakov/tmp/xorg-server/.git/index

А следовало бы использовать index текущего worktree:

echo $(git rev-parse --git-dir)/index
/home/asheplyakov/tmp/xorg-server/.git/worktrees/xorg-server-sisyphus/index
Comment 6 Alexey Sheplyakov 2021-09-23 03:21:10 MSK
(In reply to Alexey Sheplyakov from comment #5)
> (In reply to Dmitry V. Levin from comment #3)
> > Попробуйте лучше
> > http://git.altlinux.org/people/vseleznv/packages/?p=gear.git;a=commitdiff;
> > h=worktree
> 
> Сомневаюсь, что лучше.
> 
> Сходу видно, что при таком способе используется index от основной working
> copy:

То есть мне-то без разницы, я не использую --commit, но вот тем, кто использует -- будет сюрприз.
Comment 7 Dmitry V. Levin 2021-09-23 03:41:37 MSK
У меня не было возможности тольком посмотреть, но, может быть, тогда лучше использовать git rev-parse --git-path objects в create_temporary_git_object_directory()?
Comment 8 Alexey Sheplyakov 2021-09-24 19:40:40 MSK
(In reply to Dmitry V. Levin from comment #7)
> У меня не было возможности тольком посмотреть, но, может быть, тогда лучше
> использовать git rev-parse --git-path objects в
> create_temporary_git_object_directory()?

Переделал, но не особо проще. В worktree выдаёт абсолютный путь:

$ pwd
/home/asheplyakov/work/xorg-sisyphus
$ git rev-parse --git-path objects
/home/asheplyakov/work/xorg-server/.git/objects

А в обычном репозитории (или основном worktree) - относительный:

$ pwd
/home/asheplyakov/work/xorg-server
$ git rev-parse  --git-path objects

.git/objects

Так что не особо проще
Comment 9 Alexey Sheplyakov 2021-10-04 14:50:02 MSK
Уважаемый сопровождающий пакета gear! Сделайте, будьте добры, что-нибудь с этим багом.

Если Вам не нравится исправление из задания 285718 - пожалуйста, объясните, что там не так, или предложите своё.

#285718 EPERM #6 sisyphus gear.git=2.5.1-alt1
Comment 10 Dmitry V. Levin 2022-01-14 13:27:09 MSK
Прошу прощения за задержку.

На мой взгляд, git rev-parse --git-path objects всё-таки проще:
https://git.altlinux.org/people/ldv/packages/?p=gear.git;a=commit;h=2.5.0-alt1-5-gcbe4d61
Comment 11 Repository Robot 2022-01-14 19:22:51 MSK
gear-2.5.1-alt1 -> sisyphus:

 Fri Jan 14 2022 Dmitry V. Levin <ldv@altlinux> 2.5.1-alt1
 - gear-rules.5: added references to git glob syntax (closes: #39804).
 - gear-store-tags: fixed the warning about specsubst directive (closes: #39898).
 - gear-edit-spec: do not invoke an editor when no spec file was found (closes: #40023).
 - gear: added git worktree support (closes: #40990).