Bug 53978

Summary: ghci: ошибка запуска
Product: Sisyphus Reporter: Anton Zhukharev <ancieg>
Component: ghc-ghciAssignee: Leonid Znamenok <respublica>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: imz, respublica
Version: unstable   
Hardware: x86_64   
OS: Linux   
Bug Depends on:    
Bug Blocks: 57857    

Description Anton Zhukharev 2025-04-24 15:41:59 MSK
Ошибка при запуске GHCi
```
$ ghci
GHCi, version 9.6.6: https://www.haskell.org/ghc/  :? for help

<interactive>:1:1: error: [GHC-52243]
    Failed to load interface for ‘GHC.Types’
    no unit id matching ‘ghc-prim’ was found
```

Установленные в систему пакеты:
ghc-9.6.6-alt1.noarch
ghc9.6-9.6.6-alt3.x86_64
ghc9.6-array-0.5.6.0-alt3.x86_64
ghc9.6-base-4.18.2.1-alt3.x86_64
ghc9.6-binary-0.8.9.1-alt3.x86_64
ghc9.6-bytestring-0.11.5.3-alt3.x86_64
ghc9.6-Cabal-3.10.3.0-alt3.x86_64
ghc9.6-Cabal-syntax-3.10.3.0-alt3.x86_64
ghc9.6-common-9.6.6-alt3.x86_64
ghc9.6-containers-0.6.7-alt3.x86_64
ghc9.6-deepseq-1.4.8.1-alt3.x86_64
ghc9.6-directory-1.3.8.5-alt3.x86_64
ghc9.6-exceptions-0.10.7-alt3.x86_64
ghc9.6-filepath-1.4.300.1-alt3.x86_64
ghc9.6-ghc-9.6.6-alt3.x86_64
ghc9.6-ghc-bignum-1.3-alt3.x86_64
ghc9.6-ghc-boot-9.6.6-alt3.x86_64
ghc9.6-ghc-boot-th-9.6.6-alt3.x86_64
ghc9.6-ghc-heap-9.6.6-alt3.x86_64
ghc9.6-ghci-9.6.6-alt3.x86_64
ghc9.6-ghc-prim-0.10.0-alt3.x86_64
ghc9.6-haskeline-0.8.2.1-alt3.x86_64
ghc9.6-hpc-0.6.2.0-alt3.x86_64
ghc9.6-libiserv-9.6.6-alt3.x86_64
ghc9.6-mtl-2.3.1-alt3.x86_64
ghc9.6-parsec-3.1.16.1-alt3.x86_64
ghc9.6-pretty-1.1.3.6-alt3.x86_64
ghc9.6-process-1.6.19.0-alt3.x86_64
ghc9.6-stm-2.5.1.0-alt3.x86_64
ghc9.6-template-haskell-2.20.0.0-alt3.x86_64
ghc9.6-terminfo-0.4.1.6-alt3.x86_64
ghc9.6-text-2.0.2-alt3.x86_64
ghc9.6-time-1.12.2-alt3.x86_64
ghc9.6-transformers-0.6.1.0-alt3.x86_64
ghc9.6-unix-2.8.4.0-alt3.x86_64
ghc9.6-xhtml-3000.2.2.1-alt3.x86_64
ghc-ghci-9.6.6-alt1.noarch
rpm-macros-ghc9.6-common-9.6.6-alt3.x86_64
Comment 1 Leonid Znamenok 2025-04-24 16:49:55 MSK
Попробуйте доставить ghc-devel

Хотя, это конечно нелогично. Нужно будет поправить.
Comment 2 Anton Zhukharev 2025-04-24 16:53:17 MSK
Доустановка ghc-devel помогает.
Comment 3 Repository Robot 2025-04-24 20:38:19 MSK
ghc-9.6.6-alt2 -> sisyphus:

 Thu Apr 24 2025 Leonid Znamenok <respublica@altlinux> 9.6.6-alt2
 - Rebuild with dependency on ghc-devel (Closes: #53978)
Comment 4 Ivan Zakharyaschev 2026-02-13 15:42:31 MSK
$ cat ~/hasher/aptbox/etc/apt/sources.list
rpm-dir file:/tmp/.private/imz/hasher/repo x86_64 hasher
rpm [alt] file:/ALT/Sisyphus x86_64 classic debuginfo checkinstall
rpm [alt] file:/ALT/Sisyphus noarch classic checkinstall
rpm [alt] file:/ALT/Sisyphus x86_64-i586 classic
$ hsh-install --workdir ~/hasher/ ghc-ghci
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghc-prim-1:0.10.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghc-bignum-1:1.3-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-base-1:4.18.3.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-array-1:0.5.8.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-deepseq-1:1.4.8.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-pretty-1:1.1.3.6-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-time-1:1.12.2-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-stm-1:2.5.1.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghc-boot-th-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-template-haskell-1:2.20.0.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-bytestring-1:0.11.5.4-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-containers-1:0.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-binary-1:0.8.9.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghc-heap-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-transformers-1:0.6.1.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-mtl-1:2.3.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-exceptions-1:0.10.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-filepath-1:1.4.301.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-unix-1:2.8.6.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-directory-1:1.3.8.5-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghc-boot-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc9.6-ghci-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:37:30 rpmi: ghc-ghci-1:9.6.7-alt1 sisyphus+383971.200.3.3 1747159306 installed
$ hsh-shell --mount=/proc,/dev/pts --workdir ~/hasher/ 
[builder@localhost .in]$ ghci
-bash: ghci: command not found
[builder@localhost .in]$

$ hsh-install --workdir ~/hasher/ ghc9.6-common
<13>Feb 13 12:40:19 rpmi: ghc9.6-process-1:1.6.19.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:19 rpmi: rpm-macros-ghc9.6-common-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:19 rpmi: ghc9.6-hpc-1:0.6.2.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-ghc-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-xhtml-1:3000.2.2.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-libiserv-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-terminfo-1:0.4.1.6-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-haskeline-1:0.8.2.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: libgmp-devel-6.3.0-alt1 sisyphus+328118.100.2.1 1693294124 installed
<13>Feb 13 12:40:20 rpmi: libffi-devel-1:3.5.2-alt1 sisyphus+397156.100.1.1 1760464522 installed
<13>Feb 13 12:40:20 rpmi: haskell-filetrigger-0.1.0-alt1 sisyphus+378577.100.1.1 1742391763 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-text-1:2.0.2-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:20 rpmi: ghc9.6-parsec-1:3.1.16.1-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:21 rpmi: ghc9.6-Cabal-syntax-1:3.10.3.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:21 rpmi: ghc9.6-Cabal-1:3.10.3.0-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:23 rpmi: ghc9.6-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
<13>Feb 13 12:40:23 rpmi: ghc9.6-common-1:9.6.7-alt1 sisyphus+384137.100.1.1 1747235447 installed
$ hsh-run --mount=/proc,/dev/pts --workdir ~/hasher/ -- ghci; echo $?
GHCi, version 9.6.7: https://www.haskell.org/ghc/  :? for help

<interactive>:1:1: error: [GHC-52243]
    Failed to load interface for `GHC.Types'
    no unit id matching `ghc-prim' was found
1
$ hsh-run --mount=/proc,/dev/pts --workdir ~/hasher/ -- rpm -qa 'ghc*-devel'; echo $?
0

ghc-devel is not installed, contrary to that fix:


https://bugzilla.altlinux.org/show_bug.cgi?id=57857#c1 :

> A related fix that didn't help:
> 
> ==ghc-ghci==
> * Thu Apr 24 2025 Leonid Znamenok <respublica@altlinux.org> 9.6.6-alt2
> - Rebuild with dependency on ghc-devel (Closes: #53978)
> 
> https://bugzilla.altlinux.org/53978


But there is still no dependency on ghc-devel:

apt> depends ghc-ghci
ghc-ghci-9.6.6-alt2:p11+387571.100.1.1@1750762280
  Depends: ghc9.6-ghci
apt> depends ghc9.6-ghci
ghc9.6-ghci-9.6.6-alt3:p11+383990.200.3.1@1750711102
  Depends: ghc9.6-ghc-boot = 9.6.6-alt3:p11+383990.200.3.1
  Depends: ghc9.6-ghc-heap = 9.6.6-alt3:p11+383990.200.3.1
apt> 


BTW, installing ghc-devel would mean consuming a lot of additional space on the filesystem. Is it necessary for ghci to work?

apt> install ghc-devel
Unrequested changes are needed to execute this operation.
The following NEW packages will be installed:
  ghc                        ghc9.6-base-devel        ghc9.6-devel             ghc9.6-ghc-boot-devel     ghc9.6-ghc-heap-devel   ghc9.6-integer-gmp        ghc9.6-pretty-devel            ghc9.6-text-devel          ghc9.6-unix-devel
  ghc-devel                  ghc9.6-binary-devel      ghc9.6-directory-devel   ghc9.6-ghc-boot-th-devel  ghc9.6-ghc-prim-devel   ghc9.6-integer-gmp-devel  ghc9.6-process-devel           ghc9.6-time-devel          ghc9.6-xhtml-devel
  ghc9.6-Cabal-devel         ghc9.6-bytestring-devel  ghc9.6-exceptions-devel  ghc9.6-ghc-compact        ghc9.6-ghci-devel       ghc9.6-libiserv-devel     ghc9.6-stm-devel               ghc9.6-transformers-devel
  ghc9.6-Cabal-syntax-devel  ghc9.6-containers-devel  ghc9.6-filepath-devel    ghc9.6-ghc-compact-devel  ghc9.6-haskeline-devel  ghc9.6-mtl-devel          ghc9.6-template-haskell-devel  ghc9.6-ucd2haskell
  ghc9.6-array-devel         ghc9.6-deepseq-devel     ghc9.6-ghc-bignum-devel  ghc9.6-ghc-devel          ghc9.6-hpc-devel        ghc9.6-parsec-devel       ghc9.6-terminfo-devel          ghc9.6-ucd2haskell-devel
0 upgraded, 42 newly installed, 0 removed and 0 kept.
Will need more 271MB of archives.
After unpacking will need more 3349MB of disk space.
Do you want to continue? [Y/n] n
Comment 5 Leonid Znamenok 2026-02-13 21:33:05 MSK
(Ответ для Ivan Zakharyaschev на комментарий #4)
> ghc-devel is not installed, contrary to that fix:
> https://bugzilla.altlinux.org/show_bug.cgi?id=57857#c1 :
> ...
> But there is still no dependency on ghc-devel

At the moment, GHC is packaged in such a way that ghc9.6-ghci does not contain an executable file (/usr/bin/ghci9.6.7), but only the GHCi module built as a dynamic library:

https://hackage.haskell.org/package/ghci

$ rpm -ql ghc9.6-ghci
/usr/lib64/ghc-9.6.7/lib/x86_64-linux-ghc-9.6.7/libHSghci-9.6.7-ghc9.6.7.so


A library is an independent entity and can be installed (and used) separately from the interpreter itself. This possibility is more theoretical than practical. There are several modules that use GHCi without depending on the main GHC module, but in ALT they are not represented in any way.

Moreover, if we look at what GHCi actually is:

$ cat $(which ghci-9.6.7)
#!/bin/sh
exedir="/usr/lib64/ghc-9.6.7/bin"
exeprog="./ghci-9.6.7"
executablename="/usr/lib64/ghc-9.6.7/bin/./ghci-9.6.7"
bindir="/usr/bin"
libdir="/usr/lib64/ghc-9.6.7/lib"
docdir="/usr/share/doc/ghc-9.6.7"
includedir="/usr/include"

executable="$bindir/ghc-9.6.7"
exec $executable --interactive "$@"


it becomes clear that separating the interpreter into a package that has mininal dependencies and which is independent from the compiler is impossible. That is, GHC itself must always be installed together with GHCi, and GHC in turn requires the full set of -devel libraries.

In any case, answering the question:
> BTW, installing ghc-devel would mean consuming a lot of additional space on the filesystem. Is it necessary for ghci to work?

Yes, these libraries are mandatory.

-----


Reading this again now, I realize that these considerations are not the most obvious ones. In principle, I could move GHCi (the script shown above) into the ghc(9.6)-ghci package. That would make the internal structure a bit more obvious, but at the same time it would give it the full set of dependencies on all bundled GHC libraries.
Comment 6 Ivan Zakharyaschev 2026-02-13 23:23:24 MSK
Thank you for the explanation!

Maybe it's not a bug then.

(Ответ для Leonid Znamenok на комментарий #5)
> (Ответ для Ivan Zakharyaschev на комментарий #4)
> > ghc-devel is not installed, contrary to that fix:
> > https://bugzilla.altlinux.org/show_bug.cgi?id=57857#c1 :
> > ...
> > But there is still no dependency on ghc-devel
> 
> At the moment, GHC is packaged in such a way that ghc9.6-ghci does not
> contain an executable file (/usr/bin/ghci9.6.7), but only the GHCi module
> built as a dynamic library:

Maybe the problem was that I didn't realize this from the Summary of ghc-ghci:

Summary     : Haskell ghci runtime files

$ rpm -q ghc{9.6,}-ghci --qf='%{SUMMARY}\n'
Haskell ghci runtime files
Haskell ghci runtime files


I thought that if the executable /usr/bin/ghci is in ghc9.6-common, then the missing part for using ghci must have been "Haskell ghci runtime files". (But I wanted to outsmart the set of packages -- not wanting to install the gigabytes of *-devel packages.)

> In any case, answering the question:
> > BTW, installing ghc-devel would mean consuming a lot of additional space on the filesystem. Is it necessary for ghci to work?
> 
> Yes, these libraries are mandatory.

I see. Thank you for the explanation!

> 
> -----
> 
> 
> Reading this again now, I realize that these considerations are not the most
> obvious ones. In principle, I could move GHCi (the script shown above) into
> the ghc(9.6)-ghci package. That would make the internal structure a bit more
> obvious, but at the same time it would give it the full set of dependencies
> on all bundled GHC libraries.

I just don't see the purpose of ghc-ghci package in the current situation. Its name is a bit misleading. After your explanations, I'd be inclined to leave ghc9.6-ghci module with minimal dependencies (for the users of this module as a library). Now I see the "purpose": Then ghc-ghci logically is just the "standard" version of it in Sisyphus. But the name is a but misleading, which made me expect that it will make ghci work...

Maybe just add a note to the Summary of the package ghc{9.6,}-ghci, and maybe make another package (ghci) if installing ghc is not enough for it to work...
Comment 7 Ivan Zakharyaschev 2026-02-13 23:30:18 MSK
(Ответ для Ivan Zakharyaschev на комментарий #6)

> Maybe just add a note to the Summary of the package ghc{9.6,}-ghci, and

Not true:

> maybe make another package (ghci) if installing ghc is not enough for it to
> work...
Comment 8 Ivan Zakharyaschev 2026-02-14 00:25:36 MSK
My actual story and an inconsistency I noticed:

if I install ghc9.6 and ghc9.6-common first, ghci doesn't work. If I install ghc9.6-ghci then, ghci still doesn't work. And even if I install ghc-ghci, ghci still doesn't work. 

They don't have a dependency on ghc9.6-devel (unlike the ghc package):

$ rpm -q ghc9.6 -R
libffi-devel
libgmp-devel
glibc-gconv-modules
haskell-filetrigger
/bin/sh
/lib64/ld-linux-x86-64.so.2
ghc9.6-Cabal = 3.10.3.0-alt3:p11+383990.200.3.1
ghc9.6-haskeline = 0.8.2.1-alt3:p11+383990.200.3.1
ghc9.6-libiserv = 9.6.6-alt3:p11+383990.200.3.1
ghc9.6-xhtml = 3000.2.2.1-alt3:p11+383990.200.3.1
ghc9.6-ghc = 9.6.6-alt3:p11+383990.200.3.1
rpmlib(PayloadIsXz)
$ rpm -q ghc -R
ghc9.6 = 9.6.6
ghc9.6-common = 9.6.6
ghc-devel = 9.6.6-alt2:p11+387571.100.1.1
rpmlib(PayloadIsLzma)
$

I believe there are reasons for a minimal ghc9.6 and it's ok, but I think that the difference between ghc9.6 and ghc might be misleading, it leads to thinking that ghc9.6 is also enough, but it's not enough, for example, for compiling simple programs (needing Prelude):

$ hsh-run --mount=/proc,/dev/pts --workdir ~/hasher/ -- sh -c 'cd && cat >hello.hs && ghc hello.hs && ./hello' <<<'main = putStrLn "hello"'; echo $?
[1 of 2] Compiling Main             ( hello.hs, hello.o )

hello.hs:1:1: error:
    Could not find module `Prelude'
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
1 | main = putStrLn "hello"
  | ^
1

After installing ghc9.6-devel it compiles, and ghci works.

And in a clean hasher, installing just only ghc9.6-devel makes it compile common programs like hello.hs and makes ghci work.

So, just ghc9.6-devel is the right package to install (for compiling common programs and ghci). Or ghc-devel.


But this wasn't quite clear. I don't know what to suggest. Maybe nothing can be improved here.
Comment 9 Ivan Zakharyaschev 2026-02-14 00:27:02 MSK
Another thing I've just noticed: There is no practical difference between ghc-devel and ghc:

First, I install ghc-devel. Then installing ghc adds no packages at all. Having two packages doesn't make sense from this point of view.

hsh --ini ~/hasher && hsh-install --workdir ~/hasher/ ghc-devel
hsh-install ~/hasher/ ghc
Comment 10 Leonid Znamenok 2026-02-14 00:44:29 MSK
Most likely, things can indeed be simplified here by removing ghc(9.6)-devel altogether.
GHC requires all ghc-*-devel packages to function properly anyway. So having two separate entities looks redundant and really misleading.

I’ll take a look at what can be done here.

Thanks for the contribution!