From 50b9f85b6531a69889538b37759a1d020bea4851 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 7 Mar 2019 17:16:45 +0530 Subject: [PATCH 1/2] Fix integration test for mutable-deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, this results in an build error like this: ``` shellsession $ ./run-single-test.sh mutable-deps Running test mutable-deps Running: /home/sibi/.local/bin/stack build directory-1.3.0.2: unregistering (missing dependencies: filepath) filemanip-0.3.6.3: unregistering (missing dependencies: directory, filepath) filepath-1.4.1.2: unregistering (local file changes: System/FilePath/Internal.hs) files-1.0.0: unregistering (missing dependencies: filemanip) filepath-1.4.1.2: configure (lib) filepath-1.4.1.2: build (lib) -- While building package filepath-1.4.1.2 using: /home/sibi/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:filepath --ghc-options " -ddump-hi -ddump-to-file" Process exited with code: ExitFailure 1 Logs have been written to: /home/sibi/github/stack/test/integration/tests/mutable-deps/files/.stack-work/logs/filepath-1.4.1.2.log Configuring filepath-1.4.1.2... Preprocessing library for filepath-1.4.1.2.. Building library for filepath-1.4.1.2.. /home/sibi/github/stack/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Posix.hs:1:1: error: File name does not match module name: Saw: ‘Main’ Expected: ‘System.FilePath.Posix’ | 1 | {-# LANGUAGE CPP #-} | ^ Main.hs: Exited with exit code: ExitFailure 1 CallStack (from HasCallStack): error, called at ../../../lib/StackTest.hs:132:14 in main:StackTest ``` --- .../files/filepath-1.4.1.2/System/FilePath/Internal.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs b/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs index 5a431e6626..4a376b33b1 100644 --- a/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs +++ b/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs @@ -1,4 +1,3 @@ -{-# ANN module "HLint: ignore" #-} #if __GLASGOW_HASKELL__ >= 704 {-# LANGUAGE Safe #-} #endif From 2c5e2360a8a23ab22044e5b24f166fcbfb0ea2b5 Mon Sep 17 00:00:00 2001 From: Sibi Prabakaran Date: Thu, 7 Mar 2019 19:20:37 +0530 Subject: [PATCH 2/2] Fix the style issue --- .../files/filepath-1.4.1.2/System/FilePath/Internal.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs b/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs index 4a376b33b1..54a38c37fa 100644 --- a/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs +++ b/test/integration/tests/mutable-deps/files/filepath-1.4.1.2/System/FilePath/Internal.hs @@ -1,6 +1,3 @@ -#if __GLASGOW_HASKELL__ >= 704 -{-# LANGUAGE Safe #-} -#endif {-# LANGUAGE PatternGuards #-} -- This template expects CPP definitions for: @@ -146,6 +143,7 @@ pathSeparator = if isWindows then '\\' else '/' -- > Windows: pathSeparators == ['\\', '/'] -- > Posix: pathSeparators == ['/'] -- > pathSeparator `elem` pathSeparators +{-# ANN pathSeparators "HLint: ignore" #-} pathSeparators :: [Char] pathSeparators = if isWindows then "\\/" else "/" @@ -1025,5 +1023,6 @@ breakEnd p = spanEnd (not . p) -- | The stripSuffix function drops the given suffix from a list. It returns -- Nothing if the list did not end with the suffix given, or Just the list -- before the suffix, if it does. +{-# ANN stripSuffix "HLint: ignore" #-} stripSuffix :: Eq a => [a] -> [a] -> Maybe [a] stripSuffix xs ys = fmap reverse $ stripPrefix (reverse xs) (reverse ys)