turn on OsPath build flag by default

It was already default in stack builds, now it is default in cabal
builds as well.

Add build warnings when git-annex is built without the OsPath build flag.

git-annex version: Report on whether it was built with the OsPath build flag.

Having the flag on by default was always the plan, and this is a good time to
make the change. A bit of added urgency comes from the close-on-exec leak
issue. Fixing that is going to need reimplentation of things like openFile.
Needing to reimplenment it twice is not very appealing, especially since the
FilePath version of it has an implementation that cannot be easily copied and
tweaked. If OsPath is on by default, I can start with only implementing
openFile for it, and fix the bug in that build. And perhaps avoid doing the
extra work that will later get thrown away when this transition finishes.

Note that at this point, Debian still needs to package file-io. Hopefully, they
will package it, rather than turning off the OsPath build flag.
This commit is contained in:
Joey Hess 2025-09-05 12:44:46 -04:00
commit fe67756197
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 15 additions and 4 deletions

View file

@ -69,6 +69,11 @@ buildFlags = filter (not . null)
, "Testsuite"
, "S3"
, "WebDAV"
#ifdef WITH_OSPATH
, "OsPath"
#else
#warning Building without the OsPath build flag set results in slower filename manipulation and is not recommended.
#endif
]
-- Not a complete list, let alone a listing transitive deps, but only