Add flag allowing convenient disabling of terminfo support
ClosedPublic

Authored by bgamari on Feb 23 2017, 10:03 AM.

Details

Summary

This is a common thing that users who cross-compile must fight against. It turns
out that it's pretty straightforward to make is convenient.

Test Plan

Cross compile without a target ncurses available

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bgamari created this revision.Feb 23 2017, 10:03 AM
bgamari updated this revision to Diff 11248.Feb 23 2017, 10:05 AM

Fix inverted logic

bgamari updated this revision to Diff 11249.Feb 23 2017, 10:06 AM

Fix errant change

bgamari updated this revision to Diff 11250.Feb 23 2017, 10:09 AM

Add missing changes from config.mk.in

rwbarton requested changes to this revision.Feb 23 2017, 10:16 AM
rwbarton added a subscriber: rwbarton.
rwbarton added inline comments.
compiler/ghc.mk
365

In the scenario you care about you probably do have a terminfo C library available for the host, just not for the target. Probably it would be better if WITH_TERMINFO only controlled the stage2 compiler build?

ghc.mk
434

It doesn't seem like you ever set WITH_TERMINFO to YES, though?

1023

?

utils/ghc-pkg/Main.hs
1440

You build ghc-pkg with terminfo when bootstrapping now. It's not clear to me whether this will work given that terminfo is also a bootstrapping library. Do we need the bootstrapping ghc-pkg to install it locally?

utils/ghc-pkg/ghc.mk
61

Same comment about stage 1 vs stage 2 here.

This revision now requires changes to proceed.Feb 23 2017, 10:16 AM
bgamari edited the summary of this revision. (Show Details)Feb 23 2017, 11:20 AM

Sorry @rwbarton, I think you may have reviewed the patch while it was still in flux. Nevertheless a few of your comments are still valid. I'll fix them and let you know when this is ready for another round.

compiler/ghc.mk
365

That is a fair point.

bgamari updated this revision to Diff 11255.Feb 23 2017, 11:48 AM
bgamari edited edge metadata.
bgamari marked 4 inline comments as done.

Address Reid's comments

bgamari added inline comments.Feb 23 2017, 11:49 AM
ghc.mk
434

It's done in config.mk.in, but that change was mistakenly omitted from the version of the patch you reviewed.

utils/ghc-pkg/ghc.mk
61

Touché.

bgamari marked 2 inline comments as done.Feb 23 2017, 11:51 AM
bgamari added inline comments.
utils/ghc-pkg/Main.hs
1440

I now ensure that WITH_TERMINFO is undefined when BOOTSTRAPPING is set. It's not exactly pretty, but it ought to work.

rwbarton requested changes to this revision.Feb 24 2017, 11:08 AM

Other than the above LGTM.

utils/ghc-pkg/ghc.mk
61

Should be dist-install rather than stage2 I think.

This revision now requires changes to proceed.Feb 24 2017, 11:08 AM
rwbarton added inline comments.Feb 28 2017, 7:32 AM
ghc.mk
433–434

Another stage issue. We set $(WITH_TERMINFO) according to $(Windows_Target) which corresponds to it controlling the target only. And the meaning of this line is different now when the build is "cross-Windows" (i.e. cross-compiling to Windows from another platform or vice versa).

I think this line should stay the same (or add a WITH_TERMINFO_STAGE0, though it hardly seems necessary).

This revision was automatically updated to reflect the committed changes.
bgamari marked an inline comment as done.