commercialhaskell / commercialhaskell/stack

Internal Use of Backpack

Open
#4,013 3 comments 0 reactions 0 assignees View on GitHub
component: backpack
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

I have a package [primitive-containers](https://github.com/andrewthad/primitive-containers) that uses backpack internally ([permalink](https://github.com/andrewthad/primitive-containers/tree/94721144ddc8fb6bbe1bf469a8a5ed581b660b00)). It does not export any signatures or indefinite modules. There is a `stack.yaml` file in the repo that tells the project to use a fork of `primitive`. This is what currently happens when I run `stack build`:

```
primitive-containers-0.1.0.0: build (lib)
primitive-containers-0.1.0.0: copy/register
Log files have been written to: /home/amartin/Development/primitive-containers/.stack-work/logs/

-- While building custom Setup.hs for package primitive-containers-0.1.0.0 using:
/home/amartin/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 register
Process exited with code: ExitFailure 1
Logs have been written to: /home/amartin/Development/primitive-containers/.stack-work/logs/primitive-containers-0.1.0.0.log

Preprocessing library 'set-indef' for primitive-containers-0.1.0.0..
Building library 'set-indef' instantiated with Value =
for primitive-containers-0.1.0.0..
Preprocessing library 'map-indef' for primitive-containers-0.1.0.0..
Building library 'map-indef' instantiated with
Key =
Value =
for primitive-containers-0.1.0.0..
Preprocessing library 'array-unboxed' for primitive-containers-0.1.0.0..
Building library 'array-unboxed' for primitive-containers-0.1.0.0..
Preprocessing library 'map-indef' for primitive-containers-0.1.0.0..
Building library 'map-indef' instantiated with
Key = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnboxed
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnlifted
for primitive-containers-0.1.0.0..
Preprocessing library 'map-indef' for primitive-containers-0.1.0.0..
Building library 'map-indef' instantiated with
Key = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnboxed
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnboxed
for primitive-containers-0.1.0.0..
Preprocessing library 'map-indef' for primitive-containers-0.1.0.0..
Building library 'map-indef' instantiated with
Key = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnboxed
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueLifted
for primitive-containers-0.1.0.0..
Preprocessing library 'set-indef' for primitive-containers-0.1.0.0..
Building library 'set-indef' instantiated with
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnboxed
for primitive-containers-0.1.0.0..
Preprocessing library 'set-indef' for primitive-containers-0.1.0.0..
Building library 'set-indef' instantiated with
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueLifted
for primitive-containers-0.1.0.0..
Preprocessing library 'set-indef' for primitive-containers-0.1.0.0..
Building library 'set-indef' instantiated with
Value = primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed:ValueUnlifted
for primitive-containers-0.1.0.0..
Preprocessing library for primitive-containers-0.1.0.0..
Building library for primitive-containers-0.1.0.0..
Installing internal library set-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-LB02mqSWkYI3GBWrMlPkdG-set-indef
Installing internal library map-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-7Mjdw1dnkztIBEv4giYMwn-map-indef
Installing internal library array-unboxed in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.
2.2/primitive-containers-0.1.0.0-4T7iiQSe8s3An1FFOj4zYO-array-unboxed
Installing internal library map-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-7Mjdw1dnkztIBEv4giYMwn-map-indef+2T1dqeUIRdj8OPyuGNS3hg
Installing internal library map-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-7Mjdw1dnkztIBEv4giYMwn-map-indef+71ykyc6nSwx8vP5G0Tqw9i
Installing internal library map-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-7Mjdw1dnkztIBEv4giYMwn-map-indef+G859lIO1xcR1YT3FaKNnT3
Installing internal library set-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-LB02mqSWkYI3GBWrMlPkdG-set-indef+6ga3wnXyLKPGeJh3bsiEcn
Installing internal library set-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-LB02mqSWkYI3GBWrMlPkdG-set-indef+EO0gCEE4KTFL0dcsdrzrR9
Installing internal library set-indef in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/
primitive-containers-0.1.0.0-LB02mqSWkYI3GBWrMlPkdG-set-indef+F8UdKHx9CmY4gHukJdpFI
Installing library in /home/amartin/Development/primitive-containers/.stack-work/install/x86_64-linux/lts-11.7/8.2.2/lib/x86_64-linux-ghc-8.2.2/primitive-container
s-0.1.0.0-IlrblA1JadU1eSfUzd3i3S
Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2:
'/home/amartin/.stack/programs/x86_64-linux/ghc-8.2.2/bin/ghc' exited with an
error:
Failed to load interface for ‘Control.Monad.Primitive’
no unit id matching ‘primitive-0.6.3.0-CXy1O9sQYlI58rn9KQkFyo’ was found
```

I'm not sure what uses of backpack stack currently claims to support, but I thought it'd be worth it to go ahead and open this here anyway. Also:

```
$ stack --version
Version 1.7.1, Git revision 681c800873816c022739ca7ed14755e85a579565 (5807 commits) x86_64 hpack-0.28.2
```

Contributor guide

Open the contributing guide

Research direction

Start with the reported `stack build` failure, the repository's `stack.yaml`, and Stack 1.7.1's Backpack handling. Reproduce the missing `Control.Monad.Primitive` unit-id error using the linked `primitive-containers` setup, then determine whether internal Backpack libraries should build and link correctly; done means the package builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.