Skip to content

ncurses: Recognise linux-gnuabielfv{1,2}#427495

Merged
flokli merged 1 commit intoNixOS:stagingfrom
OPNA2608:fix/ncurses-gnuabielfv-not-handled
Jul 29, 2025
Merged

ncurses: Recognise linux-gnuabielfv{1,2}#427495
flokli merged 1 commit intoNixOS:stagingfrom
OPNA2608:fix/ncurses-gnuabielfv-not-handled

Conversation

@OPNA2608
Copy link
Contributor

ncurses has a list of GNU-ish targets, for deciding which flags need to be set to get certain POSIX features. linux-gnuabielfv{1,2} fails to match that list, so certain defines don't get set.

This causes the build to fail for such targets, due to wcwidth being gated in the system headers behind an _XOPEN_SOURCE check:

In file included from ../ncurses/./base/lib_addch.c:37:
../ncurses/./base/lib_addch.c: In function 'waddch_literal':
../ncurses/curses.priv.h:1941:28: error: implicit declaration of function 'wcwidth' [-Wimplicit-function-declaration]
 1941 | #define _nc_wacs_width(ch) wcwidth(ch)
      |                            ^~~~~~~
../ncurses/curses.priv.h:1474:25: note: in definition of macro 'if_WIDEC'
 1474 | #define if_WIDEC(code)  code
      |                         ^~~~
../ncurses/./base/lib_addch.c:321:19: note: in expansion of macro '_nc_wacs_width'
  321 |         int len = _nc_wacs_width(CharOf(ch));
      |                   ^~~~~~~~~~~~~~

Fix this issue by adding the pattern linux*gnuabielfv* to the list.

This makes (cross-)compiling ncurses for powerpc64-unknown-linux-gnuabielfv1 work.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux (cross)
    • powerpc64-linux (ELFv1, native & cross)
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 2.status: merge conflict This PR has merge conflicts with the target branch 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jul 22, 2025
@alyssais
Copy link
Member

Upstream?

@OPNA2608
Copy link
Contributor Author

Will do.

Gah, more mailing lists…

@OPNA2608 OPNA2608 marked this pull request as draft July 22, 2025 16:52
@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Jul 22, 2025
@OPNA2608
Copy link
Contributor Author

OPNA2608 commented Jul 26, 2025

Submitted a report about this to upstream's ML, with a patch that fixes this written against their latest snapshot export: https://lists.gnu.org/archive/html/bug-ncurses/2025-07/msg00040.html

Latest snapshot has some new spots in need of patching that didn't exist in the 6.5 release, so I'll vendor a backported version of the patch without those hunks here.

Edit: Now included in v6_5_20250726: ThomasDickey/ncurses-snapshots@4afb0e7

@OPNA2608 OPNA2608 force-pushed the fix/ncurses-gnuabielfv-not-handled branch from e32fbf4 to ed0971e Compare July 26, 2025 09:51
@OPNA2608 OPNA2608 marked this pull request as ready for review July 26, 2025 09:52
@nixpkgs-ci nixpkgs-ci bot added 9.needs: reviewer This PR currently has no reviewers requested and needs attention. and removed 2.status: merge conflict This PR has merge conflicts with the target branch labels Jul 26, 2025
Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful, thanks! (Please do proactively submit this sort of thing to upstream — the more each distro does that, the less work we all have to do.)

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Jul 26, 2025
@flokli
Copy link
Member

flokli commented Jul 29, 2025

Successfully built pkgsCross.ppc64-elfv{1,2}.ncurses. Thanks!

@flokli flokli merged commit 8b1aae3 into NixOS:staging Jul 29, 2025
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants