Installation failure under WSL
@JKTKops reports that his attempts to build GHC under WSL (presumably 2, although we don't know) (Ubuntu 18.03 LTS) fail at make install
with:
Installing library in /usr/local/lib/ghc-8.11.0.20200121/ghc-8.11.0.20200121
ghc-pkg: Couldn't open database /usr/local/lib/ghc-8.11.0.20200121/package.conf.d for modification: {handle: /usr/local/lib/ghc-8.11.0.20200121/package.conf.d/package.cache.lock}: hLock: invalid argument (Invalid argument)
strace -f
reports the following:
...
9706 openat(AT_FDCWD, "/usr/local/lib/ghc-8.11.0.20200121/package.conf.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
9706 fstat(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
9706 getdents(3, /* 2 entries */, 32768) = 48
9706 getdents(3, /* 0 entries */, 32768) = 0
9706 close(3) = 0
9706 stat("/usr/local/lib/ghc-8.11.0.20200121/package.conf.d/package.cache", 0x420002ee50) = -1 ENOENT (No such file or directory)
9706 openat(AT_FDCWD, "/usr/local/lib/ghc-8.11.0.20200121/package.conf.d/package.cache.lock", O_RDWR|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
9706 fstat(3, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
9706 ioctl(3, TCGETS, 0x7fffc92d21b0) = -1 ENOTTY (Inappropriate ioctl for device)
9706 fcntl(3, F_OFD_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = -1 EINVAL (Invalid argument)
9706 close(3) = 0
9706 --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} ---
9706 rt_sigreturn({mask=[]})