Skip to content
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

Avoid spurious warnings from -with-rtsopts (fix #4255) #8183

Merged
merged 1 commit into from
Jun 1, 2022

Conversation

ulysses4ever
Copy link
Collaborator

@ulysses4ever ulysses4ever commented May 31, 2022

Fix #4255.

Please include the following checklist in your PR:

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

@ulysses4ever ulysses4ever force-pushed the t4255 branch 2 times, most recently from cb4c34d to 0dd5ee6 Compare May 31, 2022 02:52
Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Any chance of a tiny test (one that breaks currently, works with this patch)?

@ulysses4ever ulysses4ever force-pushed the t4255 branch 2 times, most recently from e436535 to 1b4691a Compare May 31, 2022 15:56
@ulysses4ever
Copy link
Collaborator Author

@Mikolaj a test added. Not sure how to show that it fails without the patch :-)

@Mikolaj
Copy link
Member

Mikolaj commented May 31, 2022

@Mikolaj a test added. Not sure how to show that it fails without the patch :-)

With hand gestures.

Does it fail?

Comment on lines +3 to +6
-- Test that setup shows all the 'autogen-modules' warnings.
main = setupAndCabalTest $ do
setup' "configure" [] >>=
assertOutputDoesNotContain "Warning: Instead of 'ghc-options: -I0' use 'include-dirs: 0'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the behaviour without your fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is documented in #4255 and reproduces today.

@ulysses4ever
Copy link
Collaborator Author

ulysses4ever commented May 31, 2022

Ok, I moved back one commit, here's the test (not very user-friendly, but notice "unexpected: Warning:"):

Console output
❯ set CABAL (cabal list-bin cabal-install:exe:cabal)
❯ cabal run cabal-testsuite:cabal-tests -j  -- --hide-successes --with-cabal="$CABAL" cabal-testsuite/PackageTests/RtsOptsClean/setup.test.
hs
Up to date
/nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/runghc-9.0.2 -- '--ghc-arg=-i' '--ghc-arg=-no-user-package-db' '--ghc-arg=-package-db' '--ghc-arg=/home/artem/.cabal/store/ghc-9.0.2/package.db' '--ghc-arg=-package-db' '--ghc-arg=/home/artem/tmp/cabal-t4255/cabal/dist-newstyle/packagedb/ghc-9.0.2' '--ghc-arg=-package-id' '--ghc-arg=Cabal-3.9.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=Cabal-syntax-3.9.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=async-2.2.4-2b04cd6dcc0fc474e0072aec3462b9c67410113d7befe87d8f668b6a29dfe996' '--ghc-arg=-package-id' '--ghc-arg=base-4.15.1.0' '--ghc-arg=-package-id' '--ghc-arg=cabal-testsuite-3-inplace' '--ghc-arg=-package-id' '--ghc-arg=clock-0.8.3-12cb68ccaf6e6206378be8082c1ee7435ae9bbce4022f1012bd6cd3e5c8fc2aa' '--ghc-arg=-package-id' '--ghc-arg=exceptions-0.10.4' '--ghc-arg=-package-id' '--ghc-arg=filepath-1.4.2.1' '--ghc-arg=-package-id' '--ghc-arg=optparse-applicative-0.16.1.0-9e7223777ec2ceb7173a7dd6cbfd171b59645863397baa0f7de31642a7210566' '--ghc-arg=-package-id' '--ghc-arg=process-1.6.13.2' '--ghc-arg=-package-id' '--ghc-arg=transformers-0.5.6.2' cabal-testsuite/PackageTests/RtsOptsClean/setup.test.hs --builddir /home/artem/tmp/cabal-t4255/cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/cabal-testsuite-3 cabal-testsuite/PackageTests/RtsOptsClean/setup.test.hs --with-cabal /home/artem/tmp/cabal-t4255/cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/cabal-install-3.9.0.0/x/cabal/build/cabal/cabal
# Setup configure
+ /home/artem/tmp/cabal-t4255/cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/cabal-testsuite-3/build/setup/setup configure '-vverbose +markoutput +nowrap' --distdir setup.dist/work/dist --global --with-ghc /run/current-system/sw/bin/ghc --with-haddock /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/haddock-ghc-9.0.2 --enable-deterministic '--prefix=/home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr' '--package-db=clear' '--package-db=global' '--package-db=/home/artem/.cabal/store/ghc-9.0.2/package.db' '--package-db=/home/artem/tmp/cabal-t4255/cabal/dist-newstyle/packagedb/ghc-9.0.2'
Using Parsec parser
-----BEGIN CABAL OUTPUT-----
Configuring RtsOptsClean-0.1...
-----END CABAL OUTPUT-----
-----BEGIN CABAL OUTPUT-----
Warning: Instead of 'ghc-options: -I0' use 'include-dirs: 0'
-----END CABAL OUTPUT-----
Dependency base <5.0: using base-4.15.1.0
Source component graph: component exe:RtsOptsClean
Configured component graph:
    component RtsOptsClean-0.1-RtsOptsClean include base-4.15.1.0
Linked component graph:
    unit RtsOptsClean-0.1-RtsOptsClean include base-4.15.1.0
Ready component graph:
    definite RtsOptsClean-0.1-RtsOptsClean depends base-4.15.1.0
Using Cabal-3.9.0.0 compiled by ghc-9.0
Using compiler: ghc-9.0.2
Using install prefix: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr
Executables installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/bin
Libraries installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/lib/x86_64-linux-ghc-9.0.2/RtsOptsClean-0.1
Dynamic Libraries installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/lib/x86_64-linux-ghc-9.0.2
Private executables installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/libexec/x86_64-linux-ghc-9.0.2/RtsOptsClean-0.1
Data files installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/share/x86_64-linux-ghc-9.0.2/RtsOptsClean-0.1
Documentation installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/share/doc/x86_64-linux-ghc-9.0.2/RtsOptsClean-0.1
Configuration files installed in: /home/artem/tmp/cabal-t4255/cabal/cabal-testsuite/PackageTests/RtsOptsClean/setup.dist/usr/etc
No alex found
Using ar found on system at: /nix/store/2b99rpx8zwdjjqkrvk7kqgn9mxhiidjy-binutils-2.38/bin/ar
No c2hs found
No cpphs found
No doctest found
Using gcc version 11.3.0 found on system at: /nix/store/r7r10qvsqlnvbzjkjinvscjlahqbxifl-gcc-wrapper-11.3.0/bin/cc
Using ghc version 9.0.2 given by user at: /run/current-system/sw/bin/ghc
Using ghc-pkg version 9.0.2 found on system at: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/ghc-pkg-9.0.2
No ghcjs found
No ghcjs-pkg found
No greencard found
Using haddock version 2.25.1 given by user at: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/haddock-ghc-9.0.2
No happy found
Using haskell-suite found on system at: haskell-suite-dummy-location
Using haskell-suite-pkg found on system at: haskell-suite-pkg-dummy-location
No hmake found
Using hpc version 0.68 found on system at: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/hpc
Using hsc2hs version 0.68.7 found on system at: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/hsc2hs
No hscolour found
No jhc found
Using ld found on system at: /nix/store/10h6ymfb28wx6x8amj82h2sgw3ixrsb2-binutils-wrapper-2.38/bin/ld.gold
No pkg-config found
Using runghc version 9.0.2 found on system at: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/runghc-9.0.2
Using strip version 2.38 found on system at: /nix/store/r7r10qvsqlnvbzjkjinvscjlahqbxifl-gcc-wrapper-11.3.0/bin/strip
Using tar found on system at: /nix/store/5p3qyadsv163m7zvqssiw80zh6xfv2jv-gnutar-1.34/bin/tar
No uhc found
setup.test.hs: unexpected: Warning: Instead of 'ghc-options: -I0' use 'include-dirs: 0'
CallStack (from HasCallStack):
  assertOutputDoesNotContain, called at cabal-testsuite/PackageTests/RtsOptsClean/setup.test.hs:6:10 in main:Main
cabal-tests: callProcess: /nix/store/s5z1m0b2vrfa642f513qz0r30fqmhyr2-ghc-9.0.2/bin/runghc-9.0.2 "--" "--ghc-arg=-i" "--ghc-arg=-no-user-package-db" "--ghc-arg=-package-db" "--ghc-arg=/home/artem/.cabal/store/ghc-9.0.2/package.db" "--ghc-arg=-package-db" "--ghc-arg=/home/artem/tmp/cabal-t4255/cabal/dist-newstyle/packagedb/ghc-9.0.2" "--ghc-arg=-package-id" "--ghc-arg=Cabal-3.9.0.0-inplace" "--ghc-arg=-package-id" "--ghc-arg=Cabal-syntax-3.9.0.0-inplace" "--ghc-arg=-package-id" "--ghc-arg=async-2.2.4-2b04cd6dcc0fc474e0072aec3462b9c67410113d7befe87d8f668b6a29dfe996" "--ghc-arg=-package-id" "--ghc-arg=base-4.15.1.0" "--ghc-arg=-package-id" "--ghc-arg=cabal-testsuite-3-inplace" "--ghc-arg=-package-id" "--ghc-arg=clock-0.8.3-12cb68ccaf6e6206378be8082c1ee7435ae9bbce4022f1012bd6cd3e5c8fc2aa" "--ghc-arg=-package-id" "--ghc-arg=exceptions-0.10.4" "--ghc-arg=-package-id" "--ghc-arg=filepath-1.4.2.1" "--ghc-arg=-package-id" "--ghc-arg=optparse-applicative-0.16.1.0-9e7223777ec2ceb7173a7dd6cbfd171b59645863397baa0f7de31642a7210566" "--ghc-arg=-package-id" "--ghc-arg=process-1.6.13.2" "--ghc-arg=-package-id" "--ghc-arg=transformers-0.5.6.2" "cabal-testsuite/PackageTests/RtsOptsClean/setup.test.hs" "--builddir" "/home/artem/tmp/cabal-t4255/cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/cabal-testsuite-3" "cabal-testsuite/PackageTests/RtsOptsClean/setup.test.hs" "--with-cabal" "/home/artem/tmp/cabal-t4255/cabal/dist-newstyle/build/x86_64-linux/ghc-9.0.2/cabal-install-3.9.0.0/x/cabal/build/cabal/cabal" (exit 1): failed

@ulysses4ever ulysses4ever force-pushed the t4255 branch 2 times, most recently from 4fe9aaf to 4389cc3 Compare May 31, 2022 17:56
@ulysses4ever
Copy link
Collaborator Author

After wrangling with the test suite for a bit, I have CI green finally.

@Mikolaj
Copy link
Member

Mikolaj commented May 31, 2022

Windows CI acted up, so I restarted failing jobs.

Comment on lines 1 to 2
import Distribution.Simple
main = defaultMain
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that file is no longer needed (with high enough cabal-version?).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can experiment and remove it. Would CI catch the problem if it exists?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most definitely yes. It even catches problems that don't exist (e.g., the Windows validated runs).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it: the ultimate response of a sound type checker — "reject!"

Meanwhile, CI finished green without the file.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Mikolaj
Copy link
Member

Mikolaj commented Jun 1, 2022

merge_me?

@ulysses4ever ulysses4ever added the merge me Tell Mergify Bot to merge label Jun 1, 2022
@mergify mergify bot merged commit 4cc1529 into haskell:master Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Tell Mergify Bot to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overeager ghc-options -I warning
3 participants