-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag to workaround GHC heisenbug on CI #2444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe instead of -fworkaround-heisenbug
, call it -fworkaround-ghc19421
?
.ci/cabal.project.local
Outdated
@@ -10,7 +10,7 @@ package * | |||
|
|||
package clash-prelude | |||
ghc-options: -Werror | |||
flags: +doctests +multiple-hidden | |||
flags: +doctests +multiple-hidden -workaround-heisenbug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want +workaround-heisenbug
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that would set it for all GHC versions. .ci/setup.sh
turns it on just for GHC 9.0.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that workaround-ghc19421
is more specific then workaround-heisenbug
.
But I still hate it, the name is meaningless to my mind.
And also confusingly if one were to read the GHC-9.0.2 release notes, it lists 19421 as fixed.
I propose something like workaround-ghc-mmap-crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty strong word for such a minor thing 😅.
Suggestion seems fine to me. Approved the PR too.
d56e4e6
to
d35ba0c
Compare
In very specific tests in GitLab CI we are affected by GHC bug #19421. We can work around the issue by passing `-with-rtsopts=-xm20000000` when compiling an affected binary. This is a stopgap measure until the real bug is fixed. We have seen the bug: - In `clash-testsuite` in `clashLibTest`s - In `ffi:example` in the `clash` binary itself - In `prelude:doctests`, probably in the `doctests` binary itself, although this is not certain. and then only in GHC 9.0.2, although the bug should be in other versions of GHC as well. This workaround was applied only to GHC 9.0.2 on CI and only to those cases that were observed to go wrong, although as a consequence now the `clash` binary is always built with the RTS option. The `ffi:example` test should no longer be affected by the GHC bug, but it is a fairly useless test in its current state as it does not fail when there are issues, and the tested code is actually faulty. It is disabled to be fixed later.
d35ba0c
to
9c3619d
Compare
If people like the new version, feel free to merge and get this show on the road again! |
I tried to determine this but the bug is being a cute little heisenbug. I can't even reproduce locally at all, it mainly happens on CI. I tried passing |
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
This works around multiple issues: * https://gitlab.haskell.org/ghc/ghc/-/issues/19421 * https://discourse.haskell.org/t/facing-mmap-4096-bytes-at-nil-cannot-allocate-memory-youre-not-alone/6259 Also see: * clash-lang/clash-compiler#2566 * clash-lang/clash-compiler#2444
This works around multiple issues: * https://gitlab.haskell.org/ghc/ghc/-/issues/19421 * https://discourse.haskell.org/t/facing-mmap-4096-bytes-at-nil-cannot-allocate-memory-youre-not-alone/6259 Also see: * clash-lang/clash-compiler#2566 * clash-lang/clash-compiler#2444
In very specific tests in GitLab CI we are affected by GHC bug #19421. We can work around the issue by passing `-with-rtsopts=-xm20000000` when compiling an affected binary. This is a stopgap measure until the real bug is fixed. We have seen the bug: - In `clash-testsuite` in `clashLibTest`s - In `ffi:example` in the `clash` binary itself - In `prelude:doctests`, probably in the `doctests` binary itself, although this is not certain. and then only in GHC 9.0.2, although the bug should be in other versions of GHC as well. This workaround was applied only to GHC 9.0.2 on CI and only to those cases that were observed to go wrong, although as a consequence now the `clash` binary is always built with the RTS option. The `ffi:example` test should no longer be affected by the GHC bug, but it is a fairly useless test in its current state as it does not fail when there are issues, and the tested code is actually faulty. It is disabled to be fixed later.
PR #2444 added a workaround for GitLab CI, but it is also needed on the GitHub CI we run for external contributions.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll ignore just the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll just ignore the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll just ignore the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll just ignore the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll just ignore the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll just ignore the GHCRTS.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll error out that the GHCRTS contains unsupported options.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll error out that the GHCRTS contains unsupported options.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll error out that the GHCRTS contains unsupported options.
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll error out that the GHCRTS contains unsupported options. (cherry picked from commit 9914030) # Conflicts: # .ci/cabal.project.local # .ci/gitlab/common.yml # .ci/gitlab/test.yml # clash-cores/clash-cores.cabal # clash-ffi/clash-ffi.cabal # clash-lib/clash-lib.cabal # nix/overlay.nix # tests/src/Test/Tasty/Clash.hs
In PRs #2444 we added the workaround-ghc-mmap-crash flag on some of our packages. That flag added `-with-rtsopts=-xm20000000` to some of our binaries. But other binaries would occasionally still trigger the mmap bug, most importantly ghc itself. This commit undoes the previous way of applying the workaround and applies the same `-xm20000000` RTS option everywhere via the GHCRTS environment variable. But for this to work we have to link all binaries with the `-rtsopts` flag, otherwise they'll error out that the GHCRTS contains unsupported options.
In very specific tests in GitLab CI we are affected by GHC bug #19421. We can work around the issue by passing
-with-rtsopts=-xm20000000
when compiling an affected binary. This is a stopgap measure until the real bug is fixed.We have seen the bug:
clash-testsuite
inclashLibTest
sffi:example
in theclash
binary itselfprelude:doctests
, probably in thedoctests
binary itself, although this is not certain.and then only in GHC 9.0.2, although the bug should be in other versions of GHC as well.
This workaround was applied only to GHC 9.0.2 on CI and only to those cases that were observed to go wrong, although as a consequence now the
clash
binary is always built with the RTS option.I tried to limit applying this RTS option as much as possible because of the documentation:
Our problem has nothing to do whatsoever with GHCi, but even if we ignore that, it still says "do not use unless". It would be possible to restrict the building of the
clash
binary with the option to justffi:example
, by giving it its own specialcabal.project.local
, but I did not take it that far in this PR.The
ffi:example
test should no longer be affected by the GHC bug, but it is a fairly useless test in its current state as it does not fail when there are issues, and the tested code is actually faulty. It is disabled to be fixed later.Still TODO:
Write a changelog entry (see changelog/README.md)Check copyright notices are up to date in edited filesThis is a temporary CI workaround. The sooner it is removed, the better. No need for copyright messages if the code is soon to be removed again.