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

Lynx ncurses fix for Big Sur #58019

Merged
merged 5 commits into from
Jul 17, 2020
Merged

Lynx ncurses fix for Big Sur #58019

merged 5 commits into from
Jul 17, 2020

Conversation

BytesGuy
Copy link
Contributor

@BytesGuy BytesGuy commented Jul 15, 2020

  • Have you followed the guidelines for contributing?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing brew install <formula>)?

Resolves #57871 (comment)

@BytesGuy BytesGuy mentioned this pull request Jul 15, 2020
5 tasks
@claui
Copy link
Contributor

claui commented Jul 15, 2020

Our CI is designed for one-formula-per-PR, unfortunately.

Would you mind splitting your PR?

@BytesGuy
Copy link
Contributor Author

To add some context to this, it looks like something has changed in Big Sur (believe this is not Apple Silicon specific) where packages that use uses_from_macos "ncurses" are breaking. Explicitly configuring the package to use ncurses seems to resolve the issue.

I'm no expert in this, but I think maybe packages are looking for curses (which is usually pointed to ncurses) rather than ncurses and are now failing? That's the conclusion I came to anyway, at least we know how to roughly fix this issue

@BytesGuy
Copy link
Contributor Author

Our CI is designed for one-formula-per-PR, unfortunately.

Would you mind splitting your PR?

Oh sorry I created a branch from a branch I was working on already rather than master! I'll force push and remove that erroneous commit

Formula/lynx.rb Outdated Show resolved Hide resolved
Formula/lynx.rb Outdated Show resolved Hide resolved
@Bo98
Copy link
Member

Bo98 commented Jul 15, 2020

Explicitly configuring the package to use ncurses seems to resolve the issue.

I’d rather we figure out exactly why this is happening and see if a common fix in brew can be applied.

The OpenSSL pkg-config change shouldn’t be required either.

@BytesGuy
Copy link
Contributor Author

I’d rather we figure out exactly why this is happening and see if a common fix in brew can be applied.

I have had a poke with other formulas that also use uses_from_macos "ncurses" and there doesn't seem to be any rhyme or reason why this happening yet and I've only found two instances of this happening. In fact a lot of packages that use ncurses like this work fine - htop for example.

As uses_from_macos "ncurses" is being defined in the formula already, I don't see being explicit about configuring packages being a problem as it doesn't break them on previous macOS versions either.

For now I would say just patching the formula is fine as a fix for the time spent and the impact of this issue. The reason I could think of is what I mentioned previously, but there is no supporting information for this from what I can find. If it becomes a huge issue, then it may be worth investigating the time to find out what is causing it.

The OpenSSL pkg-config change shouldn’t be required either.

I didn't require this locally, but it was required to get the checks to pass on this PR @claui found this (I'm not exactly sure why this happens) #57871 (comment)

@claui
Copy link
Contributor

claui commented Jul 15, 2020

I’d rather we figure out exactly why this is happening and see if a common fix in brew can be applied.

After a couple of debug printouts in configure, I think I’m figuring out what’s happening here.

In line 18945, configure compiles a set of probes in a loop in order to check whether the compiler can find various curses headers:

#line 18946 "configure"
#include "confdefs.h"
#include <${cf_header}>
int
main (void)
{
initscr(); tgoto("?", 0,0)
  ;
  return 0;
}

But the probe no longer compiles on macOS 11.0, even though the curses headers are there:

configure:18951:12: error: implicit declaration of function 'tgoto' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
initscr(); tgoto("?", 0,0)
           ^
1 error generated.

The compile failure then sets off a false alarm, and configure erroneously assumes there are no curses headers.

@Bo98
Copy link
Member

Bo98 commented Jul 15, 2020

I didn't require this locally, but it was required to get the checks to pass on this PR @claui found this (I'm not exactly sure why this happens) #57871 (comment)

PKG_CONFIG is supposed to point to the pkg-config binary so all that is currently doing is preventing pkg-config from being used. If you want that then you might as well do --with-pkg-config=no.

Not entirely sure why it's being baked in the binary. I'll poke around.

@Bo98
Copy link
Member

Bo98 commented Jul 15, 2020

@claui Ah yes, tgoto is in term.h/termcap.h. Might be worth reporting that bug. I'm fine with the --with-screen in the meantime then.

@Bo98
Copy link
Member

Bo98 commented Jul 15, 2020

For the shim thing try --disable-config-info. The default behaviour seems to be to copy the configure output into the binary for debugging purposes.

@BytesGuy
Copy link
Contributor Author

For the shim thing try --disable-config-info. The default behaviour seems to be to copy the configure output into the binary for debugging purposes.

@Bo98 Thanks, will give that a go 🙂 Should we leave a comment in the Formula pointing to this PR for future reference regarding the ncurses issue I case we ever find a proper fix / reason for the change in behaviour?

@Bo98
Copy link
Member

Bo98 commented Jul 16, 2020

Sure, might as well.

@BytesGuy
Copy link
Contributor Author

Looks like this works now 🎉

@Bo98 Bo98 merged commit d7ca5c6 into Homebrew:master Jul 17, 2020
@Bo98
Copy link
Member

Bo98 commented Jul 17, 2020

Thanks!

@BytesGuy BytesGuy deleted the lynx-macos11 branch July 17, 2020 01:18
@SeekingMeaning SeekingMeaning added the 11 Big Sur is specifically affected label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
11 Big Sur is specifically affected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants