Commit graph

46158 commits

Author SHA1 Message Date
Joey Hess
51a6cd1ee6
Merge branch 'master' into ospath 2025-01-24 16:33:36 -04:00
Joey Hess
3474aca3fc
another windows build fix 2025-01-24 16:33:26 -04:00
Joey Hess
f3539efc16
more OsPath conversion
Sponsored-by: Leon Schuermann
2025-01-24 16:31:14 -04:00
Joey Hess
ee0964e61b
Merge branch 'master' into ospath 2025-01-24 15:13:37 -04:00
Joey Hess
f16604d2c8
more windows and osx build fixes 2025-01-24 15:13:20 -04:00
Joey Hess
aa0f3f31da
more OsPath conversion
Sponsored-by: Eve
2025-01-24 15:02:29 -04:00
Joey Hess
dd01406018
Merge branch 'master' into ospath 2025-01-24 13:46:34 -04:00
Joey Hess
4ba1057836
more windows and osx build fixes 2025-01-24 13:46:13 -04:00
Joey Hess
c412c59ecd
more OsPath conversion
About 1/10th done with this I think.
2025-01-24 13:40:44 -04:00
Joey Hess
8021d22955
Merge branch 'master' into ospath 2025-01-24 12:02:35 -04:00
Joey Hess
639d19dbd1
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-24 11:39:43 -04:00
Joey Hess
f0b9b46cb2
windows and osx build fixes for recent ByteString conversion work 2025-01-24 11:39:33 -04:00
Joey Hess
f0c206cea6
avoid build warning on windows 2025-01-24 11:33:50 -04:00
Joey Hess
21731b7d3a
remove a few unused imports on windows 2025-01-24 11:32:26 -04:00
beryllium@5bc3c32eb8156390f96e363e4ba38976567425ec
f1b64f0415 Added a comment 2025-01-24 08:04:27 +00:00
yarikoptic
103ec0123f Added a comment 2025-01-23 21:33:26 +00:00
Joey Hess
ea775baccd
more OsPath conversion
Git.Types now uses it, as does TopFilePath, making for plenty of new
compile errors needing fixing.

Sponsored-by: Brock Spratlen
2025-01-23 16:15:00 -04:00
yarikoptic
e8f984598a complaining about dead 2025-01-23 16:12:18 +00:00
yarikoptic
f0b5fce5ab Added a comment 2025-01-23 15:53:39 +00:00
Joey Hess
12660314f1
continue conversion
Add Utility.OsString, with a special case for length.
2025-01-23 11:46:35 -04:00
Joey Hess
c3c8870752
add System.FilePath to this conversion
It seems to make sense to convert both System.Directory and
System.FilePath uses to OsPath in one go. This will generally look like
replacing RawFilePath with OsPath in type signatures, and will be driven
by the now absolutely massive pile of compile errors.

Got a few modules building in this new regime.

Sponsored-by: Jack Hill
2025-01-23 11:07:29 -04:00
Joey Hess
c1ecb80716
update 2025-01-23 10:27:18 -04:00
Joey Hess
05bdce328d
start converting from System.Directory to System.OsPath
This is the start of a long road, got the first few files to compile
after this large change.

Sponsored-by: mycroft
2025-01-23 10:25:20 -04:00
Joey Hess
d46504e51e
response 2025-01-22 16:48:51 -04:00
Joey Hess
f41054b108
Merge branch 'master' of ssh://git-annex.branchable.com 2025-01-22 16:42:50 -04:00
Joey Hess
77e9781ae2
parsePOSIXTime ByteString conversion
Some easy (though tiny) speed wins.

Sponsored-by: Luke T. Shumaker on Patreon
2025-01-22 16:42:09 -04:00
Joey Hess
d3de3c28eb
fix reversion
af3b9cbd36 lost takeFileName, breaking the
test suite
2025-01-22 16:28:54 -04:00
Joey Hess
6e27b0d4d1
convert from readFileStrict
This removes that function, using file-io readFile' instead.

Had to deal with newline conversion, which readFileStrict does on
Windows. In a few cases, that was pretty ugly to deal with.

Sponsored-by: Kevin Mueller
2025-01-22 16:20:36 -04:00
Joey Hess
de1af273e0
fix reversion
In 793ddecd4b, writeSshConfig was made to
writeFile a ByteString, which lost the newline conversion on Windows.

Added linesFile to fix it. This will also be useful for other writeFile
conversions.
2025-01-22 15:32:21 -04:00
Joey Hess
7a94ba1bf2
convert from readFileStrict
In cases where it reads lines, which needs newline conversion on
windows.
2025-01-22 15:23:33 -04:00
Joey Hess
60d0dc9c76
convert from readFileStrict
More of these still to convert, but need to be careful of newline
translation.
2025-01-22 14:49:31 -04:00
Joey Hess
c5fe457e01
fix reversion
793ddecd4b made installWrapper not do
newline conversion on windows.
2025-01-22 14:42:27 -04:00
Joey Hess
9b79f0f43d
use file-io for readFile/writeFile/appendFile on ByteStrings
These are all straightforward, and easy small performance wins.

Sponsored-by: Nicholas Golder-Manning
2025-01-22 14:30:25 -04:00
Joey Hess
90cd3aad37
RawFilePath conversion for replaceFile
Sponsored-by: Joshua Antonishen
2025-01-22 13:37:26 -04:00
Joey Hess
af3b9cbd36
simplify replaceFile using relatedTemplate
Now that truncateFilePath and relatedTemplate have both been optimised,
may as well use them in replaceFile, rather than the custom hack it
used.

Removed the windows-specific ifdef as well, because on Windows long
filepaths no longer really a problem, since ghc and git-annex use UNC
converted paths.

replaceFile no longer checks fileNameLengthLimit. That took a syscall,
and since we have an existing file, we know filenames of its length are
supported by the filesystem. Assuming that the withOtherTmp directory is
on the same filesystem as the file replaceFile is being called on, which
I believe it is.

Sponsored-by: Leon Schuermann
2025-01-22 13:25:06 -04:00
Joey Hess
f17ec601c4
optimize truncateFilePath
Often the filepath will be all ascii, or mostly so, and this
optimisation makes a file that has an ascii suffix of sufficient length
be roundtrip converted between String and ByteString only once, rather
than once per character.

Sponsored-by: Graham Spencer
2025-01-22 13:09:15 -04:00
Joey Hess
6211e2af4a
optimize relatedTemplate 2025-01-22 11:51:23 -04:00
Joey Hess
99a4ad708e
break out templateAddedLength 2025-01-22 11:43:45 -04:00
Joey Hess
793ddecd4b
use openTempFile from file-io
And follow-on changes.

Note that relatedTemplate was changed to operate on a RawFilePath, and
so when it counts the length, it is now the number of bytes, not the
number of code points. This will just make it truncate shorter strings
in some cases, the truncation is still unicode aware.

When not building with the OsPath flag, toOsPath . fromRawFilePath and
fromRawFilePath . fromOsPath do extra conversions back and forth between
String and ByteString. That overhead could be avoided, but that's the
non-optimised build mode, so didn't bother.

Sponsored-by: unqueued
2025-01-22 11:41:43 -04:00
jnkl
7d215db99e rename forum/reupload_existing_files_to_bare_repo.mdwn to forum/reuploads_existing_files_to_bare_repo.mdwn 2025-01-22 07:28:13 +00:00
jnkl
344d750590 2025-01-22 07:26:34 +00:00
nobodyinperson
360b2e0286 Added a comment: Exporting a synced/* branch works now! 🥳 2025-01-21 18:30:50 +00:00
Joey Hess
1faa3af9cd
add file-io to build-depends when building with OsPath flag
Partly converted code to use functions from it, though more remain
unconverted. Most of withFile and openFile now use it.
2025-01-21 14:26:04 -04:00
Joey Hess
85efc13e3a
avoid build warning with recent ghc
foldl' is in Prelude now. Explicitly import Data.List still
for older systems and add explict Prelude import to avoid warning.
2025-01-21 12:00:16 -04:00
Joey Hess
71f83bfff7
rename OsString to OsPath 2025-01-21 11:57:44 -04:00
Joey Hess
88b88c9d26
clean up stack.yaml with new versions of dependencies 2025-01-20 19:53:15 -04:00
Joey Hess
c7cca43ab0
RawFilePath conversion for Utility.Directory.Stream 2025-01-20 19:25:52 -04:00
Joey Hess
1ceece3108
RawFilePath conversion of System.Directory
By using System.Directory.OsPath, which takes and returns OsString,
which is a ShortByteString. So, things like dirContents currently have the
overhead of copying that to a ByteString, but that should be less than
the overhead of using Strings which often in turn were converted to
RawFilePaths.

Added Utility.OsString and the OsString build flag. That flag is turned
on in the stack.yaml, and will be turned on automatically by cabal when
built with new enough libraries. The stack.yaml change is a bit ugly,
and that could be reverted for now if it causes any problems.

Note that Utility.OsString.toOsString on windows is avoiding only a
check of encoding that is documented as being unlikely to fail. I don't
think it can fail in git-annex; if it could, git-annex didn't contain
such an encoding check before, so at worst that should be a wash.
2025-01-20 19:17:33 -04:00
Joey Hess
e5be81f8d4
stop exporting Utility.SystemDirectory from Utility.Directory 2025-01-20 19:10:25 -04:00
Joey Hess
8d80b07f5a
update 2025-01-20 14:20:35 -04:00