ZHaskell / stdio

Haskell Standard Input and Output
104 stars 5 forks source link

Broken release #20

Closed hvr closed 5 years ago

hvr commented 5 years ago

As can be seen on https://matrix.hackage.haskell.org/package/stdio@1550318928 the stdio-0.1.0.0 release fails to build.

Moreoever, there's another critical quality issue with the stdio-0.1.0.0 release that needs fixing, as can be seen on https://hackage.haskell.org/package/stdio-0.1.0.0/dependencies most dependencies are missing proper version bounds and consequently stdio is not a properly defined cabal package. Please help us ensure a good user experience for users of Hackage/Cabal by the use of the PVP mandated lower&upper bounds in order to reduce the penalty on the Hackage infrastructure as well as to avoid unnecessary extra work for you as well as for us Hackage Trustees!

winterland1989 commented 5 years ago

Thanks for reporting this @hvr, but I have a problem here: how can i tell hackage to install libuv (>= 1.14) before continuing build my package? As for the version bound i can spend some time to figure them out.

hvr commented 5 years ago

@winterland1989 use pkgconfig-depends: libuv >= 1.14 :-)

winterland1989 commented 5 years ago

@winterland1989 use pkgconfig-depends: libuv >= 1.14 :-)

Thanks! I'll try to revise my cabal file ASAP.

hvr commented 5 years ago

The benfit of using pkgconfig-depends is that you get a more useful solver error:

cabal: Could not resolve dependencies:
[__0] next goal: stdio (user goal)
[__0] rejecting: stdio-0.1.0.0 (conflict: pkg-config package libuv>=1.14, not found in the pkg-config database)

and the cabal solver is able to backtrack as it treats pkgconfig-depends constraints like any other constraint; moreover, in future, we might be able to provide cabal the ability to auto-install C FFI deps on distros which support this. And moroever, pkgconfig-depends also takes care of dealing with include headers or DSOs/library files which are installed into some not-in-searchpath locations, or need special CFLAGS/LDFLAGS.

winterland1989 commented 5 years ago

I've uploaded a new version of stdio, please help me revise the cabal file if there's any issue. It seems the pkg-config field didn't solve the issue though.

hvr commented 5 years ago

@winterland1989 the problem is the automatic flag

flag no-pkg-config
  description: Don't use pkg-config to check for library dependences
  default: False

combined with the construct

     if flag(no-pkg-config)
        extra-libraries:   uv
      else
        pkgconfig-depends: libuv  >= 1.14

as I said earlier, one of the benefits of pkgconfig-depends is that it's used by the cabal solver and fully supports backtracking. Consequently, what happens now is that the solver will try to solve for the no-pkg-config variable, and if pkgconfig-depends cannot be satisfied, this means that no-pkg-config must be True.

There's a vague plan to introduce a have_pkgconfig boolean variable, which you can use in conditonals to check whether the tool pkg-config exists, but we don't have that yet.

That being said, did you intentionally use an automatic flag no-pkg-config instead of making it manual? If not, we can revise it to become manual (while keeping it default: False).

winterland1989 commented 5 years ago

That being said, did you intentionally use an automatic flag no-pkg-config instead of making it manual? If not, we can revise it to become manual (while keeping it default: False).

Thanks for your explanation, please revise it to become manual (while keeping it default: False). My intention is to provide a fallback for users who don't have pkg-config on their system.

hvr commented 5 years ago

@winterland1989 those users might have to manually toggle that flag via CLI or config files; how many users do you expect to fall into that category? Specifically, on which operating systems do you expect pkgconfig to be missing?

winterland1989 commented 5 years ago

@winterland1989 those users might have to manually toggle that flag via CLI or config files; how many users do you expect to fall into that category?

Good question, but I really don't have an answer right now since I just release this package a day before yesterday. On both of my test machines (Ubuntu 18.04 and OSX) pkg-config works all right. I'll add a note to README, suggest those users to manually toggle no-pkg-config flag if pkg-config is not available.

hvr commented 5 years ago

Done: http://hackage.haskell.org/package/stdio-0.1.1.0/revisions/

btw, you could have done this yourself via http://hackage.haskell.org/package/stdio-0.1.1.0/stdio.cabal/edit (but note that the current revision-validation logic allows only to turn automatic->manual but not reverse this)

winterland1989 commented 5 years ago

OK, thank you. I'll update my cabal file in this repo later.