Skip to content

Commit

Permalink
TOSQUASH
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisdral committed May 31, 2024
1 parent 05945d9 commit ebc17b4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion fs-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* `System.FS.IO.Internal` is moved to `System.FS.IO.Unix` on Linux and MacOS
systems, and moved to `System.FS.IO.Windows` on Windows systems.
* `System.FS.IO.Internal.Handle` is moved to `System.FS.IO.Handle`.
* Make the `fs-api` package only buildable on Linux, MacOS and Windows systems.

### Non-breaking

Expand Down
9 changes: 2 additions & 7 deletions fs-api/fs-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,14 @@ library
exposed-modules: System.FS.IO.Win32
build-depends: Win32 >=2.6.1.0

elif (os(linux) || os(osx))
-- every other distribution is handled like it is Unix-based
else
hs-source-dirs: src-unix
exposed-modules: System.FS.IO.Unix
build-depends:
, unix
, unix-bytestring >=0.4.0

else
-- The package currently only supports Linux, MacOS and Windows
-- explicitly.
build-depends: unbuildable <0
buildable: False

ghc-options:
-Wall -Wcompat -Wincomplete-uni-patterns
-Wincomplete-record-updates -Wpartial-fields -Widentities
Expand Down
7 changes: 3 additions & 4 deletions fs-sim/test/Test/System/FS/StateMachine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,7 @@ allocaMutableByteArray size action = newPinnedByteArray size >>= action
-- used to compare the 'FsError's that the mock throws against the 'FsError's
-- that the SUT throws, is more lenient than the default 'sameFsError'.
sameError :: FsError -> FsError -> Bool
#if defined(linux_HOST_OS)
sameError = sameFsError
#elif defined(mingw32_HOST_OS)
#if defined(mingw32_HOST_OS)
-- For the following error types, our mock FS implementation (and the Posix
-- implementation) throw the same errors:
--
Expand Down Expand Up @@ -420,7 +418,8 @@ sameError e1 e2 = sameFsError e1 e2
(FsResourceInappropriateType, FsInsufficientPermissions ) -> True
(_ , _ ) -> False
#else
sameError = error "OS not supported"
-- treat every other distribution like it is (Ubuntu) Linux
sameError = sameFsError
#endif

-- | Responses are either successful termination or an error
Expand Down

0 comments on commit ebc17b4

Please sign in to comment.