You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: stack-investigation
version: 0.1.0.0
github: "githubuser/stack-investigation"
license: BSD3
author: "Author name here"
maintainer: "[email protected]"
copyright: "2020 Author name here"
extra-source-files:
- README.md
- ChangeLog.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/githubuser/stack-investigation#readme>
dependencies:
- name: base
version: ">= 4.7 && < 5"
mixin: [hiding (Prelude)]
library:
source-dirs: src
dependencies:
- morley-prelude
executables:
stack-investigation-exe:
main: Main.hs
source-dirs: app
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- stack-investigation
- morley-prelude
tests:
stack-investigation-test:
main: Spec.hs
source-dirs: test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- stack-investigation
- morley-prelude
- network
Use clear ~/.stack, .stack-work and run stack test for the current project. The build succeeds.
Use clear ~/.stack, .stack-work and run stack build && stack test. The build fails with the following error:
network > [1 of 2] Compiling Main ( /tmp/stack-38b10cd0c119f260/network-3.1.1.1/Setup.hs, /tmp/stack-38b10cd0c119f260/network-3.1.1.1/.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0/setup/Main.o )
network >
network > /tmp/stack-38b10cd0c119f260/network-3.1.1.1/Setup.hs:1:8: error:
network > Ambiguous module name `Prelude':
network > it was found in multiple packages:
network > base-4.13.0.0 morley-prelude-0.3.0
network > |
network > 1 | module Main (main) where
network > | ^^^^
Looks like the problem is caused by the fact that network is compiled after morley-prelude
in the latter case, and before it in the former one.
Expected
Both command sequences end in a successful build
Actual
stack build && stack test failed with ambiguous Prelude error.
What actually happened.
General summary/comments (optional)
If the project uses mixins to hide
Prelude
from thebase
package and custom prelude,compilation result may depend on the
stack
command order.Steps to reproduce
Build the following sample stack project.
stack.yaml
:package.yaml
:Use clear
~/.stack
,.stack-work
and runstack test
for the current project. The build succeeds.Use clear
~/.stack
,.stack-work
and runstack build && stack test
. The build fails with the following error:Looks like the problem is caused by the fact that
network
is compiled aftermorley-prelude
in the latter case, and before it in the former one.
Expected
Both command sequences end in a successful build
Actual
stack build && stack test
failed with ambiguousPrelude
error.What actually happened.
Stack version
2.5.0.1
Method of installation
Linux binary from Github release.
Archive with sample project sources
stack-project.zip
The text was updated successfully, but these errors were encountered: