Skip to content

Fix integration test for mutable-deps#4612

Merged
snoyberg merged 2 commits intocommercialhaskell:masterfrom
psibi:test-mutable-deps
Mar 7, 2019
Merged

Fix integration test for mutable-deps#4612
snoyberg merged 2 commits intocommercialhaskell:masterfrom
psibi:test-mutable-deps

Conversation

@psibi
Copy link
Copy Markdown
Member

@psibi psibi commented Mar 7, 2019

Without this, this results in an build error like this:

$ ./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

Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.

Please include the following checklist in your PR:

  • Any changes that could be relevant to users have been recorded in the ChangeLog.md
  • The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests!

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
```
@psibi psibi requested a review from qrilka March 7, 2019 11:48
@psibi
Copy link
Copy Markdown
Member Author

psibi commented Mar 7, 2019

@qrilka Looking at the current build failure, I see why you added that line now. :-)

@qrilka
Copy link
Copy Markdown
Contributor

qrilka commented Mar 7, 2019

@psibi this should work -

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 5a431e66..54a38c37 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,7 +1,3 @@
-{-# ANN module "HLint: ignore" #-}
-#if __GLASGOW_HASKELL__ >= 704
-{-# LANGUAGE Safe #-}
-#endif
 {-# LANGUAGE PatternGuards #-}
 
 -- This template expects CPP definitions for:
@@ -147,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 "/"
 
@@ -1026,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)

It looks that GHC doesn't like annotations to be combined with Safe mode, see https://ghc.haskell.org/trac/ghc/ticket/10826

@psibi
Copy link
Copy Markdown
Member Author

psibi commented Mar 7, 2019

@qrilka Thanks, pushed a new commit fixing this.

@snoyberg snoyberg merged commit 311b6f8 into commercialhaskell:master Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants