-
Notifications
You must be signed in to change notification settings - Fork 704
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
cabal-install 3.14 linking fails with "shared object file not found" #10759
Comments
I can reproduce this locally. |
Is there a reason in particular you are running |
The issue appears to be that when Then the |
Yes, I believe this test needs cabal exec because it shells out to ghc: https://github.com/brandonchinn178/aeson-schemas/blob/main/test%2FTests%2FGetQQ.hs#L414 There might be other tests too. Removing cabal exec should see failures |
The |
@brandonchinn178 I can't reproduce with cabal-install at commit - 5a21af6 .. possibly already fixed. With 3.14.1.0 I see "configuration changed" as the reason it has decided to rebuild. Perhaps another way to implement this would be The |
Good news is I can reproduce with a locally built 3.14.1.1 cabal-install. |
The reason why it thinks that the configuration has changed is because when
|
Therefore I think this is the same issue as #10692 which was fixed by #10731. However, the real issue is arguably that GHC called by |
I think that makes sense, thanks for investigating! Are there any plans for 3.14.1.2? |
Issue #10759 highlighted the issue that we were not isolating the calls to ghc from the existence of environment files. This manifested in a terminal bug where extra arguments form the environment file were causing a link failure which was due to a combination of #10692. However, even before this bug the test executable was relinked to due to the extra flags from the environment file. ``` Building test suite 'aeson-schemas-test' for aeson-schemas-1.4.2.1... Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 [23 of 23] Linking /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/build/x86_64-linux/ghc-9.6.6/aeson-schemas-1.4.2.1/t/aeson-schemas-test/build/aeson-schemas-test/aeson-schemas-test [Flags changed] ``` The correct solution is that calls to `ghc` made by `Cabal` should never implicitly use an environment file. This is similar to how `GHC_PACKAGE_PATH` is treated. Fixes #10759
The test tries to run `cabal` in an environment where `GHC_ENVIRONMENT` is set, and checks that the compilation of a simple package isn't affected by the variable being set.
Issue #10759 highlighted the issue that we were not isolating the calls to ghc from the existence of environment files. This manifested in a terminal bug where extra arguments form the environment file were causing a link failure which was due to a combination of #10692. However, even before this bug the test executable was relinked to due to the extra flags from the environment file. ``` Building test suite 'aeson-schemas-test' for aeson-schemas-1.4.2.1... Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 [23 of 23] Linking /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/build/x86_64-linux/ghc-9.6.6/aeson-schemas-1.4.2.1/t/aeson-schemas-test/build/aeson-schemas-test/aeson-schemas-test [Flags changed] ``` The correct solution is that calls to `ghc` made by `Cabal` should never implicitly use an environment file. This is similar to how `GHC_PACKAGE_PATH` is treated. Fixes #10759
The test tries to run `cabal` in an environment where `GHC_ENVIRONMENT` is set, and checks that the compilation of a simple package isn't affected by the variable being set.
Issue #10759 highlighted the issue that we were not isolating the calls to ghc from the existence of environment files. This manifested in a terminal bug where extra arguments form the environment file were causing a link failure which was due to a combination of #10692. However, even before this bug the test executable was relinked to due to the extra flags from the environment file. ``` Building test suite 'aeson-schemas-test' for aeson-schemas-1.4.2.1... Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 Loaded package environment from /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/tmp/environment.-69233/.ghc.environment.x86_64-linux-9.6.6 [23 of 23] Linking /home/runner/work/aeson-schemas/aeson-schemas/dist-newstyle/build/x86_64-linux/ghc-9.6.6/aeson-schemas-1.4.2.1/t/aeson-schemas-test/build/aeson-schemas-test/aeson-schemas-test [Flags changed] ``` The correct solution is that calls to `ghc` made by `Cabal` should never implicitly use an environment file. This is similar to how `GHC_PACKAGE_PATH` is treated. Fixes #10759
The test tries to run `cabal` in an environment where `GHC_ENVIRONMENT` is set, and checks that the compilation of a simple package isn't affected by the variable being set.
Describe the bug
In my project, if I use the latest version of cabal-install in CI (3.14), I get a failure, but CI passes when pinning cabal-install to 3.12. PR: brandonchinn178/aeson-schemas#99. My project seems like a pretty normal library+executable+benchmark project, without anything special like compiler plugins. I'm running a simple
cabal build && cabal exec -- cabal test
. I can't repro locally.CI logs:
One difference in 3.14 is it says "
cabal_macros.h
changed", presumably why it's rebuilding. Printing outcabal_macros.h
before and after, I think the change ishappy
is not included aftercabal build
, but is included in the subsequentcabal exec -- cabal test
. I don't use or declare happy anywhere in my cabal file, but it looks like a dependency,haskell-src-exts
, uses it.I do see this error message reported in other issues, including #8580 which I reported, but I'm reporting this separately because it looks like a possible regression between 3.12 and 3.14, instead of something I'm doing wrong.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should succeed
System information
cabal
,ghc
versionsAdditional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: