# Building Xmonad appers to trigger a LLVM rebuild



## SporkVillain (Aug 31, 2016)

Hello all! 

Relatively new to running BSD as a *desktop* operating system, and I've been trying to get xorg going with xmonad as my window manager. Going off of the (dated looking) instructions on their wiki I am building xmonad like so:

https://wiki.haskell.org/Xmonad/Installing_xmonad#FreeBSD

```
# cd /usr/ports/x11-wm/hs-xmonad
# sudo make install distclean
```
However this appears to trigger a massive build, and based on the output it appears to be attempting to build llvm from scratch (why?.) Shouldn't xmonad be a relatively small build? Shouldn't it be using my system clang? 

During prompts I always tell it to use the clang from base. 

Should I let this thing go crazy building stuff or am failing to configure something in the build?


----------



## kpa (Aug 31, 2016)

I'm pretty sure it's because some parts of the newer Xorg do require the LLVM ports as well depending on the version of FreeBSD used. On FreeBSD 10.X at least the system compiler and the included LLVM subsystem are not new enough to satisfy the requirements to build Xorg. The situation might be different on FreeBSD 11, I haven't tested yet myself.


----------



## SporkVillain (Aug 31, 2016)

Ah well that makes sense! However, shouldn't that affect all of xorg? I'm able to startx with the standard WM with no troubles. I was trying to just build the WM as opposed to all of xorg. Does building xmonad trigger an entire xorg rebuild? Nothing I'm seeing in the makefile in that directory seems to suggest that.


----------



## kpa (Aug 31, 2016)

There are quite a few Xorg related ports in the all-depends-list of x11-wm/hs-xmonad:


```
...
/usr/ports/x11/libX11
/usr/ports/x11/bigreqsproto
/usr/ports/devel/xorg-macros
/usr/ports/x11/xcmiscproto
/usr/ports/x11/xextproto
/usr/ports/x11/xtrans
/usr/ports/x11/kbproto
/usr/ports/x11/inputproto
/usr/ports/x11-fonts/xf86bigfontproto
/usr/ports/x11/libXau
/usr/ports/x11/xproto
/usr/ports/x11/libXdmcp
/usr/ports/x11/libxcb
/usr/ports/devel/libcheck
/usr/ports/x11/xcb-proto
...
```

Even though the full Xorg isn't being built those ports will trigger the builds of the required Clang/LLVM ports.


----------



## Snurg (Aug 31, 2016)

kpa said:


> The situation might be different on FreeBSD 11, I haven't tested yet myself.


Just FYI, it's probably the same situation on 11-RC1. I was wondering why when I let the PC build Firefox (or was it something else?) the first time the PC first began to (re?)build the compiler. I didn't bother, was busy with other things while building anyway. However, it's nice to know why that happened  Thank you!


----------



## SporkVillain (Sep 1, 2016)

Yeah for the record I'm running Current, so it appears to be case on 12.


----------



## SporkVillain (Sep 1, 2016)

Oh and it appears something else is broken:
Likely a build option I screwed up, but this seems like a Haskel error as opposed to a MAKE error:

Could not find module graphics.X11.xlib
Perhaps you haven't installed the profiling libraries for package 'x11-1.6.1.2'
use -v to see a list of the files searched for. 

So a little stumped as to what's missing. Bad GHCI install? I tried distclean then another make on xmonad, and it keeps giving the same error. 

Ideas?


----------



## Atsuri (Sep 1, 2016)

Sometimes the make process simply throws an error when it cannot find the required libraries instead of pulling them together with their mother source package. For me the shortest route is to install the missing package through `pkg install`. Of course, then you lose the ability to configure that dependency.

Nevertheless, I would try that first as it's quick and easily reversible .


----------



## SporkVillain (Sep 1, 2016)

Atsuri:
Maybe I don't understand how BSD handles Haskel dependencies (It appears there is no port for cabal...) but from my interpretation of the error message that's a Haskel dependency of some sort. I don't think there's a port for that, but maybe I'm wrong. 

Suggestions in terms of a command for resolving it?


----------



## xavi (Sep 2, 2016)

Have you tried using pkg to try and get past the dependency problem?

`pkg install hs-xmonad`

Or is there a particular reason that you're compiling from source?

Funnily enough I work in the same building (different floor, different team) as the author of Xmonad (Don Stewart). I've never met him but happy to drop him a line to see if he has any thoughts on your issue. However, he's a busy guy from what I can tell, so you may not get an immediate response.


----------



## SporkVillain (Sep 2, 2016)

I'll give that a quick shot as soon as I'm back in front of the machine. If pkg install hs-xmonad works, the xmonad wiki should include that as an option.


----------



## kpa (Sep 2, 2016)

SporkVillain said:


> I'll give that a quick shot as soon as I'm back in front of the machine. If pkg install hs-xmonad works, the xmonad wiki should include that as an option.



No, the proper way to verify if the dependency is working or not is to build the port in a package builder such as ports-mgmt/poudriere or ports-mgmt/synth. If it builds under both of those but fails when built on a live system the problem is likely in a the local configuration of the specific system and the port is fine and does not need fixing or any hackery with pkg-install(8).


----------



## SporkVillain (Sep 2, 2016)

kpa: I wasn't aware of that debugging procedure. I guess I should go learn poudriere now.


----------



## marino (Sep 2, 2016)

SporkVillain said:


> kpa: I wasn't aware of that debugging procedure. I guess I should go learn poudriere now.



assuming you have stock installation locations, you could do this with a single command with synth: `synth test x11-wm/hs-xmonad`
No learning necessary.


----------

