Closed andreasabel closed 1 year ago
At one time, there was a difficulty eliminating the warnings across all the ghc versions. I bet that's changed and this bears another look. I'll see what I can do!
authority = dropss . ($"") . uriAuthToString id . uriAuthority
This is easily fixed by adding a whitespace after $
.
Network/URI.hs:10:14: warning: [-Wtrustworthy-safe] ‘Network.URI’ is marked as Trustworthy but has been inferred as safe!
Maybe just disable this warning, but it is unclear when it was introduced. The "since" info is missing here: https://downloads.haskell.org/ghc/9.2.4/docs/html/users_guide/exts/safe_haskell.html#ghc-flag--Wtrustworthy-safe
(Upstream issue: https://gitlab.haskell.org/ghc/ghc/-/issues/18087#note_466151)
Or, maybe it is possible to declare this module as Safe
. However, there are caveats around SafeHaskell
, see e.g.:
I fixed the warning for the $
.
@andreasabel I'm not actually seeing the trustworthy-safe warning in my CI build: https://github.com/haskell/network-uri/actions/runs/3646303898/jobs/6157239686
The module is actually marked as Safe under these conditions:
#if MIN_VERSION_template_haskell(2,12,0) && MIN_VERSION_parsec(3,1,13)
Are you building in a way that fails one of those conditions?
This is the full reproducer, using the latest (non-deprecated) release on Hackage:
$ cabal get network-uri
Unpacking to network-uri-2.6.4.1/
$ cd network-uri-2.6.4.1/
$ cabal build -w ghc-9.4.3
Resolving dependencies...
Build profile: -w ghc-9.4.3 -O1
In order, the following will be built (use -v for more details):
- network-uri-2.6.4.1 (lib) (first run)
Configuring library for network-uri-2.6.4.1..
Preprocessing library for network-uri-2.6.4.1..
Building library for network-uri-2.6.4.1..
[1 of 3] Compiling Network.URI ( ... )
Network/URI.hs:10:14: warning: [-Wtrustworthy-safe]
‘Network.URI’ is marked as Trustworthy but has been inferred as safe!
|
10 | {-# LANGUAGE Trustworthy #-}
| ^^^^^^^^^^^
Network/URI.hs:1418:23: warning: [-Woperator-whitespace-ext-conflict]
The prefix use of a ‘$’ would denote an untyped splice
were the TemplateHaskell extension enabled.
Suggested fix: Add whitespace after the ‘$’.
|
1418 | authority = dropss . ($"") . uriAuthToString id . uriAuthority
| ^
[2 of 3] Compiling Network.URI.Lens ( ... )
[3 of 3] Compiling Network.URI.Static ( ... )
So, just vanilla build conditions.
The module is actually marked as Safe under these conditions:
#if MIN_VERSION_template_haskell(2,12,0) && MIN_VERSION_parsec(3,1,13)
Are you building in a way that fails one of those conditions?
The released network-uri-2.6.4.1
says MIN_VERSION_parsec(3,13,0)
instead of MIN_VERSION_parsec(3,1,13)
.
The released network-uri-2.6.4.1 says MIN_VERSION_parsec(3,13,0) instead of MIN_VERSION_parsec(3,1,13).
I see, thank you! Well, that's good motivation for a release, then. I'll get to it today or this week.
Here I have a candidate for 2.6.4.2: https://hackage.haskell.org/package/network-uri-2.6.4.2/candidate
I will publish later today if I don't see any reason not to.
* Fix warnings `-Wtrustworthy-safe` and `-Woperator-whitespace-ext-conflict` on GHC 9.4.
OK, I've published network-uri 2.6.4.2, fixing these warnings. https://hackage.haskell.org/package/network-uri-2.6.4.2
Dunno, somehow cabal builds
network-uri
very often on my system, and I always see the same warnings (see below). Could these warnings be fixed?