JustusAdam / marvin

The paranoid bot (framework)
https://marvin.readthedocs.io
BSD 3-Clause "New" or "Revised" License
53 stars 6 forks source link

Use Hackage-friendly Stack settings #4

Closed hvr closed 7 years ago

hvr commented 7 years ago

Helps ensure that Hackage is able to build the docs for you package

hvr commented 7 years ago

Currently, the package would fail (as it did already in the past, see e.g. https://hackage.haskell.org/package/marvin-0.0.2/reports/) to build and is very likely to cause the doc-builder to fail as well

Configuring component exe:marvin-init from marvin-0.0.3
Preprocessing executable 'marvin-init' for marvin-0.0.3...
[1 of 2] Compiling Paths_marvin     ( /tmp/matrix-worker/1481728174/dist-newstyle/build/x86_64-linux/ghc-8.0.1/marvin-0.0.3/c/marvin-init/build/marvin-init/autogen/Paths_marvin.hs, /tmp/matrix-worker/1481728174/dist-newstyle/build/x86_64-linux/ghc-8.0.1/marvin-0.0.3/c/marvin-init/build/marvin-init/marvin-init-tmp/Paths_marvin.o )
[2 of 2] Compiling Main             ( initializer/Main.hs, /tmp/matrix-worker/1481728174/dist-newstyle/build/x86_64-linux/ghc-8.0.1/marvin-0.0.3/c/marvin-init/build/marvin-init/marvin-init-tmp/Main.o )

initializer/Main.hs:27:45: error:
    • Variable not in scope: (<>) :: t0 -> String -> b
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:57:95: error:
    • Variable not in scope: (<>) :: [Char] -> [Char] -> ω0
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:77:19: error:
    • Variable not in scope:
        (<>) :: InfoMod a4 -> InfoMod a5 -> InfoMod Opts
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:82:13: error:
    • Variable not in scope: (<>) :: Mod f0 a0 -> Mod f1 a1 -> t3
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:83:13: error:
    • Variable not in scope: (<>) :: t3 -> Mod f2 a2 -> t2
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:84:13: error:
    • Variable not in scope: (<>) :: t2 -> Mod f3 [Char] -> t1
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)

initializer/Main.hs:85:13: error:
    • Variable not in scope:
        (<>) :: t1 -> Mod f4 a3 -> Mod OptionFields String
    • Perhaps you meant one of these:
        ‘<*>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘>>’ (imported from Prelude)
cabal: Failed to build exe:marvin-init from marvin-0.0.3.
JustusAdam commented 7 years ago

I've never seen that option. How does that help hackage?

hvr commented 7 years ago

@JustusAdam well, in the current marvin.cabal file by leaving off version bounds, you state that your package is compatible with any versions of your build-dependencies, including all future ones. For Stack/Stackage, that's not a big deal as you have a stack.yaml file which does the equivalent job of constraining your build-dep specification to known to work versions. But Hackage & Cabal don't support or know anything about stack.yaml files, so you need to provide the equivalent information in a way Hackage & cabal understand; that's what pvp-bounds does for you automatically.

See also https://docs.haskellstack.org/en/stable/yaml_configuration/?highlight=pvp-bounds#pvp-bounds for more details, as well as this FAQ entry

JustusAdam commented 7 years ago

Okay, that seems reasonable. Thanks