This repository has been archived by the owner. It is now read-only.

Elm 0.18 violates W^X both during build and with the `elm` executable #179

Closed
mulander opened this Issue Nov 14, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@mulander

mulander commented Nov 14, 2016

Hi,

I was successfully using Elm 0.17 on OpenBSD -current. The only issue was elm-repl violating W^X but the rest of the language worked fine.

Version 0.18 on the other hand fails to build with W^X violations during build and the elm binary (the only one produced from the build) violating it also.

W^X violation from dmesg:

dist/dist-sandbox-6f57610c/build/System/Clock_hsc_make(89932): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Digest/CRC32_hsc_make(64777): W^X binary outside wxallowed mountpoint
/tmp/cabal-tmp-35565/entropy-0.3.7/dist/dist-sandbox-6f57610c/setup/setup(62741): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Memory/MemMap/Posix_hsc_make(45451): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Network/BSD_hsc_make(57693): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/PosixCompat/Extensions_hsc_make(3928): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Codec/Compression/Zlib/Stream_hsc_make(79448): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/Time_hsc_make(24385): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Text/Regex/Posix/Wrap_hsc_make(23212): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Digest/CRC32_hsc_make(66096): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Memory/MemMap/Posix_hsc_make(16844): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Codec/Compression/Zlib/Stream_hsc_make(25961): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/Time_hsc_make(82113): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Network/BSD_hsc_make(9198): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/Clock_hsc_make(59571): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Digest/CRC32_hsc_make(65182): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Data/Memory/MemMap/Posix_hsc_make(40138): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/Time_hsc_make(45768): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Network/BSD_hsc_make(85664): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/System/PosixCompat/Extensions_hsc_make(21187): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Text/Regex/Posix/Wrap_hsc_make(14934): W^X binary outside wxallowed mountpoint
dist/dist-sandbox-6f57610c/build/Codec/Compression/Zlib/Stream_hsc_make(74638): W^X binary outside wxallowed mountpoint
/tmp/cabal-tmp-38572/entropy-0.3.7/dist/dist-sandbox-6f57610c/setup/setup(78537): W^X binary outside wxallowed mountpoint
/home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/bin//elm(5810): W^X binary outside wxallowed mountpoint
/home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/bin//elm(94966): W^X binary outside wxallowed mountpoint

Sample build errors:

Failed to install unix-compat-0.4.2.0                                                                                                  
Build log ( /home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/logs/unix-compat-0.4.2.0.log ):                                    
Configuring unix-compat-0.4.2.0...                                                                                                     
Building unix-compat-0.4.2.0...                                                                                                        
Preprocessing library unix-compat-0.4.2.0...                                                                                           
hsc2hs: dist/dist-sandbox-6f57610c/build/System/PosixCompat/Extensions_hsc_make: runProcess: runInteractiveProcess: exec: permission de
nied (Permission denied)                                                                                                               
Failed to install regex-posix-0.95.2                                                                                                   
Build log ( /home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/logs/regex-posix-0.95.2.log ):                                     
Configuring regex-posix-0.95.2...                                                                                                      
Building regex-posix-0.95.2...                                                                                                         
Preprocessing library regex-posix-0.95.2...                                                                                            
hsc2hs: dist/dist-sandbox-6f57610c/build/Text/Regex/Posix/Wrap_hsc_make: runProcess: runInteractiveProcess: exec: permission denied (Pe
rmission denied)                                                                                                                       
Building zlib-0.6.1.2...                                                                                                               
Failed to install zlib-0.6.1.2                                                                                                         
Build log ( /home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/logs/zlib-0.6.1.2.log ):                                           
Configuring zlib-0.6.1.2...                                                                                                            
Building zlib-0.6.1.2...                                                                                                               
Preprocessing library zlib-0.6.1.2...                                                                                                  
hsc2hs: dist/dist-sandbox-6f57610c/build/Codec/Compression/Zlib/Stream_hsc_make: runProcess: runInteractiveProcess: exec: permission de
nied (Permission denied)
Installed elm-compiler-0.18
Failed to install entropy-0.3.7
Build log ( /home/mulander/lab/elm/Elm-Platform/0.18/.cabal-sandbox/logs/entropy-0.3.7.log ):
[1 of 1] Compiling Main             ( /tmp/cabal-tmp-38572/entropy-0.3.7/dist/dist-sandbox-6f57610c/setup/setup.hs, /tmp/cabal-tmp-3857
2/entropy-0.3.7/dist/dist-sandbox-6f57610c/setup/Main.o )
Linking /tmp/cabal-tmp-38572/entropy-0.3.7/dist/dist-sandbox-6f57610c/setup/setup ...
cabal: user error (Error: some packages failed to install:
HTTP-4000.2.23 depends on network-2.6.3.1 which failed to install.
asn1-encoding-0.9.4 depends on memory-0.13 which failed to install.
asn1-parse-0.9.4 depends on memory-0.13 which failed to install.
asn1-types-0.3.2 depends on memory-0.13 which failed to install.
clock-0.7.2 failed during the building phase. The exception was:
ExitFailure 1
@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Nov 14, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Nov 14, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@knowmercy

This comment has been minimized.

Show comment
Hide comment
@knowmercy

knowmercy Nov 14, 2016

This is behaving the same way for me. This is an amd64 box running a snapshot from a couple days ago. I've the following installed:
ghc-7.10.3p7
cabal-install-1.22.6.0

knowmercy commented Nov 14, 2016

This is behaving the same way for me. This is an amd64 box running a snapshot from a couple days ago. I've the following installed:
ghc-7.10.3p7
cabal-install-1.22.6.0

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Nov 14, 2016

Contributor

This sounds like a Haskell thing, not an Elm thing. I have no idea how writing programs in Haskell could break this rule.

It'd be helpful to know (1) which version of GHC and (2) what dependencies it thinks it is using. If any of them are weird, that's probably the problem. I'd also look around the Haskell ecosystem in general to see if anyone is getting this. Maybe there's something in unix-compat that is off.

Contributor

evancz commented Nov 14, 2016

This sounds like a Haskell thing, not an Elm thing. I have no idea how writing programs in Haskell could break this rule.

It'd be helpful to know (1) which version of GHC and (2) what dependencies it thinks it is using. If any of them are weird, that's probably the problem. I'd also look around the Haskell ecosystem in general to see if anyone is getting this. Maybe there's something in unix-compat that is off.

@mulander

This comment has been minimized.

Show comment
Hide comment
@mulander

mulander Nov 14, 2016

Hi @evancz I'm going to redo a clean 0.17. build of elm on this machine to compare. Will grab both build logs and will add them as soon as both finish for comparison.

We are aware that haskell often introduced W^X violations and we try to handle them in OpenBSD ports but the way Elm is built makes it very hard to properly package hence I'm raising awarness that some recent change violated an out of ports build.

mulander commented Nov 14, 2016

Hi @evancz I'm going to redo a clean 0.17. build of elm on this machine to compare. Will grab both build logs and will add them as soon as both finish for comparison.

We are aware that haskell often introduced W^X violations and we try to handle them in OpenBSD ports but the way Elm is built makes it very hard to properly package hence I'm raising awarness that some recent change violated an out of ports build.

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Nov 14, 2016

Contributor

I am not sure build logs will help me give guidance here. The two things I asked about will help me more. For example, Elm builds with GHC 7.10, but not later versions. That may be the problem.

Here is a cabal.config that comes from running cabal freeze on my elm-compiler. It lists the exact dependencies I used to successfully build elm-compiler on my machine. Perhaps you are trying to build with newer things.

Contributor

evancz commented Nov 14, 2016

I am not sure build logs will help me give guidance here. The two things I asked about will help me more. For example, Elm builds with GHC 7.10, but not later versions. That may be the problem.

Here is a cabal.config that comes from running cabal freeze on my elm-compiler. It lists the exact dependencies I used to successfully build elm-compiler on my machine. Perhaps you are trying to build with newer things.

@mulander

This comment has been minimized.

Show comment
Hide comment
@mulander

mulander Nov 14, 2016

The version I'm building with is:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library

I just retried building 0.17 moving my previous build aside. It is now failing to build same way as v0.18 so it must have been a change in the minor ghc bump from 7.10.2 which I used previously for elm 0.17.

I guess you can't do much about that, I incorrectly assumed that perhaps a new dependency/change in v0.18 made the W^X violations worse for Elm but alas it appears no.

I'm closing this issue down, don't think you can do much about it on Elm's side.

mulander commented Nov 14, 2016

The version I'm building with is:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library

I just retried building 0.17 moving my previous build aside. It is now failing to build same way as v0.18 so it must have been a change in the minor ghc bump from 7.10.2 which I used previously for elm 0.17.

I guess you can't do much about that, I incorrectly assumed that perhaps a new dependency/change in v0.18 made the W^X violations worse for Elm but alas it appears no.

I'm closing this issue down, don't think you can do much about it on Elm's side.

@mulander mulander closed this Nov 14, 2016

@blackgnezdo

This comment has been minimized.

Show comment
Hide comment
@blackgnezdo

blackgnezdo Apr 16, 2017

A workaround is to point TMPDIR environment variable at some temporary directory on a filesystem with wxallowed prior to running cabal build. I tested this on OpenBSD 6.1 amd64.

blackgnezdo commented Apr 16, 2017

A workaround is to point TMPDIR environment variable at some temporary directory on a filesystem with wxallowed prior to running cabal build. I tested this on OpenBSD 6.1 amd64.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.