GNU bug report logs -
#66704
[PATCH 0/1] patman depends on Git
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66704 in the body.
You can then email your comments to 66704 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
:
bug#66704
; Package
guix-patches
.
(Mon, 23 Oct 2023 16:09:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Simon Tournier <zimon.toutoune <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
maxim.cournoyer <at> gmail.com, guix-patches <at> gnu.org
.
(Mon, 23 Oct 2023 16:09:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
Assume, I am running in some Git repository, e.g.,
$ git config --get branch.tmp.remote
origin
Then, I get this error:
--8<---------------cut here---------------start------------->8---
$ guix shell -C patman -- patman -h
Traceback (most recent call last):
File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 95, in run_pipe
last_pipe = cros_subprocess.Popen(cmd, cwd=cwd, **kwargs)
File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/cros_subprocess.py", line 83, in __init__
super(Popen, self).__init__(args, stdin=stdin,
File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/bin/.patman-real", line 47, in <module>
parser.add_argument('-p', '--project', default=project.detect_project(),
File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/project.py", line 19, in detect_project
top_level = gitutil.get_top_level()
File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/gitutil.py", line 627, in get_top_level
return command.output_one_line('git', 'rev-parse', '--show-toplevel')
File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 128, in output_one_line
result = run_pipe([cmd], capture=True, oneline=True,
File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 99, in run_pipe
raise Exception("Error running '%s': %s" % (user_pipestr, str))
Exception: Error running 'git rev-parse --show-toplevel': <class 'str'>
--8<---------------cut here---------------end--------------->8---
That’s because ’patman’ runs ’git’ via the file gitutils.py, see:
--8<---------------cut here---------------start------------->8---
-*- mode:grep; default-directory: "/tmp/u-boot-2023.07.02/tools/patman/" -*-
20 candidates:
./gitutil.py:29: cmd = ['git']
./gitutil.py:87: pipe = ['git', 'name-rev', commit_hash]
./gitutil.py:139: remote = command.output_one_line('git', '--git-dir', git_dir, 'config',
./gitutil.py:141: merge = command.output_one_line('git', '--git-dir', git_dir, 'config',
./gitutil.py:231: pipe = ['git']
./gitutil.py:252: pipe = ['git', 'clone', git_dir, '.']
./gitutil.py:265: pipe = ['git']
./gitutil.py:285: pipe = ['git', '--git-dir', git_dir, 'worktree', 'list']
./gitutil.py:300: pipe = ['git', '--git-dir', git_dir, 'worktree', 'add', '.', '--detach']
./gitutil.py:315: pipe = ['git', '--git-dir', git_dir, 'worktree', 'prune']
./gitutil.py:337: cmd = ['git', 'format-patch', '-M']
./gitutil.py:414: 'git', 'config', 'sendemail.suppresscc', raise_on_error=False)
./gitutil.py:496: git_config_to = command.output('git', 'config', 'sendemail.to',
./gitutil.py:511: cmd = ['git', 'send-email', '--annotate']
./gitutil.py:627: return command.output_one_line('git', 'rev-parse', '--show-toplevel')
./gitutil.py:636: fname = command.output_one_line('git', 'config', 'sendemail.aliasesfile',
./gitutil.py:654: uname = command.output_one_line('git', 'config', '--global', 'user.name')
./gitutil.py:664: uemail = command.output_one_line('git', 'config', '--global', 'user.email')
./gitutil.py:675: 'git', 'config', 'format.subjectprefix', raise_on_error=False)
./gitutil.py:699: return command.output_one_line('git', 'show', '-s', '--pretty=format:%H')
--8<---------------cut here---------------end--------------->8---
I propose to wrap ’patman’ with ’git’, see patch.
WDYT?
Cheers,
simon
Simon Tournier (1):
gnu: patman: Wrap program with git.
gnu/packages/bootloaders.scm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
base-commit: a25a492f2b8604de4ebc21298f24891a1a245161
--
2.38.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#66704
; Package
guix-patches
.
(Mon, 23 Oct 2023 16:27:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 66704 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/bootloaders.scm (patman): Replace by 'package/inherit'.
[arguments]: Add 'wrap-program' that uses git-minimal dependency.
[inputs]: Add git-minimal.
Change-Id: Id4ebadd518f271baa087161b10455ec03d6f959b
---
gnu/packages/bootloaders.scm | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index fb20ba0efa..cdc26a0c9e 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -18,6 +18,7 @@
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo <at> cyberdimension.org>
;;; Copyright © 2021 Stefan <stefan-guix <at> vodafonemail.de>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -65,6 +66,7 @@ (define-module (gnu packages bootloaders)
#:use-module (gnu packages serialization)
#:use-module (gnu packages swig)
#:use-module (gnu packages valgrind)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages virtualization)
#:use-module (gnu packages xorg)
#:use-module (gnu packages python-web)
@@ -864,8 +866,7 @@ (define-public python-u-boot-pylib
;;; This is packaged separately, as it can be used in other contexts than for
;;; U-Boot development.
(define-public patman
- (package
- (inherit u-boot)
+ (package/inherit u-boot
(name "patman")
(build-system pyproject-build-system)
(arguments
@@ -890,8 +891,17 @@ (define-public patman
(lambda _
(substitute* "pyproject.toml"
(("patman.__main__:run_patman")
- "patman.__main__")))))))
- (inputs (list python-pygit2 python-requests python-u-boot-pylib))
+ "patman.__main__"))))
+ (add-after 'install 'wrap-program
+ (lambda _
+ (wrap-program (string-append #$output "/bin/patman")
+ `("PATH" ":" suffix
+ (,(string-append
+ #$(this-package-input "git-minimal") "/bin")))))))))
+ (inputs (list git-minimal
+ python-pygit2
+ python-requests
+ python-u-boot-pylib))
(synopsis "Patch automation tool")
(description "Patman is a patch automation script which:
@itemize
--
2.38.1
Information forwarded
to
guix-patches <at> gnu.org
:
bug#66704
; Package
guix-patches
.
(Tue, 24 Oct 2023 01:07:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 66704 <at> debbugs.gnu.org (full text, mbox):
Hi Simon,
Simon Tournier <zimon.toutoune <at> gmail.com> writes:
> Hi,
>
> Assume, I am running in some Git repository, e.g.,
>
> $ git config --get branch.tmp.remote
> origin
>
> Then, I get this error:
>
> $ guix shell -C patman -- patman -h
> Traceback (most recent call last):
> File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 95, in run_pipe
> last_pipe = cros_subprocess.Popen(cmd, cwd=cwd, **kwargs)
> File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/cros_subprocess.py", line 83, in __init__
> super(Popen, self).__init__(args, stdin=stdin,
> File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 969, in __init__
> self._execute_child(args, executable, preexec_fn, close_fds,
> File "/gnu/store/p4x29pa0qjb3r76v2bl0jvhld42l0lkq-python-3.10.7/lib/python3.10/subprocess.py", line 1845, in _execute_child
> raise child_exception_type(errno_num, err_msg, err_filename)
> FileNotFoundError: [Errno 2] No such file or directory: 'git'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/bin/.patman-real", line 47, in <module>
> parser.add_argument('-p', '--project', default=project.detect_project(),
> File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/project.py", line 19, in detect_project
> top_level = gitutil.get_top_level()
> File "/gnu/store/znq8klrhn3wwgfvrq0kqm8krx5xi7fpq-patman-2023.07.02/lib/python3.10/site-packages/patman/gitutil.py", line 627, in get_top_level
> return command.output_one_line('git', 'rev-parse', '--show-toplevel')
> File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 128, in output_one_line
> result = run_pipe([cmd], capture=True, oneline=True,
> File "/gnu/store/50q6yz9s0ddfxbwd31sf6lq15hsy97gs-python-u-boot-pylib-2023.07.02/lib/python3.10/site-packages/u_boot_pylib/command.py", line 99, in run_pipe
> raise Exception("Error running '%s': %s" % (user_pipestr, str))
> Exception: Error running 'git rev-parse --show-toplevel': <class 'str'>
>
>
> That’s because ’patman’ runs ’git’ via the file gitutils.py, see:
>
> -*- mode:grep; default-directory: "/tmp/u-boot-2023.07.02/tools/patman/" -*-
>
> 20 candidates:
> ./gitutil.py:29: cmd = ['git']
> ./gitutil.py:87: pipe = ['git', 'name-rev', commit_hash]
> ./gitutil.py:139: remote = command.output_one_line('git', '--git-dir', git_dir, 'config',
> ./gitutil.py:141: merge = command.output_one_line('git', '--git-dir', git_dir, 'config',
> ./gitutil.py:231: pipe = ['git']
> ./gitutil.py:252: pipe = ['git', 'clone', git_dir, '.']
> ./gitutil.py:265: pipe = ['git']
> ./gitutil.py:285: pipe = ['git', '--git-dir', git_dir, 'worktree', 'list']
> ./gitutil.py:300: pipe = ['git', '--git-dir', git_dir, 'worktree', 'add', '.', '--detach']
> ./gitutil.py:315: pipe = ['git', '--git-dir', git_dir, 'worktree', 'prune']
> ./gitutil.py:337: cmd = ['git', 'format-patch', '-M']
> ./gitutil.py:414: 'git', 'config', 'sendemail.suppresscc', raise_on_error=False)
> ./gitutil.py:496: git_config_to = command.output('git', 'config', 'sendemail.to',
> ./gitutil.py:511: cmd = ['git', 'send-email', '--annotate']
> ./gitutil.py:627: return command.output_one_line('git', 'rev-parse', '--show-toplevel')
> ./gitutil.py:636: fname = command.output_one_line('git', 'config', 'sendemail.aliasesfile',
> ./gitutil.py:654: uname = command.output_one_line('git', 'config', '--global', 'user.name')
> ./gitutil.py:664: uemail = command.output_one_line('git', 'config', '--global', 'user.email')
> ./gitutil.py:675: 'git', 'config', 'format.subjectprefix', raise_on_error=False)
> ./gitutil.py:699: return command.output_one_line('git', 'show', '-s', '--pretty=format:%H')
>
> I propose to wrap ’patman’ with ’git’, see patch.
I see 'git send-email' in the above, so you'll also want to wrap with
`(,git "send-email"). Did you test that this suffices to get a fully
self-contained working patman? Maybe you can send a v2 with patman.
You can add these 'Series-*' git trailers to your commit:
--8<---------------cut here---------------start------------->8---
Change-Id: xxxxxxx
[...]
Series-to: 66704 <at> debbugs.gnu.org
Series-version: 2
Series-changes: 2
- Also add 'send-email' output of git to wrapper
--8<---------------cut here---------------end--------------->8---
Then to send, you simply do:
$ patman
And it'll annotate the patch for you and you don't need to remember
tracking the '--to' value.
--
Thanks,
Maxim
Owner recorded as Steve George <steve <at> futurile.net>.
Request was from
Steve George <steve <at> futurile.net>
to
control <at> debbugs.gnu.org
.
(Tue, 16 Apr 2024 08:48:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
efraim <at> flashner.co.il, vagrant <at> debian.org, guix-patches <at> gnu.org, Steve George <steve <at> futurile.net>
:
bug#66704
; Package
guix-patches
.
(Tue, 23 Jul 2024 18:01:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 66704 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/bootloaders.scm (patman): Replace by 'package/inherit'.
[arguments]: Add 'wrap-program' that uses git dependency.
[inputs]: Add git and git:send-email.
Change-Id: Id4ebadd518f271baa087161b10455ec03d6f959b
---
gnu/packages/bootloaders.scm | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
Hi,
On Mon, 23 Oct 2023 at 21:05, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> wrote:
> I see 'git send-email' in the above
Good catch! Added. However, I am not happy with the mix of “styles”. And I
suspect a “bug” or something lacking for packages with multiple outputs; I am
going to open a report about that. Another story and not blocking, IMHO.
> Did you test that this suffices to get a fully
> self-contained working patman? Maybe you can send a v2 with patman.
Not really tested. Well, I do not know what means:
owner 66704 !
thanks
that Steve sent to control. Steve, do you want to give a try and test if this
patman package is a fully self-contained working patman? ;-)
Cheers,
simon
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index 4072df50d7..e974feae5a 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2021 Stefan <stefan-guix <at> vodafonemail.de>
;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
;;; Copyright © 2023 Herman Rimm <herman <at> rimm.ee>
+;;; Copyright © 2023 Simon Tournier <zimon.toutoune <at> gmail.com>
;;; Copyright © 2024 Zheng Junjie <873216071 <at> qq.com>
;;;
;;; This file is part of GNU Guix.
@@ -71,6 +72,7 @@ (define-module (gnu packages bootloaders)
#:use-module (gnu packages serialization)
#:use-module (gnu packages swig)
#:use-module (gnu packages valgrind)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages virtualization)
#:use-module (gnu packages xorg)
#:use-module (gnu packages python-web)
@@ -965,8 +967,7 @@ (define-public python-u-boot-pylib
;;; This is packaged separately, as it can be used in other contexts than for
;;; U-Boot development.
(define-public patman
- (package
- (inherit u-boot)
+ (package/inherit u-boot
(name "patman")
(build-system pyproject-build-system)
(arguments
@@ -991,8 +992,21 @@ (define-public patman
(lambda _
(substitute* "pyproject.toml"
(("patman.__main__:run_patman")
- "patman.__main__")))))))
- (inputs (list python-pygit2 python-requests python-u-boot-pylib))
+ "patman.__main__"))))
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((git:send-email (assoc-ref inputs "git:send-email")))
+ (wrap-program (string-append #$output "/bin/patman")
+ `("PATH" ":" prefix
+ (,(string-append #$(this-package-input "git") "/bin")))
+ `("GIT_EXEC_PATH" ":" prefix
+ (,(string-append #$(this-package-input "git") "/libexec/git-core")
+ ,(string-append git:send-email "/libexec/git-core"))))))))))
+ (inputs `(("git" ,git)
+ ("git:send-email" ,git "send-email")
+ ("python-pygit2" ,python-pygit2)
+ ("python-requests" ,python-requests)
+ ("python-u-boot-pylib" ,python-u-boot-pylib)))
(synopsis "Patch automation tool")
(description "Patman is a patch automation script which:
@itemize
base-commit: d007b64356764f49677c78d82643f1125b5353b7
--
2.41.0
Reply sent
to
Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
:
You have taken responsibility.
(Sat, 14 Sep 2024 13:03:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Simon Tournier <zimon.toutoune <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 14 Sep 2024 13:03:02 GMT)
Full text and
rfc822 format available.
Message #21 received at 66704-done <at> debbugs.gnu.org (full text, mbox):
Hi Simon,
Simon Tournier <zimon.toutoune <at> gmail.com> writes:
> * gnu/packages/bootloaders.scm (patman): Replace by 'package/inherit'.
I don't think package/inherit is appropriate here; patman is not a
variant of u-boot (doesn't share any of its inputs) -- it jut happens to
have its source part of the u-boot sources.
I've dropped it.
> [arguments]: Add 'wrap-program' that uses git dependency.
> [inputs]: Add git and git:send-email.
>
> Change-Id: Id4ebadd518f271baa087161b10455ec03d6f959b
> ---
> gnu/packages/bootloaders.scm | 22 ++++++++++++++++++----
> 1 file changed, 18 insertions(+), 4 deletions(-)
>
> Hi,
>
> On Mon, 23 Oct 2023 at 21:05, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> wrote:
>
>> I see 'git send-email' in the above
>
> Good catch! Added. However, I am not happy with the mix of “styles”. And I
> suspect a “bug” or something lacking for packages with multiple outputs; I am
> going to open a report about that. Another story and not blocking, IMHO.
>
>
>> Did you test that this suffices to get a fully
>> self-contained working patman? Maybe you can send a v2 with patman.
[...]
> (substitute* "pyproject.toml"
> (("patman.__main__:run_patman")
> - "patman.__main__")))))))
> - (inputs (list python-pygit2 python-requests python-u-boot-pylib))
> + "patman.__main__"))))
> + (add-after 'install 'wrap-program
> + (lambda* (#:key inputs #:allow-other-keys)
> + (let ((git:send-email (assoc-ref inputs "git:send-email")))
> + (wrap-program (string-append #$output "/bin/patman")
> + `("PATH" ":" prefix
> + (,(string-append #$(this-package-input "git") "/bin")))
> + `("GIT_EXEC_PATH" ":" prefix
> + (,(string-append #$(this-package-input "git") "/libexec/git-core")
> + ,(string-append git:send-email "/libexec/git-core"))))))))))
I think 'search-input-file' would be better here. It should be preferred
to gexps in general, as it is more lazy and works better with
inheritance.
> + (inputs `(("git" ,git)
> + ("git:send-email" ,git "send-email")
> + ("python-pygit2" ,python-pygit2)
> + ("python-requests" ,python-requests)
> + ("python-u-boot-pylib" ,python-u-boot-pylib)))
> (synopsis "Patch automation tool")
> (description "Patman is a patch automation script which:
> @itemize
I modified this to avoid adding labels, which was not necessary. I've
also used wrap-script, which inserts the wrapping in the Python script
directly instead of creating a .patman-real wrapper, which uglifies the
process name in top, for example.
You'll find the result in commit 4c99ef43f0.
Thanks for kicking the ball.
--
Thanks,
Maxim
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 13 Oct 2024 11:24:05 GMT)
Full text and
rfc822 format available.
bug unarchived.
Request was from
"Suhail Singh" <suhailsingh247 <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Fri, 06 Dec 2024 16:45:04 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
"Suhail Singh" <suhailsingh247 <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Fri, 06 Dec 2024 16:45:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 153 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.