Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 683144

Summary: dev-lang/ghc-8.0.2 - QA Notice: command not found
Product: Gentoo Linux Reporter: Francesco Turco <fturco>
Component: Current packagesAssignee: Gentoo's Haskell Language team <haskell>
Status: RESOLVED FIXED    
Severity: normal Keywords: PullRequest
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/14499
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: info.txt
build.log.xz

Description Francesco Turco 2019-04-12 10:44:10 UTC
Portage reports the following QA issue when emerging dev-lang/ghc-8.0.2:

> QA: install
> QA Notice: command not found:
> /var/tmp/portage/dev-lang/ghc-8.0.2/temp/environment: line 2477: --info: command not found

---------------------

# emerge -pv ghc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] dev-lang/ghc-8.0.2:0/8.0.2::gentoo  USE="gmp -binary -doc -ghcbootstrap -ghcmakebinary -profile" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
Comment 1 Francesco Turco 2019-04-12 10:44:54 UTC
Created attachment 572554 [details]
info.txt

emerge --info
Comment 2 Francesco Turco 2019-04-12 10:46:18 UTC
Created attachment 572556 [details]
build.log.xz
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-05-22 09:39:27 UTC
Likely a ghc--info call before ghc is available. Should be easy to fix or at least improve the error message.
Comment 4 Larry the Git Cow gentoo-dev 2020-01-29 22:04:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f58d31d661f7bda2fe7b591419f0d9f138a2dae6

commit f58d31d661f7bda2fe7b591419f0d9f138a2dae6
Author:     Benjamin Gordon <bmgordon@chromium.org>
AuthorDate: 2020-01-29 19:38:13 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-01-29 22:04:46 +0000

    ghc-package.eclass: Handle missing ghc in lookups
    
    ghc-getghc() and ghc-getghcpkg() both assume that they can find an
    installed binary.  If ghc isn't installed (e.g., because it's being
    being rebuilt or has been unmerged), there is no such binary. This
    causes the intended arguments to be run as a command, which produces
    "command not found" QA Notices.
    
    If ghc can't be found, return "false" instead.  The false command will
    harmlessly absorb the other command-line arguments.  This doesn't
    produce any difference in the final result because the invalid commands
    were failing anyway.
    
    Closes: https://bugs.gentoo.org/683144
    Signed-off-by: Benjamin Gordon <bmgordon@chromium.org>
    Closes: https://github.com/gentoo/gentoo/pull/14499
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/ghc-package.eclass | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)