You are not logged in.

#1 2023-11-04 09:49:27

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

[SOLVED] Can't start xmonad

I installed xmonad via

sudo pacman -S xmonad

and creating an ~/.xmonad/xmonad.hs file with this content

import XMonad

main = xmonad def
    { terminal    = "urxvt"
    , modMask     = mod4Mask
    , borderWidth = 3
    }

but trying to start it from a console via either of

$ xmonad
$ xmonad --recompile

gives this error

XMonad will use ghc to recompile, because neither "/home/enrico/.xmonad/build" nor "/home/enrico/.xmonad/stack.yaml" exists.
XMonad recompiling (forced).
Errors detected while compiling xmonad config: /home/enrico/.xmonad/xmonad.hs
$ ghc --make xmonad.hs -i -ilib -fforce-recomp -main-is main -dynamic -v0 -outputdir /home/enrico/.xmonad/build-x86_64-linux -o /home/enrico/.xmonad/xmonad-x86_64-linux

xmonad.hs:1:1: error:
    Could not find module ‘XMonad’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
1 | import XMonad
  | ^^^^^^^^^^^^^

Please check the file for errors.

xmonad: xmessage: executeFile: does not exist (No such file or directory)

Looking on the web and on this forum, I have the feeling that something is wrong because

ghc-pkg list | grep xmo

results in no match, and that I could probably fix that by

cabal install --lib xmonad

but before even trying htat, I'm wondering why am installing xmonad both via pacman and via cabal? After all, the doc page doesn't even mention cabal.

Last edited by Enrico1989 (2023-11-04 21:25:23)

Offline

#2 2023-11-04 15:34:56

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

https://bbs.archlinux.org/viewtopic.php … 5#p1744785
Make sure to not have run partial updates at any point  - haskell is hyper-fragile.

Offline

#3 2023-11-04 16:24:29

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

Executing

ghc-pkg recache

with and without sudo and then trying again

xmonad --recompile

ends up with the same error.

After all,

ghc-pkg listi

still gives no xmonad match:

ghc-pkg list
/home/enrico/.ghcup/ghc/9.4.7/lib/ghc-9.4.7/lib/package.conf.d
    Cabal-3.8.1.0
    Cabal-syntax-3.8.1.0
    array-0.5.4.0
    base-4.17.2.0
    binary-0.8.9.1
    bytestring-0.11.5.2
    containers-0.6.7
    deepseq-1.4.8.0
    directory-1.3.7.1
    exceptions-0.10.5
    filepath-1.4.2.2
    ghc-9.4.7
    ghc-bignum-1.3
    ghc-boot-9.4.7
    ghc-boot-th-9.4.7
    ghc-compact-0.1.0.0
    ghc-heap-9.4.7
    ghc-prim-0.9.1
    ghci-9.4.7
    haskeline-0.8.2
    hpc-0.6.1.0
    integer-gmp-1.1
    libiserv-9.4.7
    mtl-2.2.2
    parsec-3.1.16.1
    pretty-1.1.3.6
    process-1.6.17.0
    rts-1.0.2
    stm-2.5.1.0
    system-cxx-std-lib-1.0
    template-haskell-2.19.0.0
    terminfo-0.4.1.5
    text-2.0.2
    time-1.12.2
    transformers-0.5.6.2
    unix-2.7.3
    xhtml-3000.2.2.1

On the other hand, it's not clear how the asker originally installed xmonad. Maybe they did use cabal/stack as suggested in xmonad installation guide?

Last edited by Enrico1989 (2023-11-04 16:27:26)

Offline

#4 2023-11-04 16:29:46

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

Seth wrote:

Make sure to not have run partial updates at any point

Not sure... I've used ghcup tui to update GHC, cabal, and HLS to the most recent recommended versions, this morning.

Offline

#5 2023-11-04 17:06:09

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

pacman -Qs 'haskell|ghc|monad'

Offline

#6 2023-11-04 17:20:36

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

local/ghc 9.0.2-3
    The Glasgow Haskell Compiler
local/ghc-libs 9.0.2-3
    The Glasgow Haskell Compiler - Dynamic Libraries
local/haskell-aeson 2.1.2.1-16
    A JSON parsing and encoding library optimized for ease of use and high performance
local/haskell-ansi-terminal 0.11.4-36
    Simple ANSI terminal support, with Windows compatibility
local/haskell-ansi-wl-pprint 0.6.9-388
    The Wadler/Leijen Pretty Printer for colored ANSI terminal output
local/haskell-assoc 1.0.2-204
    swap and assoc: Symmetric and Semigroupy Bifunctors
local/haskell-attoparsec 0.14.4-59
    Fast combinator parsing for bytestrings and text
local/haskell-base-compat 0.12.2-1
    A compatibility layer for base
local/haskell-base-compat-batteries 0.12.2-55
    base-compat with extra batteries
local/haskell-base-orphans 0.8.7-64
    Backwards-compatible orphan instances for base
local/haskell-bifunctors 5.6-15
    Bifunctors
local/haskell-bitvec 1.1.3.0-63
    Space-efficient bit vectors
local/haskell-clock 0.8.3-104
    High-resolution clock functions: monotonic, realtime, cputime.
local/haskell-cmdargs 0.10.22-1
    Command line argument processing
local/haskell-colour 2.3.6-180
    A model for human colour/color perception
local/haskell-comonad 5.0.8-199
    Comonads
local/haskell-conduit 1.3.5-16
    Streaming data processing library.
local/haskell-contravariant 1.5.5-3
    Contravariant functors
local/haskell-cpphs 1.20.9.1-12
    A liberalised re-implementation of cpp, the C pre-processor.
local/haskell-data-array-byte 0.1.0.1-25
    Compatibility layer for Data.Array.Byte
local/haskell-data-default 0.7.1.1-285
    A class for types with a default value
local/haskell-data-default-class 0.1.2.0-24
    A class for types with a default value
local/haskell-data-default-instances-containers 0.0.1-36
    Default instances for types in containers
local/haskell-data-default-instances-dlist 0.0.1-298
    Default instances for types in dlist
local/haskell-data-default-instances-old-locale 0.0.1-36
    Default instances for types in old-locale
local/haskell-data-fix 0.3.2-87
    Fixpoint data types
local/haskell-diff 0.4.1-60
    O(ND) diff algorithm in haskell
local/haskell-distributive 0.6.2.1-194
    Distributive functors -- Dual to Traversable
local/haskell-dlist 1.0-220
    Differences lists
local/haskell-erf 2.0.0.0-24
    The error function, erf, and related functions.
local/haskell-extra 1.7.14-7
    Extra functions I use.
local/haskell-fgl 5.8.1.1-11
    Martin Erwig's Functional Graph Library
local/haskell-file-embed 0.0.15.0-1
    Use Template Haskell to embed file contents directly.
local/haskell-filepattern 0.1.3-60
    File path glob-like matching
local/haskell-foldable1-classes-compat 0.1-15
    Compatibility package for the Foldable1 and Bifoldable1 type classes
local/haskell-generically 0.1.1-1
    Generically newtype to use with DerivingVia
local/haskell-ghc-bignum-orphans 0.1.1-1
    Backwards-compatible orphan instances for ghc-bignum
local/haskell-ghc-lib-parser-ex 9.0.0.6-56
    Algorithms on GHC parse trees
local/haskell-hashable 1.4.3.0-4
    A class for types that can be converted to a hash value
local/haskell-hscolour 1.24.4-23
    Colourise Haskell code.
local/haskell-indexed-traversable 0.1.3-7
    FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
local/haskell-indexed-traversable-instances 0.1.1.2-13
    More instances of FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
local/haskell-integer-logarithms 1.0.3.1-6
    Integer logarithms
local/haskell-libyaml 0.1.2-313
    Low-level, streaming YAML interface.
local/haskell-mono-traversable 1.0.15.3-141
    Type classes for mapping, folding, and traversing monomorphic containers
local/haskell-old-locale 1.0.0.7-30
    This package provides the ability to adapt to locale conventions such as date and time formats.
local/haskell-onetuple 0.3.1-60
    Singleton Tuple
local/haskell-optparse-applicative 0.17.0.0-59
    Utilities and combinators for parsing command line options
local/haskell-polyparse 1.13-11
    A variety of alternative parser combinator libraries.
local/haskell-primitive 0.7.4.0-81
    Wrappers for primitive operations
local/haskell-quickcheck 2.14.3-22
    Automatic testing of Haskell programs
local/haskell-random 1.2.1.1-123
    Pseudo-random number generation
local/haskell-refact 0.3.0.2-25
    Specify refactorings to perform with apply-refact
local/haskell-regex-base 0.94.0.2-2
    Common "Text.Regex.*" API for Regex matching
local/haskell-regex-tdfa 1.3.2.2-13
    Pure Haskell Tagged DFA Backend for Text.Regex (regex-base)
local/haskell-resourcet 1.2.6-36
    Deterministic allocation and freeing of scarce resources.
local/haskell-scientific 0.3.7.0-98
    Numbers represented using scientific notation
local/haskell-semialign 1.2.0.1-129
    Align and Zip type-classes from the common Semialign ancestor.
local/haskell-semigroupoids 5.3.7-111
    Semigroupoids: Category sans id
local/haskell-setlocale 1.0.0.10-4
    Haskell bindings to setlocale
local/haskell-split 0.2.4-1
    Combinator library for splitting lists.
local/haskell-splitmix 0.1.0.4-146
    Fast Splittable PRNG
local/haskell-statevar 1.2.2-2
    State variables
local/haskell-strict 0.4.0.1-178
    Strict data types and String IO
local/haskell-syb 0.7.2.3-13
    library for generic programming in Haskell
local/haskell-tagged 0.8.8-1
    Haskell 98 phantom types to avoid unsafely passing dummy arguments
local/haskell-text-short 0.1.5-64
    Memory-efficient representation of Unicode text strings
local/haskell-th-abstraction 0.4.5.0-1
    Nicer interface for reified information about data types
local/haskell-these 1.1.1.1-205
    An either-or-both data type
local/haskell-time-compat 1.9.6.1-82
    Compatibility package for time
local/haskell-transformers-compat 0.7.2-1
    A small compatibility shim exposing the new types from transformers 0.3 to older Haskell platforms.
local/haskell-uniplate 1.6.13-194
    Help writing simple, concise and fast generic operations.
local/haskell-unliftio-core 0.2.1.0-1
    The MonadUnliftIO typeclass for unlifting monads to IO
local/haskell-unordered-containers 0.2.19.1-77
    Efficient hashing-based container types
local/haskell-utf8-string 1.0.2-135
    Support for reading and writing UTF8 Strings
local/haskell-uuid-types 1.0.5.1-1
    Type definitions for Universally Unique Identifiers
local/haskell-vector 0.13.0.0-57
    Efficient Arrays
local/haskell-vector-algorithms 0.9.0.1-63
    Efficient algorithms for vector arrays
local/haskell-vector-stream 0.1.0.0-1
    Efficient Streams
local/haskell-witherable 0.4.2-70
    filterable traversable
local/haskell-x11 1.10.3-1
    A Haskell binding to the X11 graphics library.
local/haskell-x11-xft 0.3.4-53
    Bindings to the Xft and some Xrender parts
local/haskell-yaml 0.11.11.2-11
    Support for parsing and rendering YAML documents.
local/xmonad 0.17.1-108
    Lightweight X11 tiled window manager written in Haskell
local/xmonad-contrib 0.17.1-107
    Community-maintained extensions for xmonad

Offline

#7 2023-11-04 17:26:59

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

Looks unsuspicious hmm

type ghc
ghc -v --make xmonad.hs -i -ilib -fforce-recomp -main-is main -dynamic -v0 -outputdir /home/enrico/.xmonad/build-x86_64-linux -o /home/enrico/.xmonad/xmonad-x86_64-linux
/usr/bin/ghc -v --make xmonad.hs -i -ilib -fforce-recomp -main-is main -dynamic -v0 -outputdir /home/enrico/.xmonad/build-x86_64-linux -o /home/enrico/.xmonad/xmonad-x86_64-linux

Offline

#8 2023-11-04 18:28:03

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

ghc is /home/enrico/.ghcup/bin/ghc

I assume in the second and third commands you meant ~/.xmonad/xmonad.hs as the argument to --make, in which case

.xmonad/xmonad.hs:1:1: error:
    Could not find module ‘XMonad’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
1 | import XMonad
  | ^^^^^^^^^^^^
/home/enrico/.xmonad/xmonad.hs:1:1: error:
    Could not load module ‘XMonad’
    It is a member of the package ‘xmonad-0.17.1-7C7rksgF40U1Mk5fl5ob4K’
    which is unusable due to missing dependencies:
      X11-1.10.3-7zBAfsIL85sJKAyVO3fFRL data-default-class-0.1.2.0-IxhEAzgy8931aXcEiJcyZO
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
  |
1 | import XMonad
  | ^^^^^^^^^^^^^

Offline

#9 2023-11-04 18:35:41

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

The custom ghc in your $HOME is your problem.

Offline

#10 2023-11-04 18:42:11

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

I don't think I've intentionally done anything for it to be there. Probably that's where the executable is put when managing Haskell installation via ghcup, I guess.

Why is that my problem? What is wrong with the executable being there? Where should it be (I assume it would be there if I had set up my Haskell env via pacman -S ghc instead of via ghcup)?

Offline

#11 2023-11-04 18:43:19

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

I guess the bottom line is "if you install GHC via pacman, install xmonad via pacman, whereas if you install GHC via ghcup, install xmonad via cabal/stack"?

Offline

#12 2023-11-04 20:39:12

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

The problem is that the local ghc installation doesn't know about the xmonad modules - why would you have *additionally* installed ghc via ghcup?

If you want to keep it for special occasions, make sure that /home/enrico/.ghcup/bin is only in your $PATH for that purposes - not generally.
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#13 2023-11-04 20:48:16

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

seth wrote:

why would you have *additionally* installed ghc via ghcup?

What do you mean?

That I have done that and I shouldn't have?

Last edited by Enrico1989 (2023-11-04 20:48:47)

Offline

#14 2023-11-04 20:52:10

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

You've ghc installed via pacman, why do you (think you) require an additional ghc version?

Offline

#15 2023-11-04 20:58:30

Enrico1989
Member
Registered: 2018-07-05
Posts: 201

Re: [SOLVED] Can't start xmonad

I remember the reason I installed ghc via ghcup is that the latter lists many version telling which one is hls-powered, which is kind of necessary for haskell development (command completions, diags, ..).

Why I also have the ghc installed via pacman... well that's probably a remnant of before I installed ghcup.

Can I do without the pacman-installed ghc and just use the one installed via ghcup?

Is this the answer?

Enrico1989 wrote:

I guess the bottom line is "if you install GHC via pacman, install xmonad via pacman, whereas if you install GHC via ghcup, install xmonad via cabal/stack"?

Last edited by Enrico1989 (2023-11-04 20:58:54)

Offline

#16 2023-11-04 21:04:11

seth
Member
Registered: 2012-09-03
Posts: 51,879

Re: [SOLVED] Can't start xmonad

Given the API instability of haskell: probably no if you want to use the repo version of xmonad - you'd have to install that using, I assume, ghcup as well - whether you can use cabal/stack, idk.

Offline

Board footer

Powered by FluxBB