From 0fb94c9bd166c4d9fc0fcd5a0848c42278117c84 Mon Sep 17 00:00:00 2001 From: Mann mit Hut Date: Fri, 9 Aug 2024 23:01:47 +0200 Subject: [PATCH] Better backwards compatibility --- .../System/OsString/Compat/Include.hs | 14 +++-- path.cabal | 16 +++--- stack.old.yaml | 13 ----- stack.old.yaml.lock | 54 ------------------- stack.os-string.yaml | 15 ++++++ stack.os-string.yaml.lock | 40 ++++++++++++++ stack.yaml | 19 +++---- stack.yaml.lock | 47 +++++++++------- 8 files changed, 107 insertions(+), 111 deletions(-) delete mode 100644 stack.old.yaml delete mode 100644 stack.old.yaml.lock create mode 100644 stack.os-string.yaml create mode 100644 stack.os-string.yaml.lock diff --git a/os-string-compat/System/OsString/Compat/Include.hs b/os-string-compat/System/OsString/Compat/Include.hs index d5a6640..9828f71 100644 --- a/os-string-compat/System/OsString/Compat/Include.hs +++ b/os-string-compat/System/OsString/Compat/Include.hs @@ -10,8 +10,16 @@ {-# OPTIONS_GHC -Wno-deprecations #-} {-# OPTIONS_GHC -Wno-orphans #-} -module System.OsString.Compat.PLATFORM_NAME +#define USE_os_string 0 +#if defined MIN_VERSION_os_string #if MIN_VERSION_os_string(2,0,0) +#undef USE_os_string +#define USE_os_string 1 +#endif +#endif + +module System.OsString.Compat.PLATFORM_NAME +#if USE_os_string ( PLATFORM_STRING(..) , PLATFORM_CHAR(..) , module OsString @@ -47,7 +55,7 @@ import Data.Data (Data) import System.OsString.Internal.Types (PLATFORM_STRING(..), PLATFORM_CHAR(..)) import System.OsString.PLATFORM_NAME as OsString -#if !MIN_VERSION_os_string(2,0,0) +#if !USE_os_string import Data.Coerce (coerce) #if IS_WINDOWS @@ -59,7 +67,7 @@ import qualified System.OsPath.Data.ByteString.Short as BSP deriving instance Data PLATFORM_STRING -#if !MIN_VERSION_os_string(2,0,0) +#if !USE_os_string all :: (PLATFORM_CHAR -> Bool) -> PLATFORM_STRING -> Bool all = coerce BSP.all diff --git a/path.cabal b/path.cabal index 46567f3..6561a16 100644 --- a/path.cabal +++ b/path.cabal @@ -28,7 +28,7 @@ flag dev manual: True default: False -flag old-os-string +flag os-string description: Use an older version of the os-string library. manual: False default: False @@ -78,10 +78,10 @@ library , text , template-haskell - if flag(old-os-string) - build-depends: filepath >= 1.4.100.0 && <1.5 - else + if flag(os-string) build-depends: filepath >= 1.5 + else + build-depends: filepath >= 1.4.100.0 && <1.5 library os-string-compat import: language @@ -94,11 +94,11 @@ library os-string-compat build-depends: base >= 4.12 && < 5 - if flag(old-os-string) - build-depends: filepath >= 1.4.100.0 - , os-string < 2.0.0 - else + if flag(os-string) build-depends: os-string >= 2.0.0 + else + build-depends: filepath >= 1.4.100.0 + -- , os-string < 2.0.0 test-suite test import: language diff --git a/stack.old.yaml b/stack.old.yaml deleted file mode 100644 index 0a55d9f..0000000 --- a/stack.old.yaml +++ /dev/null @@ -1,13 +0,0 @@ -resolver: lts-22.31 # GHC 9.6.6 - -extra-deps: - - data-fix-0.3.2 - - hashable-1.4.3.0 - - semialign-1.3 - - text-short-0.1.5 - - these-1.2 - - os-string-1.0.0@sha256:f1582da15c52761681da87d98c854a0db54049f34d59f74cfec4cc56ad8fbc05,1852 - -flags: - path: - old-os-string: true diff --git a/stack.old.yaml.lock b/stack.old.yaml.lock deleted file mode 100644 index f186c46..0000000 --- a/stack.old.yaml.lock +++ /dev/null @@ -1,54 +0,0 @@ -# This file was autogenerated by Stack. -# You should not edit this file by hand. -# For more information, please see the documentation at: -# https://docs.haskellstack.org/en/stable/lock_files - -packages: -- completed: - hackage: data-fix-0.3.2@sha256:cd7d6ff8b68aca3b51d8116870fc8ccdbc557989562cd3d5c941e4f0b7bc5af1,1734 - pantry-tree: - sha256: 39ea2bb3ace2b61bf72e7df77948f7fccc67c70d12a11e35dd20744eec5dd0bf - size: 262 - original: - hackage: data-fix-0.3.2 -- completed: - hackage: hashable-1.4.3.0@sha256:f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194,4718 - pantry-tree: - sha256: abef0611d6a717ba351317bdb603ef536659e7767a49ba81b2dbe20994065c7d - size: 1248 - original: - hackage: hashable-1.4.3.0 -- completed: - hackage: semialign-1.3@sha256:7be9ef5ca1d6b052991f68c053aab68b9d1ab3b1938c9557ac84c97937815223,2888 - pantry-tree: - sha256: e5daa7e0023dabb1b21a04bf084364b94e45e81b380e950b90f51294a1990b87 - size: 537 - original: - hackage: semialign-1.3 -- completed: - hackage: text-short-0.1.5@sha256:9c73c9c9182ca69ee92ce3758f515b1c078cd167d882ccc8c46f92f68c65e190,3216 - pantry-tree: - sha256: d3dcfee9029cd3624a788a0e65f0dea588ae0446a8a75a27d6b6164b8ee0fd57 - size: 727 - original: - hackage: text-short-0.1.5 -- completed: - hackage: these-1.2@sha256:011e22f6891ca028f87c04ea48796696c92d593313a9c699f7ff4f9ffd7aec6e,2882 - pantry-tree: - sha256: 37483703ce7326c07608b06f2f741fb0f708cb06bd10ec57d87108d068046b05 - size: 351 - original: - hackage: these-1.2 -- completed: - hackage: os-string-1.0.0@sha256:f1582da15c52761681da87d98c854a0db54049f34d59f74cfec4cc56ad8fbc05,1852 - pantry-tree: - sha256: 75321cadad8a67becb5fc36bdd974a6db3746dcbe0235bf9ec0f0baaad7b4a23 - size: 207 - original: - hackage: os-string-1.0.0@sha256:f1582da15c52761681da87d98c854a0db54049f34d59f74cfec4cc56ad8fbc05,1852 -snapshots: -- completed: - sha256: acaab6ca693211938d1542abcb1c83a2f298b9f6b571854a9d38febe39b6408e - size: 719577 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/31.yaml - original: lts-22.31 diff --git a/stack.os-string.yaml b/stack.os-string.yaml new file mode 100644 index 0000000..cd45341 --- /dev/null +++ b/stack.os-string.yaml @@ -0,0 +1,15 @@ +resolver: lts-22.32 # GHC 9.6.6 + +extra-deps: + - directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 + - filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 + - process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 + - unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 + +flags: + directory: + os-string: true + path: + os-string: true + unix: + os-string: true diff --git a/stack.os-string.yaml.lock b/stack.os-string.yaml.lock new file mode 100644 index 0000000..a491c94 --- /dev/null +++ b/stack.os-string.yaml.lock @@ -0,0 +1,40 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + hackage: directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 + pantry-tree: + sha256: d11130a0ca9e7c8720ed1ceef4e2f0d9be4b446e67e7d15d634763a5c952877e + size: 3519 + original: + hackage: directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 +- completed: + hackage: filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 + pantry-tree: + sha256: a5feb33f17ff131a5bba009abae35761594d62ba6873b2f70992a48db160c9b7 + size: 2274 + original: + hackage: filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 +- completed: + hackage: process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 + pantry-tree: + sha256: 14d1e9a5ec731766e43c7eb9c2dc59a7da48d98d43374d9d83e725d8891c6173 + size: 1789 + original: + hackage: process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 +- completed: + hackage: unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 + pantry-tree: + sha256: b961320db69795a16c4ef4eebb0a3e7ddbbbe506fa1e22dde95ee8d8501bfbe5 + size: 5821 + original: + hackage: unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 +snapshots: +- completed: + sha256: 417fa04a2ed8916cdae74c475ff97ac80857fed5000f19dce4f9564b5e635294 + size: 720000 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/32.yaml + original: lts-22.32 diff --git a/stack.yaml b/stack.yaml index 36be99a..32ff23b 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,15 +1,8 @@ -resolver: lts-22.31 # GHC 9.6.6 +resolver: lts-22.32 # GHC 9.6.6 extra-deps: - - directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 - - filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 - - process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 - - unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 - -flags: - directory: - os-string: true - path: - old-os-string: false - unix: - os-string: true + - data-fix-0.3.2 + - hashable-1.4.3.0 + - semialign-1.3 + - text-short-0.1.5 + - these-1.2 diff --git a/stack.yaml.lock b/stack.yaml.lock index cf92b1f..6977cff 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -5,36 +5,43 @@ packages: - completed: - hackage: directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 + hackage: data-fix-0.3.2@sha256:cd7d6ff8b68aca3b51d8116870fc8ccdbc557989562cd3d5c941e4f0b7bc5af1,1734 pantry-tree: - sha256: d11130a0ca9e7c8720ed1ceef4e2f0d9be4b446e67e7d15d634763a5c952877e - size: 3519 + sha256: 39ea2bb3ace2b61bf72e7df77948f7fccc67c70d12a11e35dd20744eec5dd0bf + size: 262 original: - hackage: directory-1.3.8.5@sha256:fbeec9ec346e5272167f63dcb86af513b457a7b9fc36dc818e4c7b81608d612b,3166 + hackage: data-fix-0.3.2 - completed: - hackage: filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 + hackage: hashable-1.4.3.0@sha256:f3bf68acfa0df7a064a378ef2cdcfeb55e6fb96100675f4c593556dcbf3d7194,4718 pantry-tree: - sha256: a5feb33f17ff131a5bba009abae35761594d62ba6873b2f70992a48db160c9b7 - size: 2274 + sha256: abef0611d6a717ba351317bdb603ef536659e7767a49ba81b2dbe20994065c7d + size: 1248 original: - hackage: filepath-1.5.3.0@sha256:0c64bc9a4f5946c86a8f0527bf40c8ba51e2c02d36eea0e20ea558c8d94166e8,4945 + hackage: hashable-1.4.3.0 - completed: - hackage: process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 + hackage: semialign-1.3@sha256:7be9ef5ca1d6b052991f68c053aab68b9d1ab3b1938c9557ac84c97937815223,2888 pantry-tree: - sha256: 14d1e9a5ec731766e43c7eb9c2dc59a7da48d98d43374d9d83e725d8891c6173 - size: 1789 + sha256: e5daa7e0023dabb1b21a04bf084364b94e45e81b380e950b90f51294a1990b87 + size: 537 original: - hackage: process-1.6.20.0@sha256:2a9393de33f18415fb8f4826957a87a94ffe8840ca8472a9b69dca6de45aca03,2790 + hackage: semialign-1.3 - completed: - hackage: unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 + hackage: text-short-0.1.5@sha256:9c73c9c9182ca69ee92ce3758f515b1c078cd167d882ccc8c46f92f68c65e190,3216 pantry-tree: - sha256: b961320db69795a16c4ef4eebb0a3e7ddbbbe506fa1e22dde95ee8d8501bfbe5 - size: 5821 + sha256: d3dcfee9029cd3624a788a0e65f0dea588ae0446a8a75a27d6b6164b8ee0fd57 + size: 727 original: - hackage: unix-2.8.5.1@sha256:3f702a252a313a7bcb56e3908a14e7f9f1b40e41b7bdc8ae8a9605a1a8686f06,9808 + hackage: text-short-0.1.5 +- completed: + hackage: these-1.2@sha256:011e22f6891ca028f87c04ea48796696c92d593313a9c699f7ff4f9ffd7aec6e,2882 + pantry-tree: + sha256: 37483703ce7326c07608b06f2f741fb0f708cb06bd10ec57d87108d068046b05 + size: 351 + original: + hackage: these-1.2 snapshots: - completed: - sha256: acaab6ca693211938d1542abcb1c83a2f298b9f6b571854a9d38febe39b6408e - size: 719577 - url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/31.yaml - original: lts-22.31 + sha256: 417fa04a2ed8916cdae74c475ff97ac80857fed5000f19dce4f9564b5e635294 + size: 720000 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/32.yaml + original: lts-22.32