Skip to content

Warn when external Setup uses old Cabal #3801

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

Closed
wants to merge 1 commit into from

Conversation

ttuegel
Copy link
Member

@ttuegel ttuegel commented Sep 7, 2016

Fixes #707.

@ttuegel ttuegel added this to the 2.0 milestone Sep 7, 2016
@ttuegel ttuegel self-assigned this Sep 7, 2016
@mention-bot
Copy link

@ttuegel, thanks for your PR! By analyzing the annotation information on this pull request, we identified @23Skidoo, @dcoutts and @tibbe to be potential reviewers

@ezyang
Copy link
Contributor

ezyang commented Sep 7, 2016

Looks good!

@dcoutts
Copy link
Contributor

dcoutts commented Sep 7, 2016

LGTM

@ttuegel
Copy link
Member Author

ttuegel commented Sep 7, 2016

This (apparently) exposes a bug on Linux with GHC < 8; I will investigate.

@ttuegel
Copy link
Member Author

ttuegel commented Sep 8, 2016

Turns out it's not a problem with GHC < 8, but rather with running the integration tests outside of cabal test: they pick up Cabal-1.24 instead of the development version. Any ideas why?

@ezyang
Copy link
Contributor

ezyang commented Sep 9, 2016

So, the situation is that when we call "cabal" from the custom/plain.sh test, it uses the default package databases (the global and the user). That means that when the setup script is built, it is built using the Cabal from the user database.

I tried some junky hack to get the database to the right place but for some reasons the GHC versions mismatched; not sure what's going on!

@ttuegel
Copy link
Member Author

ttuegel commented Sep 9, 2016

So, the situation is that when we call "cabal" from the custom/plain.sh test, it uses the default package databases (the global and the user). That means that when the setup script is built, it is built using the Cabal from the user database.

Isn't that the correct database?

I tried some junky hack to get the database to the right place but for some reasons the GHC versions mismatched; not sure what's going on!

How are you setting the database?

Also, is the problem that cabal looks in a different database (between the plain and bootstrap tests), or is the problem that Cabal is installed in a different database?

@ezyang
Copy link
Contributor

ezyang commented Sep 9, 2016

Isn't that the correct database?

Not when we use new-build to build the Cabal package. In that case, the inplace Cabal install is in dist-newstyle/packagedb (with dependencies on packages in .cabal/store). An inplace package is never installed to the user database. Note that package-tests (in Cabal) does some fancy footwork to compute where the inplace Cabal is, but that code isn't in integration-tests.

How are you setting the database?

I tried passing cabal some --package-db flags. My noodling is here: ezyang#4 (look at the end commits; master pointer is out of date.) It works locally for me but not on Travis; puzzling!

Also, is the problem that cabal looks in a different database (between the plain and bootstrap tests), or is the problem that Cabal is installed in a different database?

Not sure what you mean by bootstrap tests, but I suspect plain.sh is the only test which has checked stderr, which is why it is failing. (In fact, one of the custom setup tests specifically makes sure that it picks up the system Cabal, and not some other Cabal that a user happens to have in the user database.)

@ttuegel
Copy link
Member Author

ttuegel commented Sep 9, 2016

Not sure what you mean by bootstrap tests, but I suspect plain.sh is the only test which has checked stderr, which is why it is failing. (In fact, one of the custom setup tests specifically makes sure that it picks up the system Cabal, and not some other Cabal that a user happens to have in the user database.)

Yes, but it only fails when invoked directly, as in travis-script.sh. When running the integration tests through cabal as in travis-bootstrap.sh, the tests work. But, it sounds like this is due to the difference between build and new-build.

EDIT: No, this can't merely be due to build vs. new-build. When I build with cabal build locally, but run the integration test directly, it still fails.

@ezyang
Copy link
Contributor

ezyang commented Sep 9, 2016

No, this can't merely be due to build vs. new-build. When I build with cabal build locally, but run the integration test directly, it still fails.

That's because the bootstrap strip also installs the Cabal library in the user database, which is why it gets picked up.

@ttuegel ttuegel force-pushed the setup-wrapper-warn-old-cabal branch from 96f0f94 to 9707798 Compare September 9, 2016 18:02
@ezyang
Copy link
Contributor

ezyang commented Oct 25, 2016

Is there some alternate hacky fix we can do to get this PR unfrozen? @ttuegel

@ttuegel
Copy link
Member Author

ttuegel commented Oct 26, 2016

Is there some alternate hacky fix we can do to get this PR unfrozen?

The only way to get this PR moving again is to fix the test suite. I took a stab at it, but I couldn't figure it out.

@23Skidoo 23Skidoo modified the milestones: 2.0.1, 2.0 Feb 17, 2017
@23Skidoo 23Skidoo modified the milestones: 2.0.1, 2.0.2 Sep 19, 2017
@23Skidoo 23Skidoo modified the milestones: 2.0.2, 2.4 Aug 29, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4, 2.4.1 Sep 17, 2018
@23Skidoo 23Skidoo modified the milestones: 2.4.1.0, 2.4.2.0 Apr 26, 2019
@ttuegel ttuegel closed this Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent behavior between custom and simple build types
5 participants