haskell / network-uri

URI manipulation facilities
Other
24 stars 33 forks source link

Mark SafeHaskell explicitly #50

Closed phadej closed 4 years ago

phadej commented 4 years ago

This fixes a transient failure in compiling e.g. http-link-header which relied on network-uri to be Safe/Trustworthy.

Also use DeriveLift, this fixes e.g. a clear error (though only warning from GHC point-of-view), when GHC-8.10 is used:

Network/URI.hs:1381:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift URI’
     |
1381 | instance Lift URI where
     |

There's an issue with GHC-8.10 release candidate, which I hope to fix for release proper: https://gitlab.haskell.org/ghc/ghc/issues/17813

ezrakilty commented 4 years ago

Thanks! I think we can get this in, though I want to make sure I understand it first.

phadej commented 4 years ago

I also made revisions to network-uri-2.6.2.0 Ihttps://hackage.haskell.org/package/network-uri-2.6.2.0/revisions/) and network-uri-2.7.0.0 versions (https://hackage.haskell.org/package/network-uri-2.7.0.0/revisions/), as they are broken with GHC-8.10 (though compile, missing methods ought to be an error).

I think there should be upper bound on template-haskell, as its interface does change (even the network-uri uses relatively stable parts, here's an example that you cannot be ever too sure). Easier to check with each new GHC major release that there's nothing big happened.

% cabal build -w ghc-8.10.1
Resolving dependencies...
Build profile: -w ghc-8.10.0.20200123 -O1
In order, the following will be built (use -v for more details):
 - network-uri-2.7.0.0 (lib) (first run)
Configuring library for network-uri-2.7.0.0..
Preprocessing library for network-uri-2.7.0.0..
Building library for network-uri-2.7.0.0..
[1 of 3] Compiling Network.URI      ( Network/URI.hs, /code/mess/nuri/network-uri-2.7.0.0/dist-newstyle/build/x86_64-linux/ghc-8.10.0.20200123/network-uri-2.7.0.0/build/Network/URI.o, /code/mess/nuri/network-uri-2.7.0.0/dist-newstyle/build/x86_64-linux/ghc-8.10.0.20200123/network-uri-2.7.0.0/build/Network/URI.dyn_o )

Network/URI.hs:1382:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift URI’
     |
1382 | instance Lift URI where
     |          ^^^^^^^^

Network/URI.hs:1385:10: warning: [-Wmissing-methods]
    • No explicit implementation for
        ‘liftTyped’
    • In the instance declaration for ‘Lift URIAuth’
     |
1385 | instance Lift URIAuth where
     |     
phadej commented 4 years ago

Thanks for merging, can this be released soon-ish? Without, my CI builds of github fails on older GHCs (as some dependency incorrectly depended on network-uri to be safe)

ezrakilty commented 4 years ago

Yup, let's get this released. I'll try to get it done today.

ezrakilty commented 4 years ago

Voila: https://hackage.haskell.org/package/network-uri-2.6.3.0

phadej commented 4 years ago

@ezrakilty Thank you very much!