GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2019-07-07T19:14:45Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/1196Cabal on Windows doesn't like the in-place GHCs2019-07-07T19:14:45ZIan Lynagh <igloo@earth.li>Cabal on Windows doesn't like the in-place GHCsFrom e.g. a cmd prompt, Windows doesn't like the in-place GHCs:
```
C:\>C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage2\ghc-inplace
'C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage2\ghc-inplace' is not recognized as an in...From e.g. a cmd prompt, Windows doesn't like the in-place GHCs:
```
C:\>C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage2\ghc-inplace
'C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage2\ghc-inplace' is not recognized as an internal or external command, operable program or batch file.
C:\>cat C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage2\ghc-inplace
#!/bin/sh
exec C:/cygwin/home/ian/ghc/6.6-branch/build/compiler/stage2/ghc -BC:\\\\cygwin\\\\home\\\\ian\\\\ghc\\\\6.6-branch\\\\build "$@"
```
which means the cabal01 test fails thus:
```
$ ./setup configure --prefix=`pwd`/install --with-compiler=C:/cygwin/home/ian/ghc/6.6-branch/build/compiler/stage1/ghc-inplace --with-hc-pkg=../../../../../utils/ghc-pkg/ghc-pkg-inplace --enable-library-profiling
setup.exe: Warning: Package is copyright All Rights Reserved
setup.exe: Warning: No license-file field.
'C:\cygwin\home\ian\ghc\6.6-branch\build\compiler\stage1\ghc-inplace' is not recognized as an internal or external command,
operable program or batch file.
Configuring test-1.0...
```
(the odd output order is due to buffering)
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | ------------ |
| Version | 6.6 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | cabal01 |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture | Unknown |
</details>
<!-- {"blocked_by":[],"summary":"Cabal on Windows doesn't like the in-place GHCs","status":"New","operating_system":"","component":"Compiler","related":[],"milestone":"_|_","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"6.6","keywords":[],"differentials":[],"test_case":"cabal01","architecture":"Unknown","cc":[""],"type":"Bug","description":"From e.g. a cmd prompt, Windows doesn't like the in-place GHCs:\r\n{{{\r\nC:\\>C:\\cygwin\\home\\ian\\ghc\\6.6-branch\\build\\compiler\\stage2\\ghc-inplace\r\n'C:\\cygwin\\home\\ian\\ghc\\6.6-branch\\build\\compiler\\stage2\\ghc-inplace' is not recognized as an internal or external command, operable program or batch file.\r\n\r\nC:\\>cat C:\\cygwin\\home\\ian\\ghc\\6.6-branch\\build\\compiler\\stage2\\ghc-inplace\r\n#!/bin/sh\r\nexec C:/cygwin/home/ian/ghc/6.6-branch/build/compiler/stage2/ghc -BC:\\\\\\\\cygwin\\\\\\\\home\\\\\\\\ian\\\\\\\\ghc\\\\\\\\6.6-branch\\\\\\\\build \"$@\"\r\n}}}\r\nwhich means the cabal01 test fails thus:\r\n{{{\r\n$ ./setup configure --prefix=`pwd`/install --with-compiler=C:/cygwin/home/ian/ghc/6.6-branch/build/compiler/stage1/ghc-inplace --with-hc-pkg=../../../../../utils/ghc-pkg/ghc-pkg-inplace --enable-library-profiling\r\nsetup.exe: Warning: Package is copyright All Rights Reserved\r\nsetup.exe: Warning: No license-file field.\r\n'C:\\cygwin\\home\\ian\\ghc\\6.6-branch\\build\\compiler\\stage1\\ghc-inplace' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nConfiguring test-1.0...\r\n}}}\r\n(the odd output order is due to buffering)","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>https://gitlab.haskell.org/ghc/ghc/-/issues/1219RULE for take is too strict2019-07-07T19:14:38ZSimon Peyton JonesRULE for take is too strict```
main = print (map (const 'x') (take 1 (undefined:undefined)))
```
In ghci, or with ghc -O0, this produces `"x"`. With ghc -O, this produces `Prelude.undefined`. Kirsten Chevalier found that the culprit is the RULE:
```
"take" [...```
main = print (map (const 'x') (take 1 (undefined:undefined)))
```
In ghci, or with ghc -O0, this produces `"x"`. With ghc -O, this produces `Prelude.undefined`. Kirsten Chevalier found that the culprit is the RULE:
```
"take" [~1] forall n xs . take n xs
= case n of I# n# -> build (\c nil -> foldr (takeFB c nil)
(takeConst nil) xs n#)
```
This rule makes `take` strict in `xs`, but it should be lazy when `n`=0.
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 6.6 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |
</details>
<!-- {"blocked_by":[],"summary":"RULE for take is too strict","status":"New","operating_system":"Unknown","component":"libraries/base","related":[],"milestone":"6.6.1","resolution":"Unresolved","owner":{"tag":"OwnedBy","contents":"simonmar"},"version":"6.6","keywords":[],"differentials":[],"test_case":"","architecture":"Unknown","cc":[""],"type":"Bug","description":"{{{\r\nmain = print (map (const 'x') (take 1 (undefined:undefined)))\r\n}}}\r\nIn ghci, or with ghc -O0, this produces `\"x\"`. With ghc -O, this produces `Prelude.undefined`. Kirsten Chevalier found that the culprit is the RULE:\r\n{{{\r\n\"take\" [~1] forall n xs . take n xs \r\n = case n of I# n# -> build (\\c nil -> foldr (takeFB c nil) \r\n (takeConst nil) xs n#)\r\n}}}\r\nThis rule makes `take` strict in `xs`, but it should be lazy when `n`=0.","type_of_failure":"OtherFailure","blocking":[]} -->6.6.1Ian Lynagh <igloo@earth.li>Ian Lynagh <igloo@earth.li>