GNU bug report logs - #47539
[PATCH 00/28] Add gh and dependencies

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Thu, 1 Apr 2021 07:52:02 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #110 received at 47539 <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>, 47539 <at> debbugs.gnu.org
Subject: Re: [bug#47539] [PATCH 00/28] Add gh and dependencies
Date: Thu, 01 Apr 2021 20:05:01 +0200
On Thu, Apr 01 2021, Leo Prikler wrote:

>> Compiling github-cli without the package doesn't work, and the
>> package is used in multiple places in the source code.  I don't
>> really know what we can do here.  Should I open an issue on their
>> GitHub page, or just leave it as is?
> For now, I don't think this is going to be a blocking issue, as long as
> the package and the input are appropriately marked, e.g. with comments,
> and we make sure not to endorse the Microsoft OS through them.  
> As to how we might handle this, we could do our own investigations into
> dropping the dependency, but asking a question (make sure to tag it as
> such) should work as well.  Also be clear, that the goal is not
> necessarily to remove the dependency altogether, but rather make it an
> optional one.
>
> After doing some quick investigations myself, I think the following
> pair of substitute*s might work:
>   (("github.com/cli/safeexec") "os/exec")
>   (("safeexec") "exec")

Thank you for the pointer, I managed to get it to work with the
following snippet:

#+begin_src scheme
(add-after 'unpack 'remove-safeexec
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((prefix-file (lambda (file)
                             (string-append "src/github.com/cli/cli/" file))))
               ;; 'github.com/cli/safeexec' is only used for Windows, we
               ;; replace it with the regular 'os/exec'.  See
               ;; <https://issues.guix.gnu.org/47539> for discussion.
               (substitute* (map prefix-file
                                 '("pkg/cmd/alias/expand/expand.go"
                                   "script/build.go"))
                 (("github.com/cli/safeexec") "os/exec")
                 (("safeexec") "exec"))
               ;; These files have already imported 'os/exec', meaning that
               ;; 'os/exec' would get imported twice, causing an error.
               ;; Instead, we just remove the 'github.com/cli/safeexec'.
               (substitute* (map prefix-file
                                 '("cmd/gh/main.go"
                                   "git/git.go"
                                   "pkg/iostreams/iostreams.go"
                                   "pkg/cmd/auth/shared/ssh_keys.go"
                                   "pkg/cmd/pr/checkout/checkout.go"
                                   "pkg/cmdutil/web_browser.go"
                                   "pkg/surveyext/editor_manual.go"))
                 (("\"github.com/cli/safeexec\"") "")
                 (("safeexec") "exec")))))
#+end_src

I also used it to open an issue and everything worked as expected.




This bug report was last modified 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.