Closed hasufell closed 7 months ago
@tbidne can you test this?
It works on my test repo: No errors for using EncodingException
here. Given this PR is for only the single module System.OsPath.Encoding.Internal.hs
, I presume the other deprecated modules are intended to deprecate everything.
Something else I noticed: building filepath itself throws many deprecation warnings. Can we ignore all those package internal deprecation warnings somehow without causing a lot of work?
Well, you can throw -Wno-deprecations
in the affected modules for as long as you have to use the deprecated symbols. Otherwise you can use @Bodigrim's trick with the hidden modules + deprecated re-exports. But this is a decent amount of work, especially with the tricky cpp.
Better than status quo, but I'd go for the trick https://github.com/haskell/filepath/issues/209#issuecomment-1832809252: move the content of System.OsPath.Encoding.Internal
to other-module
System.OsPath.Encoding.Hidden
, without deprecations. Then System.OsPath.Encoding.Internal
reexports System.OsPath.Encoding.Hidden
and adds a module-wide deprecation atop, and other modules of filepath
rely on System.OsPath.Encoding.Hidden
directly. This way you don't have to disable -Wno-deprecations
everywhere, and it works with all GHC versions.
Better than status quo, but I'd go for the trick #209 (comment): move the content of
System.OsPath.Encoding.Internal
toother-module
System.OsPath.Encoding.Hidden
, without deprecations. ThenSystem.OsPath.Encoding.Internal
reexportsSystem.OsPath.Encoding.Hidden
and adds a module-wide deprecation atop, and other modules offilepath
rely onSystem.OsPath.Encoding.Hidden
directly. This way you don't have to disable-Wno-deprecations
everywhere, and it works with all GHC versions.
Here's what that looks like (I split the commits on my branch to make the diff easier):
The first commit simply renames the deprecated modules X.hs -> X.Hidden.hs
.
The second commit copies the API from X.Hidden.hs
to deprecated X.hs
.
@tbidne can you open a PR?
superseded by https://github.com/haskell/filepath/pull/213
@tbidne can you test this?
Something else I noticed: building filepath itself throws many deprecation warnings. Can we ignore all those package internal deprecation warnings somehow without causing a lot of work?