Skip to content
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

Build errors as a dependency during stack build #33

Closed
senofsky opened this issue Jun 7, 2020 · 7 comments
Closed

Build errors as a dependency during stack build #33

senofsky opened this issue Jun 7, 2020 · 7 comments

Comments

@senofsky
Copy link

senofsky commented Jun 7, 2020

I am trying to use haskus-binary in my stack project. To do so, I have added:

dependencies:                                                                                           
- base >= 4.9 && < 5                                                                                    
- haskus-binary == 1.4 

To package.yaml.

When I execute stack build, I encounter errors which end up recommending I add extra-deps to stack.yaml. After doing this a few times, stack.yaml contains:

extra-deps:                                                                                             
- haskus-binary-1.4@sha256:b0fc1d78e01abf2ba47a92f042c48ced0c6dfc9520712d573b094743b3ee2dac,3897        
- haskus-utils-1.4@sha256:48dd6e48f5e881fd1625f25ffcd9f223a164b002efdd98466be21fbc0d3240cc,2154         
- haskus-utils-data-1.2@sha256:6dd3ecb6671b3eb888e479b5beb4a9fa7cee09c91683c88c501db6cd0177e427,1508    
- haskus-utils-types-1.5@sha256:8f5ddbe1cd1c654e5cfaa6da1f12bd8d71e2d41216475d1a0dfd5590e5e68b1c,1294    
- primitive-0.6.4.0@sha256:5b6a2c3cc70a35aabd4565fcb9bb1dd78fe2814a36e62428a9a1aae8c32441a1,2079 

However, this ultimately fails with:

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for haskus-utils-1.4:
    haskus-utils-variant must match >=2.4, but the stack configuration has no specified version  (latest matching version is 3.0)
needed due to MIL-STD-1553C-Simulator-0.1.0.0 -> haskus-utils-1.4

In the dependencies for primitive-0.6.4.0:
    base-4.13.0.0 from stack configuration does not match >=4.5 && <4.13  (latest matching version is 4.12.0.0)
needed due to MIL-STD-1553C-Simulator-0.1.0.0 -> primitive-0.6.4.0

Some different approaches to resolving this:

  * Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a different GHC version with the matching base.

I am not entirely sure if this is a misconfiguration on my end or a problem with the haskus dependencies.

What should I do so that I may use haskus-binary in my project?

I appreciate the help!

@hsyl20
Copy link
Contributor

hsyl20 commented Jun 7, 2020

I think I'll make a new release on Hackage. I've removed the direct dependency on primitive package in master to avoid this issue with GHC > 8.6. In the meantime you can add a dependency on the latest version in your stack.yaml file:

extra-deps:
- git: https://github.com/haskus/packages.git
  commit: f490a4fb79960b282aed785a8a46ba6bc28df6a4
  subdirs:
     - haskus-binary
     - haskus-utils
     - haskus-utils-data

I'm so used to do this for my projects that depend on haskus-binary et al. that I forget to release on Hackage. Thanks for the report!

@hsyl20
Copy link
Contributor

hsyl20 commented Jun 8, 2020

@hsyl20 hsyl20 closed this as completed Jun 8, 2020
@senofsky
Copy link
Author

Thank you so much for your assistance! Sorry for the delayed response.

I updated stack.yaml to include the extra-deps you mentioned. Additionally, I modified package.yaml:

dependencies:                                                                                           
- base >= 4.9 && < 5                                                                                    
- haskus-binary == 1.5   

After executing stack build, I'm advised to add additional entries into extra-deps:

extra-deps:                                                                                             
- git: https://github.com/haskus/packages.git                                                           
  commit: f490a4fb79960b282aed785a8a46ba6bc28df6a4                                                      
  subdirs:                                                                                              
           - haskus-binary                                                                                    
           - haskus-utils                                                                                     
           - haskus-utils-data                                                                                
- haskus-utils-types-1.5@sha256:8f5ddbe1cd1c654e5cfaa6da1f12bd8d71e2d41216475d1a0dfd5590e5e68b1c,1294    
- haskus-utils-variant-3.0@sha256:8d51e45d3b664e61ccc25a58b37c0ccc4ee7537138b9fee21cd15c356906dd34,2159

However, stack build now fails with:

» stack build

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for MIL-STD-1553C-Simulator-0.1.0.0:
    haskus-binary-1.4 from stack configuration does not match ==1.5 
needed since MIL-STD-1553C-Simulator is a build target.

Some different approaches to resolving this:

  * Set 'allow-newer: true' in /home/senofsky/.stack/config.yaml to ignore all version constraints and build anyway.


Plan construction failed.

I would prefer to not set allow-newer: true. Would you have any recommendations for this?

Thanks again, I'll try to be more swift in my reply.

@hsyl20
Copy link
Contributor

hsyl20 commented Jun 16, 2020

With the new release, you only need this stack.yaml:

# stack.yaml
resolver: lts-16.0

packages:
- .

extra-deps:
- haskus-binary-1.5
- haskus-utils-1.5
- haskus-utils-data-1.3
- haskus-utils-types-1.5
- haskus-utils-variant-3.0
- stm-containers-1.1.0.4
- stm-hamt-1.2.0.4
- primitive-extras-0.8
- primitive-unlifted-0.1.3.0

And this in your package.yaml:

# package.yaml
dependencies:
- base >= 4.7 && < 5
- haskus-binary == 1.5

@hsyl20
Copy link
Contributor

hsyl20 commented Jun 16, 2020

(There are too many extra-deps to my taste, i'll try to minimize the dependencies in the future)

@senofsky
Copy link
Author

That worked! Thank you for your help and for maintaining this repo!

I do have one more question:

What could I have done to figure out how to install this package without your help?

I found this package via hackage and I looked through some of the docs on docs.haskus.org but I could not determine the correct installation steps.

@hsyl20
Copy link
Contributor

hsyl20 commented Jun 17, 2020

What could I have done to figure out how to install this package without your help?

Before the new 1.5 release you couldn't install it with your version of GHC because of the dependency on primitive == 0.6.*. In your log above:

In the dependencies for primitive-0.6.4.0:
    base-4.13.0.0 from stack configuration does not match >=4.5 && <4.13  (latest matching version is 4.12.0.0)
needed due to MIL-STD-1553C-Simulator-0.1.0.0 -> primitive-0.6.4.0

(base version is fixed for a GHC version, as the last Stack message says)

The alternatives to fix this were:

  1. For you to try with allow-newer: true hoping packages would be compatible despite the constraints saying otherwise
  2. For you to build with an older GHC, so that base < 4.13
  3. For me to make the package compatible with primitive 0.7.* which supports base up to 4.14.*, either with a package revision or a new release
  4. For me to remove the dependency on primitive with a new release (that's what I've done)
  5. For you to use the unreleased version from git (what I've suggested above as a temporary workaround)

So the best way to fix this was to open an issue here :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants