* [PATCH] gnu: Add git-review. @ 2016-09-08 7:06 Clément Lassieur 2016-09-08 7:37 ` Vincent Legoll ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Clément Lassieur @ 2016-09-08 7:06 UTC (permalink / raw) To: guix-devel * gnu/packages/openstack.scm (git-review): New variable. --- gnu/packages/openstack.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 8474904..2a54a20 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,7 @@ (define-module (gnu packages openstack) #:use-module (gnu packages python) #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) #:use-module (guix build-system python) #:use-module (guix download) #:use-module ((guix licenses) @@ -781,3 +783,30 @@ permanence.") ("python2-oslosphinx" ,python2-oslosphinx) ,@(fold alist-delete (package-native-inputs swiftclient) '("python-keystoneclient" "python-oslosphinx"))))))) + +(define-public git-review + (package + (name "git-review") + (version "1.25.0") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/g/git-review/git-review-" + version ".tar.gz")) + (sha256 + (base32 + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) + (build-system python-build-system) + (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (native-inputs + `(("python-pbr" ,python-pbr))) + (inputs + `(("python-requests" ,python-requests) + ("git" ,git))) + (home-page "http://docs.openstack.org/infra/git-review/") + (synopsis "Command-line tool for Gerrit") + (description + "Git-review is a command-line tool that helps submitting Git branches to +Gerrit for review, or fetching existing ones.") + (license asl2.0))) -- 2.10.0 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 7:06 [PATCH] gnu: Add git-review Clément Lassieur @ 2016-09-08 7:37 ` Vincent Legoll 2016-09-08 10:16 ` Efraim Flashner 2016-09-08 12:28 ` [PATCH] gnu: Add git-review Ben Woodcroft 2 siblings, 0 replies; 18+ messages in thread From: Vincent Legoll @ 2016-09-08 7:37 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel Hello, On Thu, Sep 8, 2016 at 9:06 AM, Clément Lassieur <clement@lassieur.org> wrote: > * gnu/packages/openstack.scm (git-review): New variable. Yay ! Cannot comment on the input / native-input thing, but otherwise LGTM... BTW, do any high-level Guix contributor have experience with git-review+gerrit ? I have a little, I like it, even it it can be felt as a bit heavy, maybe worth investigating as a way to enhance contributor workflow, dunno... -- Vincent Legoll ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 7:06 [PATCH] gnu: Add git-review Clément Lassieur 2016-09-08 7:37 ` Vincent Legoll @ 2016-09-08 10:16 ` Efraim Flashner 2016-09-08 12:28 ` [PATCH] gnu: Add python-git-review Clément Lassieur 2016-09-08 12:28 ` [PATCH] gnu: Add git-review Ben Woodcroft 2 siblings, 1 reply; 18+ messages in thread From: Efraim Flashner @ 2016-09-08 10:16 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 2631 bytes --] On Thu, Sep 08, 2016 at 09:06:30AM +0200, Clément Lassieur wrote: > * gnu/packages/openstack.scm (git-review): New variable. > --- > gnu/packages/openstack.scm | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm > index 8474904..2a54a20 100644 > --- a/gnu/packages/openstack.scm > +++ b/gnu/packages/openstack.scm > @@ -1,6 +1,7 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com> > ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il> > +;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org> > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -20,6 +21,7 @@ > (define-module (gnu packages openstack) > #:use-module (gnu packages python) > #:use-module (gnu packages tls) > + #:use-module (gnu packages version-control) > #:use-module (guix build-system python) > #:use-module (guix download) > #:use-module ((guix licenses) > @@ -781,3 +783,30 @@ permanence.") > ("python2-oslosphinx" ,python2-oslosphinx) > ,@(fold alist-delete (package-native-inputs swiftclient) > '("python-keystoneclient" "python-oslosphinx"))))))) > + > +(define-public git-review > + (package > + (name "git-review") > + (version "1.25.0") > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "https://pypi.python.org/packages/source/g/git-review/git-review-" > + version ".tar.gz")) This should be (uri (pypi-uri "git-review" version)) > + (sha256 > + (base32 > + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) > + (build-system python-build-system) > + (arguments `(#:tests? #f)) ; tests require a running Gerrit server > + (native-inputs > + `(("python-pbr" ,python-pbr))) > + (inputs > + `(("python-requests" ,python-requests) > + ("git" ,git))) > + (home-page "http://docs.openstack.org/infra/git-review/") > + (synopsis "Command-line tool for Gerrit") > + (description > + "Git-review is a command-line tool that helps submitting Git branches to > +Gerrit for review, or fetching existing ones.") > + (license asl2.0))) > -- > 2.10.0 > > Does this also build for python-2? -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] gnu: Add python-git-review. 2016-09-08 10:16 ` Efraim Flashner @ 2016-09-08 12:28 ` Clément Lassieur 2016-09-08 17:45 ` Efraim Flashner 0 siblings, 1 reply; 18+ messages in thread From: Clément Lassieur @ 2016-09-08 12:28 UTC (permalink / raw) To: guix-devel * gnu/packages/openstack.scm (python-git-review, python2-git-review): New variables. --- gnu/packages/openstack.scm | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 8474904..4cb38a9 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Cyril Roelandt <tipecaml@gmail.com> ;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -20,6 +21,7 @@ (define-module (gnu packages openstack) #:use-module (gnu packages python) #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) #:use-module (guix build-system python) #:use-module (guix download) #:use-module ((guix licenses) @@ -781,3 +783,35 @@ permanence.") ("python2-oslosphinx" ,python2-oslosphinx) ,@(fold alist-delete (package-native-inputs swiftclient) '("python-keystoneclient" "python-oslosphinx"))))))) + +(define-public python-git-review + (package + (name "python-git-review") + (version "1.25.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "git-review" version)) + (sha256 + (base32 + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) + (build-system python-build-system) + (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (native-inputs + `(("python-pbr" ,python-pbr))) + (inputs + `(("python-requests" ,python-requests) + ("git" ,git))) + (home-page "http://docs.openstack.org/infra/git-review/") + (synopsis "Command-line tool for Gerrit") + (description + "Git-review is a command-line tool that helps submitting Git branches to +Gerrit for review, or fetching existing ones.") + (license asl2.0))) + +(define-public python2-git-review + (let ((base (package-with-python2 (strip-python2-variant python-git-review)))) + (package (inherit base) + (native-inputs + `(("python2-setuptools" ,python2-setuptools) + ,@(package-native-inputs base)))))) -- 2.10.0 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add python-git-review. 2016-09-08 12:28 ` [PATCH] gnu: Add python-git-review Clément Lassieur @ 2016-09-08 17:45 ` Efraim Flashner 0 siblings, 0 replies; 18+ messages in thread From: Efraim Flashner @ 2016-09-08 17:45 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 230 bytes --] Patch pushed! -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 7:06 [PATCH] gnu: Add git-review Clément Lassieur 2016-09-08 7:37 ` Vincent Legoll 2016-09-08 10:16 ` Efraim Flashner @ 2016-09-08 12:28 ` Ben Woodcroft 2016-09-08 17:58 ` Efraim Flashner 2016-09-08 18:32 ` Efraim Flashner 2 siblings, 2 replies; 18+ messages in thread From: Ben Woodcroft @ 2016-09-08 12:28 UTC (permalink / raw) To: Clément Lassieur, guix-devel Hi there, thanks for the patch. I do not have any experience with Gerrit but some comments below: On 08/09/16 17:06, Clément Lassieur wrote: > [..] > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "https://pypi.python.org/packages/source/g/git-review/git-review-" > + version ".tar.gz")) Rather: (uri (pypi-uri "git-review" version)) > + (sha256 > + (base32 > + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) > + (build-system python-build-system) > + (arguments `(#:tests? #f)) ; tests require a running Gerrit server > + (native-inputs > + `(("python-pbr" ,python-pbr))) > + (inputs > + `(("python-requests" ,python-requests) > + ("git" ,git))) I think including git simply as an input is problematic because git-review calls git via 'subprocess', as evidenced by $ ./pre-inst-env guix environment -C --ad-hoc git-review $ git-review [..] File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", line 1457, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'git' So, I think we need to patch the source code to call the full path to git, or otherwise wrap the 'git-review' executable. > + (home-page "http://docs.openstack.org/infra/git-review/") > + (synopsis "Command-line tool for Gerrit") > + (description > + "Git-review is a command-line tool that helps submitting Git branches to > +Gerrit for review, or fetching existing ones.") > + (license asl2.0))) Otherwise seems OK to me. Can you test with environment -C -N? ben ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 12:28 ` [PATCH] gnu: Add git-review Ben Woodcroft @ 2016-09-08 17:58 ` Efraim Flashner 2016-09-09 16:24 ` Clément Lassieur 2016-09-08 18:32 ` Efraim Flashner 1 sibling, 1 reply; 18+ messages in thread From: Efraim Flashner @ 2016-09-08 17:58 UTC (permalink / raw) To: Ben Woodcroft; +Cc: guix-devel, Clément Lassieur [-- Attachment #1: Type: text/plain, Size: 2151 bytes --] On Thu, Sep 08, 2016 at 10:28:37PM +1000, Ben Woodcroft wrote: > Hi there, thanks for the patch. I do not have any experience with Gerrit but > some comments below: > > > On 08/09/16 17:06, Clément Lassieur wrote: > > [..] > > + (source > > + (origin > > + (method url-fetch) > > + (uri (string-append > > + "https://pypi.python.org/packages/source/g/git-review/git-review-" > > + version ".tar.gz")) > > Rather: (uri (pypi-uri "git-review" version)) > > > + (sha256 > > + (base32 > > + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) > > + (build-system python-build-system) > > + (arguments `(#:tests? #f)) ; tests require a running Gerrit server > > + (native-inputs > > + `(("python-pbr" ,python-pbr))) > > + (inputs > > + `(("python-requests" ,python-requests) > > + ("git" ,git))) > > I think including git simply as an input is problematic because git-review > calls git via 'subprocess', as evidenced by > > $ ./pre-inst-env guix environment -C --ad-hoc git-review > $ git-review > [..] > File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", > line 1457, in _execute_child > raise child_exception_type(errno_num, err_msg) > FileNotFoundError: [Errno 2] No such file or directory: 'git' > > So, I think we need to patch the source code to call the full path to git, > or otherwise wrap the 'git-review' executable. > > > + (home-page "http://docs.openstack.org/infra/git-review/") > > + (synopsis "Command-line tool for Gerrit") > > + (description > > + "Git-review is a command-line tool that helps submitting Git branches to > > +Gerrit for review, or fetching existing ones.") > > + (license asl2.0))) > Otherwise seems OK to me. Can you test with environment -C -N? > ben > Oh no! I just pushed this. -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 17:58 ` Efraim Flashner @ 2016-09-09 16:24 ` Clément Lassieur 2016-09-09 20:27 ` Clément Lassieur 0 siblings, 1 reply; 18+ messages in thread From: Clément Lassieur @ 2016-09-09 16:24 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Efraim Flashner <efraim@flashner.co.il> writes: > Oh no! I just pushed this. With the patch already pushed, I get this error: --8<---------------cut here---------------start------------->8--- Using global/system git-review config files (/etc/git-review/git-review.conf) is deprecated Downloading refs/changes/73/36373/1 from gerrit Traceback (most recent call last): File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/bin/.git-review-real", line 10, in <module> sys.exit(main()) File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1522, in main _main() File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1437, in _main checkout_review(local_branch, remote, remote_branch) File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1123, in checkout_review branch_name, "FETCH_HEAD") File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 160, in run_command_exc (rc, output) = run_command_status(*argv, **env) File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 144, in run_command_status env=newenv) File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", line 859, in __init__ restore_signals, start_new_session) File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", line 1395, in _execute_child restore_signals, start_new_session, preexec_fn) UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 9: ordinal not in range(128) --8<---------------cut here---------------end--------------->8--- I'm sorry I didn't test it well enough. Maybe we should revert it, since it's probably unusable. -- Clément ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-09 16:24 ` Clément Lassieur @ 2016-09-09 20:27 ` Clément Lassieur 0 siblings, 0 replies; 18+ messages in thread From: Clément Lassieur @ 2016-09-09 20:27 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Clément Lassieur <clement@lassieur.org> writes: > With the patch already pushed, I get this error: > > --8<---------------cut here---------------start------------->8--- > Using global/system git-review config files (/etc/git-review/git-review.conf) is deprecated > Downloading refs/changes/73/36373/1 from gerrit > Traceback (most recent call last): > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/bin/.git-review-real", line 10, in <module> > sys.exit(main()) > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1522, in main > _main() > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1437, in _main > checkout_review(local_branch, remote, remote_branch) > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 1123, in checkout_review > branch_name, "FETCH_HEAD") > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 160, in run_command_exc > (rc, output) = run_command_status(*argv, **env) > File "/gnu/store/ss27c082a95dzra46lsv9fwg0sw6x7zg-python-git-review-1.25.0/lib/python3.4/site-packages/git_review/cmd.py", line 144, in run_command_status > env=newenv) > File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", line 859, in __init__ > restore_signals, start_new_session) > File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", line 1395, in _execute_child > restore_signals, start_new_session, preexec_fn) > UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 9: ordinal not in range(128) > --8<---------------cut here---------------end--------------->8--- > > I'm sorry I didn't test it well enough. Maybe we should revert it, since > it's probably unusable. I had this error on a Debian/Guix laptop (without guix environment), but I don't have it with my GuixSD laptop. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 12:28 ` [PATCH] gnu: Add git-review Ben Woodcroft 2016-09-08 17:58 ` Efraim Flashner @ 2016-09-08 18:32 ` Efraim Flashner 2016-09-09 8:23 ` Clément Lassieur 1 sibling, 1 reply; 18+ messages in thread From: Efraim Flashner @ 2016-09-08 18:32 UTC (permalink / raw) To: Ben Woodcroft; +Cc: guix-devel, Clément Lassieur [-- Attachment #1.1: Type: text/plain, Size: 2155 bytes --] On Thu, Sep 08, 2016 at 10:28:37PM +1000, Ben Woodcroft wrote: > Hi there, thanks for the patch. I do not have any experience with Gerrit but > some comments below: > > > On 08/09/16 17:06, Clément Lassieur wrote: > > [..] > > + (source > > + (origin > > + (method url-fetch) > > + (uri (string-append > > + "https://pypi.python.org/packages/source/g/git-review/git-review-" > > + version ".tar.gz")) > > Rather: (uri (pypi-uri "git-review" version)) > > > + (sha256 > > + (base32 > > + "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) > > + (build-system python-build-system) > > + (arguments `(#:tests? #f)) ; tests require a running Gerrit server > > + (native-inputs > > + `(("python-pbr" ,python-pbr))) > > + (inputs > > + `(("python-requests" ,python-requests) > > + ("git" ,git))) > > I think including git simply as an input is problematic because git-review > calls git via 'subprocess', as evidenced by > > $ ./pre-inst-env guix environment -C --ad-hoc git-review > $ git-review > [..] > File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", > line 1457, in _execute_child > raise child_exception_type(errno_num, err_msg) > FileNotFoundError: [Errno 2] No such file or directory: 'git' > > So, I think we need to patch the source code to call the full path to git, > or otherwise wrap the 'git-review' executable. > > > + (home-page "http://docs.openstack.org/infra/git-review/") > > + (synopsis "Command-line tool for Gerrit") > > + (description > > + "Git-review is a command-line tool that helps submitting Git branches to > > +Gerrit for review, or fetching existing ones.") > > + (license asl2.0))) > Otherwise seems OK to me. Can you test with environment -C -N? > ben > Try it with the attached patch -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #1.2: 0001-gnu-python-git-review-Hardcode-git-path.patch --] [-- Type: text/plain, Size: 1573 bytes --] From cb5146c8eea6ea35b1ad058345f4759b36384eb4 Mon Sep 17 00:00:00 2001 From: Efraim Flashner <efraim@flashner.co.il> Date: Thu, 8 Sep 2016 21:31:32 +0300 Subject: [PATCH] gnu: python-git-review: Hardcode git path. * gnu/packages/openstack.scm (python-git-review)[arguments]: Hardcode the location of `git' so that `git-review' can find it natively. --- gnu/packages/openstack.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 4cb38a9..d7876a8 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -796,7 +796,19 @@ permanence.") (base32 "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) (build-system python-build-system) - (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (arguments + `(#:tests? #f ; tests require a running Gerrit server + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-git-calls + (lambda _ + (let ((git (string-append + (assoc-ref %build-inputs "git") "/bin/git"))) + (substitute* "git_review/cmd.py" + (("\"git ") (string-append "\"" git " ")) + (("\"git\"") (string-append "\"" git "\"")) + (("'git'") (string-append "'" git "'"))) + #t)))))) (native-inputs `(("python-pbr" ,python-pbr))) (inputs -- 2.10.0 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-08 18:32 ` Efraim Flashner @ 2016-09-09 8:23 ` Clément Lassieur 2016-09-09 15:00 ` Efraim Flashner 0 siblings, 1 reply; 18+ messages in thread From: Clément Lassieur @ 2016-09-09 8:23 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Efraim Flashner <efraim@flashner.co.il> writes: > On Thu, Sep 08, 2016 at 10:28:37PM +1000, Ben Woodcroft wrote: >> I think including git simply as an input is problematic because git-review >> calls git via 'subprocess', as evidenced by >> >> $ ./pre-inst-env guix environment -C --ad-hoc git-review >> $ git-review >> [..] >> File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", >> line 1457, in _execute_child >> raise child_exception_type(errno_num, err_msg) >> FileNotFoundError: [Errno 2] No such file or directory: 'git' >> >> So, I think we need to patch the source code to call the full path to git, >> or otherwise wrap the 'git-review' executable. >> >> > + (home-page "http://docs.openstack.org/infra/git-review/") >> > + (synopsis "Command-line tool for Gerrit") >> > + (description >> > + "Git-review is a command-line tool that helps submitting Git branches to >> > +Gerrit for review, or fetching existing ones.") >> > + (license asl2.0))) >> Otherwise seems OK to me. Can you test with environment -C -N? >> ben >> > > Try it with the attached patch Hi, sorry for the mess and thanks for the reviews. I did not know about the "guix environment -C -N" way of testing packages, and I'm very happy to learn this. The attached patch seems to work for git, but the same error now happens with ssh. -- Clément ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-09 8:23 ` Clément Lassieur @ 2016-09-09 15:00 ` Efraim Flashner 2016-09-09 16:09 ` Clément Lassieur 2016-09-09 18:49 ` Alex Kost 0 siblings, 2 replies; 18+ messages in thread From: Efraim Flashner @ 2016-09-09 15:00 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel [-- Attachment #1.1: Type: text/plain, Size: 1869 bytes --] On Fri, Sep 09, 2016 at 10:23:20AM +0200, Clément Lassieur wrote: > Efraim Flashner <efraim@flashner.co.il> writes: > > > On Thu, Sep 08, 2016 at 10:28:37PM +1000, Ben Woodcroft wrote: > > >> I think including git simply as an input is problematic because git-review > >> calls git via 'subprocess', as evidenced by > >> > >> $ ./pre-inst-env guix environment -C --ad-hoc git-review > >> $ git-review > >> [..] > >> File "/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib/python3.4/subprocess.py", > >> line 1457, in _execute_child > >> raise child_exception_type(errno_num, err_msg) > >> FileNotFoundError: [Errno 2] No such file or directory: 'git' > >> > >> So, I think we need to patch the source code to call the full path to git, > >> or otherwise wrap the 'git-review' executable. > >> > >> > + (home-page "http://docs.openstack.org/infra/git-review/") > >> > + (synopsis "Command-line tool for Gerrit") > >> > + (description > >> > + "Git-review is a command-line tool that helps submitting Git branches to > >> > +Gerrit for review, or fetching existing ones.") > >> > + (license asl2.0))) > >> Otherwise seems OK to me. Can you test with environment -C -N? > >> ben > >> > > > > Try it with the attached patch > > Hi, sorry for the mess and thanks for the reviews. > > I did not know about the "guix environment -C -N" way of testing > packages, and I'm very happy to learn this. > > The attached patch seems to work for git, but the same error now happens > with ssh. > > -- > Clément I found ssh and I found an instance of scp, so this should be better. -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #1.2: 0001-gnu-python-git-review-Find-outside-commands.patch --] [-- Type: text/plain, Size: 2778 bytes --] From a4169c369d850da7859e94152f96dc71acb42e4f Mon Sep 17 00:00:00 2001 From: Efraim Flashner <efraim@flashner.co.il> Date: Thu, 8 Sep 2016 21:31:32 +0300 Subject: [PATCH] gnu: python-git-review: Find outside commands. * gnu/packages/openstack.scm (python-git-review)[arguments]: Hardcode the location of `git', `ssh' and `scp' so that `git-review' can find it natively. [inputs]: Add openssh. --- gnu/packages/openstack.scm | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 4cb38a9..65bc296 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -20,6 +20,7 @@ (define-module (gnu packages openstack) #:use-module (gnu packages python) + #:use-module (gnu packages ssh) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (guix build-system python) @@ -796,11 +797,33 @@ permanence.") (base32 "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) (build-system python-build-system) - (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (arguments + `(#:tests? #f ; tests require a running Gerrit server + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'hardcode-outside-programs + (lambda _ + (let* ((git (string-append + (assoc-ref %build-inputs "git") "/bin/git")) + (base (assoc-ref %build-inputs "openssh")) + (ssh (string-append base "/bin/ssh")) + (scp (string-append base "/bin/scp"))) + (substitute* '("git_review/cmd.py" "git_review/tests/test_git_review.py" + "git_review/tests/test_unit.py" "git_review/tests/utils.py") + (("\"git ") (string-append "\"" git " ")) + (("\"git\"") (string-append "\"" git "\"")) + (("'git'") (string-append "'" git "'"))) + (substitute* "git_review/cmd.py" + (("\"ssh\"") (string-append "\"" ssh "\"")) + (("'ssh'") (string-append "'" ssh "'")) + (("\"scp\"") (string-append "\"" scp "\"")) + (("'scp") (string-append "'" scp))) + #t)))))) (native-inputs `(("python-pbr" ,python-pbr))) (inputs `(("python-requests" ,python-requests) + ("openssh" ,openssh) ("git" ,git))) (home-page "http://docs.openstack.org/infra/git-review/") (synopsis "Command-line tool for Gerrit") -- 2.10.0 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-09 15:00 ` Efraim Flashner @ 2016-09-09 16:09 ` Clément Lassieur 2016-09-10 19:05 ` Efraim Flashner 2016-09-09 18:49 ` Alex Kost 1 sibling, 1 reply; 18+ messages in thread From: Clément Lassieur @ 2016-09-09 16:09 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Efraim Flashner <efraim@flashner.co.il> writes: > I found ssh and I found an instance of scp, so this should be better. --8<---------------cut here---------------start------------->8--- clement@lev ~/foo [env]# git-review -d 36373 Downloading refs/changes/73/36373/1 from gerrit Cannot fetch patchset contents Does specified change number belong to this project? The following command failed with exit code 128 "/gnu/store/...-git-2.10.0/bin/git fetch gerrit refs/changes/73/36373/1" ----------------------- error: cannot run ssh: No such file or directory fatal: unable to fork ----------------------- clement@lev ~/foo [env]# /gnu/store/...-git-2.10.0/bin/git remote -v gerrit ssh://bar (fetch) gerrit ssh://bar (push) --8<---------------cut here---------------end--------------->8--- It looks like ssh isn't hardcoded within git either. Is it worth doing this for git-review then? ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-09 16:09 ` Clément Lassieur @ 2016-09-10 19:05 ` Efraim Flashner 2016-09-10 21:13 ` [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found Clément Lassieur 2016-09-10 21:25 ` [PATCH] gnu: Add git-review Clément Lassieur 0 siblings, 2 replies; 18+ messages in thread From: Efraim Flashner @ 2016-09-10 19:05 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 1579 bytes --] On Fri, Sep 09, 2016 at 06:09:40PM +0200, Clément Lassieur wrote: > Efraim Flashner <efraim@flashner.co.il> writes: > > > I found ssh and I found an instance of scp, so this should be better. > > --8<---------------cut here---------------start------------->8--- > clement@lev ~/foo [env]# git-review -d 36373 > Downloading refs/changes/73/36373/1 from gerrit > Cannot fetch patchset contents > > Does specified change number belong to this project? > > The following command failed with exit code 128 > "/gnu/store/...-git-2.10.0/bin/git fetch gerrit refs/changes/73/36373/1" > ----------------------- > error: cannot run ssh: No such file or directory > fatal: unable to fork > ----------------------- > clement@lev ~/foo [env]# /gnu/store/...-git-2.10.0/bin/git remote -v > gerrit ssh://bar (fetch) > gerrit ssh://bar (push) > --8<---------------cut here---------------end--------------->8--- > > It looks like ssh isn't hardcoded within git either. Is it worth doing > this for git-review then? This looks like you are using ssh for talking to the remote server, in which case it would exist outside of git-review. Or did I misunderstand it? It does seem that wrapping the program would be easier than trying to fing regexes that work to patching only certain instances of other programs. -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found. 2016-09-10 19:05 ` Efraim Flashner @ 2016-09-10 21:13 ` Clément Lassieur 2016-09-11 7:05 ` Efraim Flashner 2016-09-10 21:25 ` [PATCH] gnu: Add git-review Clément Lassieur 1 sibling, 1 reply; 18+ messages in thread From: Clément Lassieur @ 2016-09-10 21:13 UTC (permalink / raw) To: guix-devel * gnu/packages/openstack.scm (python-git-review)[arguments]: Add 'wrap-program' phase. [inputs]: Add openssh. --- gnu/packages/openstack.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm index 4cb38a9..62f1e84 100644 --- a/gnu/packages/openstack.scm +++ b/gnu/packages/openstack.scm @@ -20,6 +20,7 @@ (define-module (gnu packages openstack) #:use-module (gnu packages python) + #:use-module (gnu packages ssh) #:use-module (gnu packages tls) #:use-module (gnu packages version-control) #:use-module (guix build-system python) @@ -796,12 +797,26 @@ permanence.") (base32 "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) (build-system python-build-system) - (arguments `(#:tests? #f)) ; tests require a running Gerrit server + (arguments + '(#:tests? #f ; tests require a running Gerrit server + #:phases + (modify-phases %standard-phases + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (git (assoc-ref inputs "git")) + (openssh (assoc-ref inputs "openssh"))) + (wrap-program (string-append out "/bin/git-review") + `("PATH" ":" prefix + ,(map (lambda (dir) + (string-append dir "/bin")) + (list git openssh)))))))))) (native-inputs `(("python-pbr" ,python-pbr))) (inputs `(("python-requests" ,python-requests) - ("git" ,git))) + ("git" ,git) + ("openssh" ,openssh))) (home-page "http://docs.openstack.org/infra/git-review/") (synopsis "Command-line tool for Gerrit") (description -- 2.10.0 ^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found. 2016-09-10 21:13 ` [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found Clément Lassieur @ 2016-09-11 7:05 ` Efraim Flashner 0 siblings, 0 replies; 18+ messages in thread From: Efraim Flashner @ 2016-09-11 7:05 UTC (permalink / raw) To: Clément Lassieur; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 3194 bytes --] On Sat, Sep 10, 2016 at 11:13:32PM +0200, Clément Lassieur wrote: > * gnu/packages/openstack.scm (python-git-review)[arguments]: Add > 'wrap-program' phase. > [inputs]: Add openssh. > --- > gnu/packages/openstack.scm | 19 +++++++++++++++++-- > 1 file changed, 17 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/openstack.scm b/gnu/packages/openstack.scm > index 4cb38a9..62f1e84 100644 > --- a/gnu/packages/openstack.scm > +++ b/gnu/packages/openstack.scm > @@ -20,6 +20,7 @@ > > (define-module (gnu packages openstack) > #:use-module (gnu packages python) > + #:use-module (gnu packages ssh) > #:use-module (gnu packages tls) > #:use-module (gnu packages version-control) > #:use-module (guix build-system python) > @@ -796,12 +797,26 @@ permanence.") > (base32 > "07d1jn9ryff5j5ic6qj5pbk10m1ccmpllj0wyalrcms1q9yhlzh8")))) > (build-system python-build-system) > - (arguments `(#:tests? #f)) ; tests require a running Gerrit server > + (arguments > + '(#:tests? #f ; tests require a running Gerrit server > + #:phases > + (modify-phases %standard-phases > + (add-after 'install 'wrap-program > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out (assoc-ref outputs "out")) > + (git (assoc-ref inputs "git")) > + (openssh (assoc-ref inputs "openssh"))) > + (wrap-program (string-append out "/bin/git-review") > + `("PATH" ":" prefix > + ,(map (lambda (dir) > + (string-append dir "/bin")) > + (list git openssh)))))))))) > (native-inputs > `(("python-pbr" ,python-pbr))) > (inputs > `(("python-requests" ,python-requests) > - ("git" ,git))) > + ("git" ,git) > + ("openssh" ,openssh))) > (home-page "http://docs.openstack.org/infra/git-review/") > (synopsis "Command-line tool for Gerrit") > (description > -- > 2.10.0 > $ guix gc --references /gnu/store/5nr0nxadwrjrwsl16zgv2adlglpjcffn-python-git-review-1.25.0/ /gnu/store/429j0rw9782lsnnj492sr51dynw1iljl-python-testrepository-0.0.20 /gnu/store/5nr0nxadwrjrwsl16zgv2adlglpjcffn-python-git-review-1.25.0 /gnu/store/h2yg74jqdm062aijw775ambram58xc4f-git-2.10.0 /gnu/store/kqyrncmqyppb8njh0mh5gmi9iwsszvp6-python-pbr-1.8.1 /gnu/store/l3dmdmchz4nc0kjp4rqag94nbchihmn8-python-testtools-1.0.0 /gnu/store/m1v516vzcxqfvwvr3vlqxm1dzsjrjz50-python-fixtures-0.3.16 /gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3 /gnu/store/s3hwh3ky7qa173sxq7kz43xknxnbl3db-openssh-7.3p1 /gnu/store/wa1yc835mb7pmmrj45xfgviqr5fbasqq-python-wrapper-3.4.3 /gnu/store/xg06wf5hx35pprifwjfmsshczqa2vj1c-python-mimeparse-0.1.4 /gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42 /gnu/store/zdahv56anb0ni3kcvbr1c446xbxmlpvs-python-requests-2.9.1 Looks good, pushed. -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-10 19:05 ` Efraim Flashner 2016-09-10 21:13 ` [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found Clément Lassieur @ 2016-09-10 21:25 ` Clément Lassieur 1 sibling, 0 replies; 18+ messages in thread From: Clément Lassieur @ 2016-09-10 21:25 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Efraim Flashner <efraim@flashner.co.il> writes: >> It looks like ssh isn't hardcoded within git either. Is it worth doing >> this for git-review then? > > This looks like you are using ssh for talking to the remote server, in > which case it would exist outside of git-review. Or did I misunderstand > it? This error was a git error, when it tries to fetch a remote through ssh in a container. It is kind of the same thing that happens with git-review. Except that git-review is unusable without ssh. That's why ssh has to be an input of git-review. > It does seem that wrapping the program would be easier than trying to > fing regexes that work to patching only certain instances of other > programs. I sent a patch that does the wrapping. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH] gnu: Add git-review. 2016-09-09 15:00 ` Efraim Flashner 2016-09-09 16:09 ` Clément Lassieur @ 2016-09-09 18:49 ` Alex Kost 1 sibling, 0 replies; 18+ messages in thread From: Alex Kost @ 2016-09-09 18:49 UTC (permalink / raw) To: Efraim Flashner; +Cc: guix-devel Efraim Flashner (2016-09-09 18:00 +0300) wrote: [...] > + (arguments > + `(#:tests? #f ; tests require a running Gerrit server > + #:phases > + (modify-phases %standard-phases > + (add-after 'unpack 'hardcode-outside-programs > + (lambda _ A side note: I think in phases it is better to use 'inputs' argument instead of %build-inputs: (lambda* (#:key inputs #:allow-other-keys) > + (let* ((git (string-append > + (assoc-ref %build-inputs "git") "/bin/git")) > + (base (assoc-ref %build-inputs "openssh")) (assoc-ref inputs "git") and (assoc-ref inputs "openssh") here > + (ssh (string-append base "/bin/ssh")) > + (scp (string-append base "/bin/scp"))) > + (substitute* '("git_review/cmd.py" "git_review/tests/test_git_review.py" > + "git_review/tests/test_unit.py" "git_review/tests/utils.py") > + (("\"git ") (string-append "\"" git " ")) > + (("\"git\"") (string-append "\"" git "\"")) > + (("'git'") (string-append "'" git "'"))) > + (substitute* "git_review/cmd.py" > + (("\"ssh\"") (string-append "\"" ssh "\"")) > + (("'ssh'") (string-append "'" ssh "'")) > + (("\"scp\"") (string-append "\"" scp "\"")) > + (("'scp") (string-append "'" scp))) > + #t)))))) > (native-inputs > `(("python-pbr" ,python-pbr))) > (inputs > `(("python-requests" ,python-requests) > + ("openssh" ,openssh) > ("git" ,git))) > (home-page "http://docs.openstack.org/infra/git-review/") > (synopsis "Command-line tool for Gerrit") -- Alex ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2016-09-11 7:05 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-09-08 7:06 [PATCH] gnu: Add git-review Clément Lassieur 2016-09-08 7:37 ` Vincent Legoll 2016-09-08 10:16 ` Efraim Flashner 2016-09-08 12:28 ` [PATCH] gnu: Add python-git-review Clément Lassieur 2016-09-08 17:45 ` Efraim Flashner 2016-09-08 12:28 ` [PATCH] gnu: Add git-review Ben Woodcroft 2016-09-08 17:58 ` Efraim Flashner 2016-09-09 16:24 ` Clément Lassieur 2016-09-09 20:27 ` Clément Lassieur 2016-09-08 18:32 ` Efraim Flashner 2016-09-09 8:23 ` Clément Lassieur 2016-09-09 15:00 ` Efraim Flashner 2016-09-09 16:09 ` Clément Lassieur 2016-09-10 19:05 ` Efraim Flashner 2016-09-10 21:13 ` [PATCH] gnu: python-git-review: Wrap it so 'git', 'ssh' and 'scp' are found Clément Lassieur 2016-09-11 7:05 ` Efraim Flashner 2016-09-10 21:25 ` [PATCH] gnu: Add git-review Clément Lassieur 2016-09-09 18:49 ` Alex Kost
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.