Unix library apparently broken

My !8750 builds are failing in the Unix library with the "pattern match is redundant" message below. And indeed the pattern match is redundant. Here's the .hs version of the file unpackRLimit :: CRLim -> ResourceLimit unpackRLimit (18446744073709551615) = ResourceLimitInfinity {-# LINE 101 "libraries/unix/System/Posix/Resource.hsc" #-} unpackRLimit other {-# LINE 103 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 104 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 105 "libraries/unix/System/Posix/Resource.hsc" #-} {-# LINE 106 "libraries/unix/System/Posix/Resource.hsc" #-} {-# LINE 107 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 108 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 109 "libraries/unix/System/Posix/Resource.hsc" #-} {-# LINE 110 "libraries/unix/System/Posix/Resource.hsc" #-} | otherwise = ResourceLimit (fromIntegral other) The red line means that the blue lines will fail. So the warning looks correct. But it's stopping my CI from working. I have no idea why this doesn't happen in HEAD. Can anyone help? Thanks Simon Command line: _build/stage0/bin/aarch64-linux-gnu-ghc -Wall -Wcompat -fdiagnostics-color=never -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id unix-2.7.2.2' '-package-id base-4.17.0.0' '-package-id bytestring-0.11.3.1' '-package-id time-1.12.2' -i -i/builds/ghc/ghc/_build/stage1/libraries/unix/build -i/builds/ghc/ghc/_build/stage1/libraries/unix/build/autogen -i/builds/ghc/ghc/libraries/unix -Irts/include -I_build/stage1/libraries/unix/build -I_build/stage1/libraries/unix/build/include -Ilibraries/unix/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/time-1.12.2/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/bytestring-0.11.3.1/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/base-4.17.0.0/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/ghc-bignum-1.3/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/rts-1.0.2/include -optP-include -optP_build/stage1/libraries/unix/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/unix/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c _build/stage1/libraries/unix/build/System/Posix/Resource.hs -o _build/stage1/libraries/unix/build/System/Posix/Resource.o -fllvm-fill-undef-with-garbage -dno-debug-output -Wall -XHaskell2010 -no-global-package-db -package-db=/builds/ghc/ghc/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O -Wno-deprecated-flags -Werror -dlint ===> Command failed with error code: 1 libraries/unix/System/Posix/Resource.hsc:107:7: error: [-Woverlapping-patterns, -Werror=overlapping-patterns] Pattern match is redundant In an equation for ‘unpackRLimit’: unpackRLimit other | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && other == (18446744073709551615) = ... | 107 | | ((#const RLIM_SAVED_CUR) :: CRLim) /= (#const RLIM_INFINITY) && | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

Hi Simon, This is due to my patch 4786acf7 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... landing, which means GHC does better at recognising the redundant pattern match. That MR also updated the unix submodule, in order to suppress that pattern match warning. So I would guess that you have not updated the unix submodule after rebasing your MR; perhaps try "git submodule update"? The unix submodule is currently on commit 2a6079a2 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... . Hope that helps, Sam On Tue, 6 Sept 2022 at 17:52, Simon Peyton Jones < simon.peytonjones@gmail.com> wrote:
My !8750 builds are failing in the Unix library with the "pattern match is redundant" message below.
And indeed the pattern match is redundant. Here's the .hs version of the file
unpackRLimit :: CRLim -> ResourceLimit unpackRLimit (18446744073709551615) = ResourceLimitInfinity {-# LINE 101 "libraries/unix/System/Posix/Resource.hsc" #-} unpackRLimit other
{-# LINE 103 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 104 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 105 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 106 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 107 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 108 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 109 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 110 "libraries/unix/System/Posix/Resource.hsc" #-} | otherwise = ResourceLimit (fromIntegral other)
The red line means that the blue lines will fail.
So the warning looks correct. But it's stopping my CI from working. I have no idea why this doesn't happen in HEAD. Can anyone help?
Thanks
Simon
Command line: _build/stage0/bin/aarch64-linux-gnu-ghc -Wall -Wcompat -fdiagnostics-color=never -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id unix-2.7.2.2' '-package-id base-4.17.0.0' '-package-id bytestring-0.11.3.1' '-package-id time-1.12.2' -i -i/builds/ghc/ghc/_build/stage1/libraries/unix/build -i/builds/ghc/ghc/_build/stage1/libraries/unix/build/autogen -i/builds/ghc/ghc/libraries/unix -Irts/include -I_build/stage1/libraries/unix/build -I_build/stage1/libraries/unix/build/include -Ilibraries/unix/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/time-1.12.2/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/bytestring-0.11.3.1/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/base-4.17.0.0/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/ghc-bignum-1.3/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/rts-1.0.2/include -optP-include -optP_build/stage1/libraries/unix/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/unix/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c _build/stage1/libraries/unix/build/System/Posix/Resource.hs -o _build/stage1/libraries/unix/build/System/Posix/Resource.o -fllvm-fill-undef-with-garbage -dno-debug-output -Wall -XHaskell2010 -no-global-package-db -package-db=/builds/ghc/ghc/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O -Wno-deprecated-flags -Werror -dlint ===> Command failed with error code: 1 libraries/unix/System/Posix/Resource.hsc:107:7: error: [-Woverlapping-patterns, -Werror=overlapping-patterns] Pattern match is redundant In an equation for ‘unpackRLimit’: unpackRLimit other | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && other == (18446744073709551615) = ... | 107 | | ((#const RLIM_SAVED_CUR) :: CRLim) /= (#const RLIM_INFINITY) && | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Thanks, good to know. Yes, I did git submodule update. I'll look again
tomorrow
S
On Tue, 6 Sept 2022 at 17:27, Sam Derbyshire
Hi Simon,
This is due to my patch 4786acf7 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... landing, which means GHC does better at recognising the redundant pattern match. That MR also updated the unix submodule, in order to suppress that pattern match warning.
So I would guess that you have not updated the unix submodule after rebasing your MR; perhaps try "git submodule update"? The unix submodule is currently on commit 2a6079a2 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... .
Hope that helps,
Sam
On Tue, 6 Sept 2022 at 17:52, Simon Peyton Jones < simon.peytonjones@gmail.com> wrote:
My !8750 builds are failing in the Unix library with the "pattern match is redundant" message below.
And indeed the pattern match is redundant. Here's the .hs version of the file
unpackRLimit :: CRLim -> ResourceLimit unpackRLimit (18446744073709551615) = ResourceLimitInfinity {-# LINE 101 "libraries/unix/System/Posix/Resource.hsc" #-} unpackRLimit other
{-# LINE 103 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 104 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 105 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 106 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 107 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 108 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 109 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 110 "libraries/unix/System/Posix/Resource.hsc" #-} | otherwise = ResourceLimit (fromIntegral other)
The red line means that the blue lines will fail.
So the warning looks correct. But it's stopping my CI from working. I have no idea why this doesn't happen in HEAD. Can anyone help?
Thanks
Simon
Command line: _build/stage0/bin/aarch64-linux-gnu-ghc -Wall -Wcompat -fdiagnostics-color=never -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id unix-2.7.2.2' '-package-id base-4.17.0.0' '-package-id bytestring-0.11.3.1' '-package-id time-1.12.2' -i -i/builds/ghc/ghc/_build/stage1/libraries/unix/build -i/builds/ghc/ghc/_build/stage1/libraries/unix/build/autogen -i/builds/ghc/ghc/libraries/unix -Irts/include -I_build/stage1/libraries/unix/build -I_build/stage1/libraries/unix/build/include -Ilibraries/unix/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/time-1.12.2/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/bytestring-0.11.3.1/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/base-4.17.0.0/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/ghc-bignum-1.3/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/rts-1.0.2/include -optP-include -optP_build/stage1/libraries/unix/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/unix/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c _build/stage1/libraries/unix/build/System/Posix/Resource.hs -o _build/stage1/libraries/unix/build/System/Posix/Resource.o -fllvm-fill-undef-with-garbage -dno-debug-output -Wall -XHaskell2010 -no-global-package-db -package-db=/builds/ghc/ghc/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O -Wno-deprecated-flags -Werror -dlint ===> Command failed with error code: 1 libraries/unix/System/Posix/Resource.hsc:107:7: error: [-Woverlapping-patterns, -Werror=overlapping-patterns] Pattern match is redundant In an equation for ‘unpackRLimit’: unpackRLimit other | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && other == (18446744073709551615) = ... | 107 | | ((#const RLIM_SAVED_CUR) :: CRLim) /= (#const RLIM_INFINITY) && | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Thanks Sam. As you'll see on !8750 pointing to the right commit seems to have fixed !8750. I think I must have inadvertently committed a wrong unix-library submodule change. I'm not very clear on - Given a particular 'master' commit C from the main GHC repo (e.g. I've rebased my patch on C) - How do I identify the 'unix' commit that C needs? It might not be the head of the unix repo. Simon On Tue, 6 Sept 2022 at 19:40, Simon Peyton Jones < simon.peytonjones@gmail.com> wrote:
Thanks, good to know. Yes, I did git submodule update. I'll look again tomorrow
S
On Tue, 6 Sept 2022 at 17:27, Sam Derbyshire
wrote: Hi Simon,
This is due to my patch 4786acf7 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... landing, which means GHC does better at recognising the redundant pattern match. That MR also updated the unix submodule, in order to suppress that pattern match warning.
So I would guess that you have not updated the unix submodule after rebasing your MR; perhaps try "git submodule update"? The unix submodule is currently on commit 2a6079a2 https://gitlab.haskell.org/ghc/ghc/-/commit/4786acf758ef064d3b79593774d1672e... .
Hope that helps,
Sam
On Tue, 6 Sept 2022 at 17:52, Simon Peyton Jones < simon.peytonjones@gmail.com> wrote:
My !8750 builds are failing in the Unix library with the "pattern match is redundant" message below.
And indeed the pattern match is redundant. Here's the .hs version of the file
unpackRLimit :: CRLim -> ResourceLimit unpackRLimit (18446744073709551615) = ResourceLimitInfinity {-# LINE 101 "libraries/unix/System/Posix/Resource.hsc" #-} unpackRLimit other
{-# LINE 103 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 104 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 105 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 106 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 107 "libraries/unix/System/Posix/Resource.hsc" #-} | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && {-# LINE 108 "libraries/unix/System/Posix/Resource.hsc" #-} other == (18446744073709551615) = ResourceLimitUnknown {-# LINE 109 "libraries/unix/System/Posix/Resource.hsc" #-}
{-# LINE 110 "libraries/unix/System/Posix/Resource.hsc" #-} | otherwise = ResourceLimit (fromIntegral other)
The red line means that the blue lines will fail.
So the warning looks correct. But it's stopping my CI from working. I have no idea why this doesn't happen in HEAD. Can anyone help?
Thanks
Simon
Command line: _build/stage0/bin/aarch64-linux-gnu-ghc -Wall -Wcompat -fdiagnostics-color=never -dynamic-too -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-env -' '-package-db _build/stage1/lib/package.conf.d' '-this-unit-id unix-2.7.2.2' '-package-id base-4.17.0.0' '-package-id bytestring-0.11.3.1' '-package-id time-1.12.2' -i -i/builds/ghc/ghc/_build/stage1/libraries/unix/build -i/builds/ghc/ghc/_build/stage1/libraries/unix/build/autogen -i/builds/ghc/ghc/libraries/unix -Irts/include -I_build/stage1/libraries/unix/build -I_build/stage1/libraries/unix/build/include -Ilibraries/unix/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/time-1.12.2/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/bytestring-0.11.3.1/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/base-4.17.0.0/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/ghc-bignum-1.3/include -I/builds/ghc/ghc/_build/stage1/lib/aarch64-linux-ghc-9.5.20220906/rts-1.0.2/include -optP-include -optP_build/stage1/libraries/unix/build/autogen/cabal_macros.h -outputdir _build/stage1/libraries/unix/build -Wnoncanonical-monad-instances -optc-Wno-error=inline -optP-Wno-nonportable-include-path -c _build/stage1/libraries/unix/build/System/Posix/Resource.hs -o _build/stage1/libraries/unix/build/System/Posix/Resource.o -fllvm-fill-undef-with-garbage -dno-debug-output -Wall -XHaskell2010 -no-global-package-db -package-db=/builds/ghc/ghc/_build/stage1/lib/package.conf.d -ghcversion-file=rts/include/ghcversion.h -ghcversion-file=rts/include/ghcversion.h -O -Wno-deprecated-flags -Werror -dlint ===> Command failed with error code: 1 libraries/unix/System/Posix/Resource.hsc:107:7: error: [-Woverlapping-patterns, -Werror=overlapping-patterns] Pattern match is redundant In an equation for ‘unpackRLimit’: unpackRLimit other | ((18446744073709551615) :: CRLim) /= (18446744073709551615) && other == (18446744073709551615) = ... | 107 | | ((#const RLIM_SAVED_CUR) :: CRLim) /= (#const RLIM_INFINITY) && | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^... _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (2)
-
Sam Derbyshire
-
Simon Peyton Jones