-
Notifications
You must be signed in to change notification settings - Fork 841
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
Check for ncurses6 before checking for tinfo6 #3521
Conversation
On Arch Linux which has both libraries, the tinfo6 distribution will be picked, which doesn't work.
Seems reasonable, I'm in favor of merging, and seeing if anyone complains about the change in behavior @borsboom What do you think? |
Running it under Sabayon results in the architecture
This breaks under Sabayon, because the (Similarly, it looks like under Fedora the architecture will change from There's also the separate problem that I'm curious why the If we can change the flags for * This is more accurately the 'GHC build', but I wrote most of this before I remembered the correct term for it. |
Curiously, after running the |
Sed command for reference:
Relevant part of the file:
If I try to apply that change to
This is probably because Sabayon uses GCC 4.9.3, and the flag was added in GCC 6. The content appears to be generated, as it's not present in the tarball but there are similarly named This is fundamentally broken - the flags we want to specify depend on the version and configuration of GCC installed on the user's system, but we don't have the ability to express this via It's increasingly looking like we're going to need to fix (or hack around) the logic used to determine those flags... |
I agree the current approach is flawed. Really, GHC's Can anyone confirm whether recent GHC bindists work "out of the box" on these platforms (without passing any of the PIE-related flags in the configure environment variables or patching the settings file)? If this is fixed upstream, perhaps we should just say that older GHC versions are unsupported on these platforms (but include some hints for manual patching of the settings file in the documentation). |
I think I have a rough idea of how to fix this - use the YAML file to determine only the GHC artifact (which depends on machine arch + linked libs), and set the GHC flags based on the local environment (incl. the GHC version). This means we'll need to start ignoring @borsboom Is there a build server somewhere which builds the GHC artifacts available here? I'd like to take a look at the configure logs to check if there are any other implicit assumptions we might be missing. |
@rdnetto There is not. Most of these come from the GHC release team using whatever process they have. The tinfo6/ncurses6 bindists are built by us using the instructions here: https://docs.haskellstack.org/en/stable/MAINTAINER_GUIDE/#adding-a-new-ghc-version |
I think you're right, but it would be nice to future-proof this as much as possible (e.g. if the arguments change for a future GHC version, not having to release a new Stack version to support it). Maybe the Stack code can detect various cases and make a list of "flags" for those (pie, etc.), but then have a new section in the setup-info that is used to look up the actual arguments matching those flags and the GHC version. E.g. something like this: ghc-config:
- flags:
- pie
ghc-version: '< 8.2'
configure-env:
CONF_CC_OPTS_STAGE2: -no-pie
CONF_GCC_LINKER_OPTS_STAGE2: -no-pie
CONF_LD_LINKER_OPTS_STAGE2: -no-pie
configure-args: [] (note: example is probably incorrect, just to give an idea of the syntax) So the idea is it would go through each item in the That said, the above is overkill for just the pie/nopie case. Could also do something much simpler and have an optional I lean toward the simpler approach, but I'd be interested in any other ideas. |
In #3518 (comment), I tested myself and the |
Once the work on solving #3518 is done it should no longer matter whether tinfo6 or ncurses6 is preferred to have a working GHC (using that as a "proxy" to decide on unrelated things was wrong), so I'm going to close this. All the latest versions of distros I looked at that upgraded from ncurses5 have both tinfo6 and ncurses6 now, so we may just be able to pick one of them instead of supporting both. Better, Stack could check for any option that could work and then use whichever has a bindist available. |
These changes are motivated by #3636. * `stack setup` looks for GHC bindists and installations by any OS key that is compatible (rather than only checking a single one). This is relevant on Linux where different distributions may have different combinations of libtinfo 5/6, ncurses 5/6, and gmp 4/5, and will allow simpifying the setup-info metadata YAML for future GHC releases. * `stack setup` no longer uses different GHC configure options on Linux distributions that use GCC with PIE enabled by default. GHC detects this itself since ghc-8.0.2, and Stack's attempted workaround for older versions caused more problems than it solved.
On Arch Linux which has both libraries, the tinfo6 distribution will be picked, which doesn't work.
I'm not sure how to test if this is breaking anything, so I'll gladly accept some guidance.
Please include the following checklist in your PR: