commercialhaskell / commercialhaskell/stack

“Unable to load package `regex-posix` … unknown symbol ‘regerror’”

Open
#5,404 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

(Cross-posted from [Stack Overflow](https://stackoverflow.com/questions/64021952/unable-to-load-package-regex-posix-unknown-symbol-regerror?noredirect=1#comment113282059_64021952) on the advice of @sjakobi.)

### General summary/comments (optional)

For a new project, I have been trying to build the `threepenny-gui` package, something which I have done many times in the past without any trouble. This time however, I ran into an unusual error message:

```
> stack build
threepenny-gui > configure
threepenny-gui > Configuring threepenny-gui-0.9.0.0...
threepenny-gui > build
threepenny-gui > Preprocessing library for threepenny-gui-0.9.0.0..
threepenny-gui > Building library for threepenny-gui-0.9.0.0..
threepenny-gui > [ 1 of 29] Compiling Foreign.JavaScript.Include
threepenny-gui > [ 2 of 29] Compiling Foreign.JavaScript.Resources
threepenny-gui > ghc.exe: unable to load package `regex-posix-0.96.0.0'
threepenny-gui > ghc.exe: | C:\sr\snapshots\14724cfd\lib\x86_64-windows-ghc-8.8.4\regex-posix-0.96.0.0-11M5Q2Uki3ACYikP2WXOuq\HSregex-posix-0.96.0.0-11M5Q2Uki3ACYikP2WXOuq.o: unknown symbol `regerror'

-- While building package threepenny-gui-0.9.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_3.0.1.0_ghc-8.8.4.exe --builddir=.stack-work\dist\29cc6475 build --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Progress 1/2
```

Now, a quick Google shows that this error message _has_ been seen before — in 2010, after which it was fixed with a GHC update. I tried changing GHC versions (that output above was with GHC 8.8.4), but it didn’t work with 8.8.3 or 8.8.2 either. I also tried deleting `regex-posix`¹ and reinstalling it again, but that didn’t work either. At this point, I must confess that this error has completely stumped me; does anyone else have any idea what might be causing it, and if so, how can I fix it?

¹ Specifically, I removed `C:\sr\snapshots\14724cfd\lib\x86_64-windows-ghc-8.8.4\regex-posix-0.96.0.0-11M5Q2Uki3ACYikP2WXOuq` and `C:\sr\snapshots\14724cfd\pkgdb\regex-posix-0.96.0.0-11M5Q2Uki3ACYikP2WXOuq.conf`, and did `ghc-pkg unregister regex-posix`.

### Steps to reproduce

1. Run `stack build threepenny-gui --resolver lts-16.15`. (Trying to build a project depending on `threepenny-gui` will also trigger this issue.)

### Expected

`threepenny-gui` builds successfully.

### Actual

The error message shown above is printed.

### Stack version

```
$ > stack --version
Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0
```

### Method of installation

Official binary, downloaded from stackage.org or fpcomplete's package repository. (I believe; I don’t remember exactly how I installed it.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.