New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building using tweag/linear-types Docker image: "Unsupported extension: LinearTypes" #301

Closed
runeksvendsen opened this Issue Jan 9, 2019 · 7 comments

Comments

Projects
None yet
3 participants
@runeksvendsen

runeksvendsen commented Jan 9, 2019

I'm using the tweag/linear-types Docker image to play around with linear types using Stack.

In my source file I've added:

frugal :: a  (a,a)
frugal a = (a,a)

If I don't add {-# LANGUAGE LinearTypes #-} to the top of the file, I get the error:

ufw-0.1.0.0: build (lib + exe)
Preprocessing library for ufw-0.1.0.0..
Building library for ufw-0.1.0.0..
[2 of 2] Compiling Data.UFW         ( src/Data/UFW.hs, .stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/build/Data/UFW.o )

/Users/runesvendsen/code/ufw/src/Data/UFW.hs:28:11: error:
    Not in scope: type constructor or class ‘⊸’
   |
28 | frugal :: a ⊸ (a,a)
   |           ^^^^^^^^^

/Users/runesvendsen/code/ufw/src/Data/UFW.hs:28:11: error:
    Illegal operator ‘⊸’ in type ‘a ⊸ (a, a)’
      Use TypeOperators to allow operators in types
   |
28 | frugal :: a ⊸ (a,a)
   |           ^^^^^^^^^


--  While building package ufw-0.1.0.0 using:
      /Users/runesvendsen/.stack/setup-exe-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0 build lib:ufw exe:ufw --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i cbeec4e02f5b6820a7a0d0b144fa9891af20e5908ac3dc618d7ad67f27f96b97

and if I do try to enable LinearTypes I get the error:

ufw-0.1.0.0: build (lib + exe)
Preprocessing library for ufw-0.1.0.0..
Building library for ufw-0.1.0.0..

/Users/runesvendsen/code/ufw/src/Data/UFW.hs:4:14: error: Unsupported extension: LinearTypes
  |
4 | {-# LANGUAGE LinearTypes #-}
  |              ^^^^^^^^^^^


--  While building package ufw-0.1.0.0 using:
      /Users/runesvendsen/.stack/setup-exe-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0 build lib:ufw exe:ufw --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i 83c99fe89174722d95c1386b024d5004bbc1fcccc9065b5932d2d348438dfaa9

This is the repo I'm working with: https://github.com/runeksvendsen/ufw/tree/linear

Here's the output of docker images:

REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
tweag/linear-types   latest              56d06ef65768        3 weeks ago         1.97GB

EDIT: I should probably add that I'm on OSX 10.13.6 (17G4015) using Docker Desktop (2.0.0.0-mac81 (29211) with Docker 18.09.0.

@runeksvendsen

This comment has been minimized.

runeksvendsen commented Jan 9, 2019

Verbose stack build output:

Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-01-09 10:23:57.622085: [debug] Checking for project config at: /Users/runesvendsen/code/ufw/stack.yaml
2019-01-09 10:23:57.622564: [debug] Loading project config file stack.yaml
2019-01-09 10:23:57.624153: [debug] Run process: /usr/local/bin/docker --version
2019-01-09 10:23:57.667229: [debug] Process finished in 43ms: /usr/local/bin/docker --version
2019-01-09 10:23:57.667395: [debug] Run process: /usr/local/bin/docker inspect tweag/linear-types
2019-01-09 10:23:57.718208: [debug] Process finished in 51ms: /usr/local/bin/docker inspect tweag/linear-types
2019-01-09 10:23:57.721196: [debug] Run process within /Users/runesvendsen/code/ufw/: /usr/local/bin/docker create --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/Users/runesvendsen/.stack -e STACK_PLATFORM_VARIANT=dkc68e43cf20ba48282b0ca96c3b2be50e -e HOME=/Users/runesvendsen/code/ufw/.stack-work/docker/_home -e PATH=/opt/host/bin:/Users/runesvendsen/code/ufw/.stack-work/docker/_home/.local/bin:/root/.cabal/bin:/root/.local/bin:/opt/cabal/2.4/bin:/opt/ghc/8.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -e PWD=/Users/runesvendsen/code/ufw -v /Users/runesvendsen:/Users/runesvendsen -v /Users/runesvendsen/.stack:/Users/runesvendsen/.stack -v /Users/runesvendsen/code/ufw:/Users/runesvendsen/code/ufw -v /Users/runesvendsen/code/ufw/.stack-work/docker/_home:/Users/runesvendsen/code/ufw/.stack-work/docker/_home -w /Users/runesvendsen/code/ufw -e USER=runesvendsen -e SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.hKPeKth9c1/Listeners -v /private/tmp/com.apple.launchd.hKPeKth9c1/Listeners:/private/tmp/com.apple.launchd.hKPeKth9c1/Listeners -v /Users/runesvendsen/.stack/programs/x86_64-linux/stack-1.9.3/stack:/opt/host/bin/stack -t -i tweag/linear-types /opt/host/bin/stack --internal-re-exec-version=1.9.3 --internal-docker-entrypoint "DockerEntrypoint {deUser = Just (DockerUser {duUid = 501, duGid = 20, duGroups = [20,501,12,61,79,80,81,98,702,33,100,204,250,395,398,399], duUmask = 18})}" build -v
2019-01-09 10:23:57.918297: [debug] Process finished in 197ms: /usr/local/bin/docker create --net=host -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/Users/runesvendsen/.stack -e STACK_PLATFORM_VARIANT=dkc68e43cf20ba48282b0ca96c3b2be50e -e HOME=/Users/runesvendsen/code/ufw/.stack-work/docker/_home -e PATH=/opt/host/bin:/Users/runesvendsen/code/ufw/.stack-work/docker/_home/.local/bin:/root/.cabal/bin:/root/.local/bin:/opt/cabal/2.4/bin:/opt/ghc/8.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -e PWD=/Users/runesvendsen/code/ufw -v /Users/runesvendsen:/Users/runesvendsen -v /Users/runesvendsen/.stack:/Users/runesvendsen/.stack -v /Users/runesvendsen/code/ufw:/Users/runesvendsen/code/ufw -v /Users/runesvendsen/code/ufw/.stack-work/docker/_home:/Users/runesvendsen/code/ufw/.stack-work/docker/_home -w /Users/runesvendsen/code/ufw -e USER=runesvendsen -e SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.hKPeKth9c1/Listeners -v /private/tmp/com.apple.launchd.hKPeKth9c1/Listeners:/private/tmp/com.apple.launchd.hKPeKth9c1/Listeners -v /Users/runesvendsen/.stack/programs/x86_64-linux/stack-1.9.3/stack:/opt/host/bin/stack -t -i tweag/linear-types /opt/host/bin/stack --internal-re-exec-version=1.9.3 --internal-docker-entrypoint "DockerEntrypoint {deUser = Just (DockerUser {duUid = 501, duGid = 20, duGroups = [20,501,12,61,79,80,81,98,702,33,100,204,250,395,398,399], duUmask = 18})}" build -v
2019-01-09 10:23:57.918550: [debug] Run process: /usr/local/bin/docker start -a -i 0f88b642acf6f02cf1b8555f3b5e0d7a72c557e4c05e480eb4a475b1bdad021d
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-01-09 09:23:58.445298: [debug] Checking for project config at: /Users/runesvendsen/code/ufw/stack.yaml
2019-01-09 09:23:58.448631: [debug] Loading project config file stack.yaml
2019-01-09 09:23:58.460196: [debug] Run process: /usr/sbin/groupadd -o --gid 20 stack
2019-01-09 09:23:58.474160: [debug] Process finished in 14ms: /usr/sbin/groupadd -o --gid 20 stack
2019-01-09 09:23:58.474361: [debug] Run process: /usr/sbin/useradd -oN --uid 501 --gid 20 --home /Users/runesvendsen/code/ufw/.stack-work/docker/_home stack
2019-01-09 09:23:58.492952: [debug] Process finished in 18ms: /usr/sbin/useradd -oN --uid 501 --gid 20 --home /Users/runesvendsen/code/ufw/.stack-work/docker/_home stack
2019-01-09 09:23:58.493103: [debug] Run process: /usr/sbin/groupadd -o --gid 20 group20
2019-01-09 09:23:58.503048: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 20 group20
2019-01-09 09:23:58.503188: [debug] Run process: /usr/sbin/groupadd -o --gid 501 group501
2019-01-09 09:23:58.513079: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 501 group501
2019-01-09 09:23:58.513219: [debug] Run process: /usr/sbin/groupadd -o --gid 12 group12
2019-01-09 09:23:58.523146: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 12 group12
2019-01-09 09:23:58.523342: [debug] Run process: /usr/sbin/groupadd -o --gid 61 group61
2019-01-09 09:23:58.537831: [debug] Process finished in 14ms: /usr/sbin/groupadd -o --gid 61 group61
2019-01-09 09:23:58.538248: [debug] Run process: /usr/sbin/groupadd -o --gid 79 group79
2019-01-09 09:23:58.548633: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 79 group79
2019-01-09 09:23:58.548805: [debug] Run process: /usr/sbin/groupadd -o --gid 80 group80
2019-01-09 09:23:58.558339: [debug] Process finished in 9ms: /usr/sbin/groupadd -o --gid 80 group80
2019-01-09 09:23:58.558727: [debug] Run process: /usr/sbin/groupadd -o --gid 81 group81
2019-01-09 09:23:58.569338: [debug] Process finished in 11ms: /usr/sbin/groupadd -o --gid 81 group81
2019-01-09 09:23:58.569482: [debug] Run process: /usr/sbin/groupadd -o --gid 98 group98
2019-01-09 09:23:58.579950: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 98 group98
2019-01-09 09:23:58.580071: [debug] Run process: /usr/sbin/groupadd -o --gid 702 group702
2019-01-09 09:23:58.590156: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 702 group702
2019-01-09 09:23:58.590279: [debug] Run process: /usr/sbin/groupadd -o --gid 33 group33
2019-01-09 09:23:58.600036: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 33 group33
2019-01-09 09:23:58.600158: [debug] Run process: /usr/sbin/groupadd -o --gid 100 group100
2019-01-09 09:23:58.610901: [debug] Process finished in 11ms: /usr/sbin/groupadd -o --gid 100 group100
2019-01-09 09:23:58.611046: [debug] Run process: /usr/sbin/groupadd -o --gid 204 group204
2019-01-09 09:23:58.622957: [debug] Process finished in 12ms: /usr/sbin/groupadd -o --gid 204 group204
2019-01-09 09:23:58.623093: [debug] Run process: /usr/sbin/groupadd -o --gid 250 group250
2019-01-09 09:23:58.632362: [debug] Process finished in 9ms: /usr/sbin/groupadd -o --gid 250 group250
2019-01-09 09:23:58.632474: [debug] Run process: /usr/sbin/groupadd -o --gid 395 group395
2019-01-09 09:23:58.641191: [debug] Process finished in 9ms: /usr/sbin/groupadd -o --gid 395 group395
2019-01-09 09:23:58.641299: [debug] Run process: /usr/sbin/groupadd -o --gid 398 group398
2019-01-09 09:23:58.651537: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 398 group398
2019-01-09 09:23:58.651657: [debug] Run process: /usr/sbin/groupadd -o --gid 399 group399
2019-01-09 09:23:58.661655: [debug] Process finished in 10ms: /usr/sbin/groupadd -o --gid 399 group399
2019-01-09 09:23:58.664774: [debug] Getting system compiler version
2019-01-09 09:23:58.667695: [debug] Run process: /usr/local/bin/ghc --info
2019-01-09 09:23:58.740474: [debug] Process finished in 73ms: /usr/local/bin/ghc --info
2019-01-09 09:23:58.748843: [debug] Run process: /sbin/ldconfig -p
2019-01-09 09:23:58.750433: [debug] Process finished in 1ms: /sbin/ldconfig -p
2019-01-09 09:23:58.750542: [debug] Found shared library libtinfo.so.5 in 'ldconfig -p' output
2019-01-09 09:23:58.750673: [debug] Did not find shared library libtinfo.so.6
2019-01-09 09:23:58.750764: [debug] Did not find shared library libncursesw.so.6
2019-01-09 09:23:58.750804: [debug] Found shared library libgmp.so.10 in 'ldconfig -p' output
2019-01-09 09:23:58.750897: [debug] Did not find shared library libgmp.so.3
2019-01-09 09:23:58.750966: [debug] Potential GHC builds: standard
2019-01-09 09:23:58.751084: [debug] Found already installed GHC builds: standard
2019-01-09 09:23:58.754562: [debug] Getting global package database location
2019-01-09 09:23:58.761940: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2019-01-09 09:23:58.766303: [debug] Getting Cabal package version
2019-01-09 09:23:58.766523: [debug] Asking GHC for its version
2019-01-09 09:23:58.770869: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2019-01-09 09:23:58.779430: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc --numeric-version
2019-01-09 09:23:59.488601: [debug] Process finished in 726ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2019-01-09 09:23:59.491986: [debug] Process finished in 721ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db field --simple-output Cabal version
2019-01-09 09:23:59.656459: [debug] Process finished in 876ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc --numeric-version
2019-01-09 09:23:59.656695: [debug] GHC version is: ghc-8.2.2
2019-01-09 09:23:59.657071: [debug] Resolving package entries
2019-01-09 09:23:59.657954: [debug] Trying to decode /Users/runesvendsen/.stack/loaded-snapshot-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/ghc-8.2.cache
2019-01-09 09:23:59.664565: [debug] Success decoding /Users/runesvendsen/.stack/loaded-snapshot-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/ghc-8.2.cache
2019-01-09 09:23:59.671073: [debug] Starting to execute command inside EnvConfig
2019-01-09 09:23:59.671189: [debug] Parsing the targets
2019-01-09 09:23:59.673150: [debug] Running hpack on /Users/runesvendsen/code/ufw/package.yaml
2019-01-09 09:23:59.718815: [debug] hpack output unchanged in /Users/runesvendsen/code/ufw/ufw.cabal
2019-01-09 09:23:59.737055: [debug] Trying to decode /Users/runesvendsen/.stack/indices/Hackage/01-index.cache
2019-01-09 09:24:00.076691: [debug] Success decoding /Users/runesvendsen/.stack/indices/Hackage/01-index.cache
2019-01-09 09:24:00.117371: [debug] Start: getPackageFiles /Users/runesvendsen/code/ufw/ufw.cabal
2019-01-09 09:24:00.181426: [debug] Finished in 64ms: getPackageFiles /Users/runesvendsen/code/ufw/ufw.cabal
2019-01-09 09:24:00.196856: [debug] Finding out which packages are already installed
2019-01-09 09:24:00.207108: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
2019-01-09 09:24:00.696074: [debug] Process finished in 489ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --global --no-user-package-db dump --expand-pkgroot
2019-01-09 09:24:00.702562: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/runesvendsen/.stack/snapshots/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2/8.2.2/pkgdb dump --expand-pkgroot
2019-01-09 09:24:01.265955: [debug] Process finished in 563ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/runesvendsen/.stack/snapshots/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2/8.2.2/pkgdb dump --expand-pkgroot
2019-01-09 09:24:01.273348: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/runesvendsen/code/ufw/.stack-work/install/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2/8.2.2/pkgdb dump --expand-pkgroot
2019-01-09 09:24:01.762413: [debug] Process finished in 489ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --user --no-user-package-db --package-db /Users/runesvendsen/code/ufw/.stack-work/install/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2/8.2.2/pkgdb dump --expand-pkgroot
2019-01-09 09:24:01.773452: [debug] Constructing the build plan
2019-01-09 09:24:01.788967: [debug] Checking if we are going to build multiple executables with the same name
2019-01-09 09:24:01.789280: [debug] Executing the build plan
2019-01-09 09:24:01.797166: [debug] Getting global package database location
2019-01-09 09:24:01.797930: [debug] Run process: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2019-01-09 09:24:02.309540: [debug] Process finished in 511ms: /Users/runesvendsen/.stack/programs/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/ghc-8.2.2/bin/ghc-pkg --no-user-package-db list --global
2019-01-09 09:24:02.327741: [debug] Encoding /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/lib
2019-01-09 09:24:02.335130: [debug] Finished writing /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/lib
2019-01-09 09:24:02.335657: [debug] Encoding /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/exe-ufw
2019-01-09 09:24:02.339880: [debug] Finished writing /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/exe-ufw
2019-01-09 09:24:02.340060: [info] ufw-0.1.0.0: build (lib + exe)
2019-01-09 09:24:02.344162: [debug] Run process within /Users/runesvendsen/code/ufw/: /Users/runesvendsen/.stack/setup-exe-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0 build lib:ufw exe:ufw --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
2019-01-09 09:24:02.877411: [info] Preprocessing library for ufw-0.1.0.0..
2019-01-09 09:24:02.877540: [info] Building library for ufw-0.1.0.0..
2019-01-09 09:24:03.721240: [warn]
2019-01-09 09:24:03.727163: [warn] /Users/runesvendsen/code/ufw/src/Data/UFW.hs:4:14: error: Unsupported extension: LinearTypes
2019-01-09 09:24:03.727305: [warn]   |
2019-01-09 09:24:03.727786: [warn] 4 | {-# LANGUAGE LinearTypes #-}
2019-01-09 09:24:03.728098: [warn]   |              ^^^^^^^^^^^
2019-01-09 09:24:03.746618: [warn]
2019-01-09 09:24:03.746805: [debug] Start: getPackageFiles /Users/runesvendsen/code/ufw/ufw.cabal
2019-01-09 09:24:03.791814: [debug] Finished in 45ms: getPackageFiles /Users/runesvendsen/code/ufw/ufw.cabal
2019-01-09 09:24:03.792026: [debug] Encoding /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/lib
2019-01-09 09:24:03.794964: [debug] Finished writing /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/lib
2019-01-09 09:24:03.795084: [debug] Encoding /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/exe-ufw
2019-01-09 09:24:03.798269: [debug] Finished writing /Users/runesvendsen/code/ufw/.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0/stack-build-caches/exe-ufw

--  While building package ufw-0.1.0.0 using:
      /Users/runesvendsen/.stack/setup-exe-cache/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux-dkc68e43cf20ba48282b0ca96c3b2be50e/Cabal-2.0.1.0 build lib:ufw exe:ufw --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
2019-01-09 10:24:04.075263: [debug] Run process: /usr/local/bin/docker rm -f 0f88b642acf6f02cf1b8555f3b5e0d7a72c557e4c05e480eb4a475b1bdad021d
2019-01-09 10:24:04.131618: [debug] Process finished in 56ms: /usr/local/bin/docker rm -f 0f88b642acf6f02cf1b8555f3b5e0d7a72c557e4c05e480eb4a475b1bdad021d
Received ExitFailure 1 when running
Raw command: /usr/local/bin/docker start -a -i 0f88b642acf6f02cf1b8555f3b5e0d7a72c557e4c05e480eb4a475b1bdad021d
@aspiwack

This comment has been minimized.

aspiwack commented Jan 9, 2019

I don't see yet how this could be happening. Can you try:

$ docker run -it tweag/linear-types:latest
$ :set -XLinearTypes

And tell me what happens?

@runeksvendsen

This comment has been minimized.

runeksvendsen commented Jan 9, 2019

Activating LinearTypes seems to work fine. But trying to define frugal doesn't work:

GHCi, version 8.7.20181203: http://www.haskell.org/ghc/  :? for help
Prelude> :set -XLinearTypes
Prelude> let { frugal :: a ⊸ (a,a); frugal a = (a,a) }

<interactive>:2:19: error:
    Not in scope: type constructor or class ‘⊸’

<interactive>:2:19: error:
    Illegal operator ‘⊸’ in type ‘a ⊸ (a, a)’
      Use TypeOperators to allow operators in types
@aspiwack

This comment has been minimized.

aspiwack commented Jan 10, 2019

I really need to fix this README, sorry. To use you need -XUnicodeSyntax. Otherwise the syntax is a ->. b (notice the dot after the arrow).

Now that we've established that the docker image is indeed correct… maybe the original issue is in the stack.yaml? Could your share yours?

@runeksvendsen

This comment has been minimized.

runeksvendsen commented Jan 10, 2019

Thanks! No worries.

It works now. The issue was that the GHC version in the Docker image is 8.7, while my stack.yaml said compiler: ghc-8.2. After changing this to compiler: ghc-8.7 it works like a charm.

So, in other words, entering the wrong GHC version for the compiler option in stack.yaml seems to make Stack use a plain GHC version (which doesn't support LinearTypes), hence the error.

@runeksvendsen

This comment has been minimized.

runeksvendsen commented Jan 10, 2019

Here's a BASH one-liner for getting the stack.yaml compiler: version from the linear-types Docker image (may be useful for the README):

docker run tweag/linear-types | egrep -o "version \d.\d" | sed 's/version /compiler: ghc-/'

monoidal added a commit that referenced this issue Jan 10, 2019

Improve README
Refs #301
@monoidal

This comment has been minimized.

monoidal commented Jan 11, 2019

README is now updated, I believe this finishes the ticket.

@monoidal monoidal closed this Jan 11, 2019

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