Building executable 'elm' for elm-0.19 fails on OpenBSD 6.3 (ghc-8.2.2)

Hi folks, could you please help?

Building elm-0.19 on OpenBSD 6.3 -stable with ghc-8.2.2p1 and cabal-install-2.0.0.1.

$ uname -srv
OpenBSD 6.3 GENERIC.MP#8
$ cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.0 of the Cabal library 
$ ghc --version             
The Glorious Glasgow Haskell Compilation System, version 8.2.2

Due to W^X restrictions, .cabal and elm/compiler moved to /usr/local (mounted with wxallowed).

$ doas pkg_add ghc cabal-install
$ doas mkdir -p /usr/local/{cabal,cabal/build}
$ doas chown -R $(whoami):wheel /usr/local/cabal
$ rm -rf ~/.cabal
$ ln -s /usr/local/cabal ~/.cabal
$ alias cabal='env TMPDIR=/usr/local/cabal/build/ cabal'
$ cabal update
$ cd /usr/local/
$ git clone https://github.com/elm/compiler elm
$ cd elm

When building Elm, the core dump dropped and cabal exits.

$ cabal install
Resolving dependencies...
Configuring elm-0.19.0...
Building elm-0.19.0...
Failed to install elm-0.19.0
Build log ( /home/user/.cabal/logs/ghc-8.2.2/elm-0.19.0-6zRUDcfBIu51Yvs2whdnMK.log ):
cabal: Entering directory '.'
Configuring elm-0.19.0...
Preprocessing executable 'elm' for elm-0.19.0..
Building executable 'elm' for elm-0.19.0..
[161 of 167] Compiling Develop.StaticFiles ( ui/terminal/src/Develop/StaticFiles.hs, dist/build/elm/elm-tmp/Develop/StaticFiles.o )
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
elm-0.19.0-6zRUDcfBIu51Yvs2whdnMK failed during the building phase. The
exception was:
ExitFailure (-10)
$

Package in question is Develop.StaticFiles.

What’s wrong with it?

P.S. How to install OpenBSD in VM.
Or ping me with your SSH public key I’ll provide access to OpenBSD instance.

P.S.S. I’ve tried to cabal install other software (e.g. cabal install pandoc), it builds successfully.

Do you have an older version of Elm binary in the path when building above? The StaticFiles shell out to the elm compiler to build the static assets for the reactor/debugger.

No, I’m building elm-0.19 on a fresh OpenBSD instance.

Do I need to build elm-0.18 first?

No. Just checking because I got caught by that once.

First, like I said elsewhere, I think you’ll get the best help on —> SLACK <— specifically the #compilers channel.

The file that is failing uses Template Haskell to run the Elm compiler on some files needed to display the reactor. Maybe there is something about your OS that makes that against the rules without a clear error message. It needs to download packages into ~/.elm to build those files, so maybe it’s something about that. You can set ELM_HOME to something else to have it use a different directory.

Got it, thank you. Let me check.

I’ve posted on Slack in #compiler and then in #general, but no luck so far.
https://elmlang.slack.com/archives/C0VHPC4F3/p1534874739000100

Directories have been created, but nothing is downloaded.

$ find .elm
.elm/
.elm/0.19.0
.elm/0.19.0/package

Tried different location ELM_HOME — same results.
What packages should be downloaded? From where?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.