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

Refactor texinfo and update 7.0.3 -> 7.1 #289690

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

afh
Copy link
Member

@afh afh commented Feb 18, 2024

ℹ️ This draft PR is my understanding of how the texinfo package could be improved based off @AndersonTorres' comment on #262276 and work on nv-codec-headers (see #287918).

texinfo 7.0.3 -> 7.1

Diff: https://git.savannah.gnu.org/cgit/texinfo.git/diff/?id=texinfo-7.0.3&id2=texinfo-7.1

Changelog: https://git.savannah.gnu.org/cgit/texinfo.git/tree/ChangeLog?h=texinfo-7.1

TODO

  • If this PR is headed in the right direction and people see value in pursuing this approach close texinfo: 7.0.3 -> 7.1 #262276 in favour of this one.

Description of changes

  • Modernize texinfo/4.13a.nix by using finalAttrs and hash
  • I decided not to refactor texinfo/4.13a.nix into texinfo/default.nix (see below) as it shares no common attributes with the other texinfo versions apart from meta
  • Modernize texinfo/common.nix by removing top-level with lib, using hash, and adding meta.mainProgram
  • Fix texinfo/common.nix by adding missing libiconv input
  • Refactor individual texinfo version-specific nix files into generic texinfo/default.nix and
  • Rename texinfo version packages to fit with nixpkgs Package naming convention, e.g. texinfo6_5 -> texinfo_6_5.
  • Adapt all-packages.nix according to the changes above
  • Replace texinfo_7_0 with texinfo_7_1
  • Default to texinfo_7_1

Things I kindly request feedback on

  • At first glance it seems no package specifically requires texinfo 7.0.3, therefore I assume 7.0.3 can be replaced with 7.1. If ofborg tests pass are people on board with this or should the texinfo 7.0.3 package continue to exist in nixpkgs?
  • Is there a better way to manage the meta attributes?
  • Do folks agree that the mainProgram should indeed be texi2any?
  • This PR retains the texinfo[4567] names, yet this PR seems also like a good opportunity to either rename or remove them and change all dependent package.
  • Should the way packages refer to a specific texinfo version be unified?
    If yes, which of the following existing appraoches is then preferred? Ⓐ or Ⓑ?

Ⓐ The following packages reference a texinfo version specific package directly:

  • allegro (texinfo 6.5)
  • gcc48 (texinfo5, i.e. texinfo 5.2)
  • ne (texinfo6, i.e. texinfo 6.8)
  • singular (texinfo4, i.e. texinfo 4.13a)
  • eukleides (texinfo4, i.e. texinfo 4.13a)

Ⓑ whereas the following packages have a texinfo input, which is set to a specific texinfo version in all-packages.nix:

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@afh
Copy link
Member Author

afh commented Feb 18, 2024

ℹ️ texinfo, texinfo.passthru.tests on x86_64-darwin and aarch64-darwin failed due to:
error: building of '/nix/store/0d8bgk9p6rrmpd420h1gbxjnkmm92xrr-llvm-16.0.6.drv!dev' from .drv file timed out after 3600 seconds

@afh afh marked this pull request as ready for review February 19, 2024 03:56
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3468

@afh
Copy link
Member Author

afh commented Mar 2, 2024

Friendly ping on this, @AndersonTorres, with a polite request for comments on the "Things I kindly request feedback on" in the initial PR comment/description 🙂

@afh afh force-pushed the refactor-update-texinfo branch from ffb21eb to f0131c6 Compare March 2, 2024 18:57
@afh afh requested a review from AndersonTorres March 2, 2024 19:01
@afh afh marked this pull request as draft June 1, 2024 17:23
@afh
Copy link
Member Author

afh commented Jun 26, 2024

Friendly ping to current reviewers on this 🙂
@gebner @cpages @prusnak @adevress @7c6f434c @bjornfor @amiloradovsky @oxij @AndersonTorres

@7c6f434c 7c6f434c merged commit 63c9490 into NixOS:staging Jun 26, 2024
24 checks passed
@afh afh deleted the refactor-update-texinfo branch June 26, 2024 08:45
@afh
Copy link
Member Author

afh commented Jun 26, 2024

Thanks for merging, @7c6f434c, very, very much appreciated! I thought this PR might never see the light of day 🥲

@trofi
Copy link
Contributor

trofi commented Jul 1, 2024

Bisect says 0626ef8 texinfo: refactor broke ffmpeg_4 build on staging as:

$ nix build --no-link -f. ffmpeg_4
...
HTML    doc/ffplay.html
makeinfo: error parsing ./doc/t2h.pm: Undefined subroutine &Texinfo::Config::set_from_init_file called at ./doc/t2h.pm line 24.

@reckenrode
Copy link
Contributor

Bisect says 0626ef8 texinfo: refactor broke ffmpeg_4 build on staging as:

$ nix build --no-link -f. ffmpeg_4
...
HTML    doc/ffplay.html
makeinfo: error parsing ./doc/t2h.pm: Undefined subroutine &Texinfo::Config::set_from_init_file called at ./doc/t2h.pm line 24.

I’m also seeing this error building zsh on staging.

make[1]: Entering directory '/private/tmp/nix-build-zsh-5.9.drv-0/zsh-5.9/Doc'
d=`echo 'May 14, 2022'`; \
v="<font size=\"-1\">Zsh version 5.9, released on $d.</font>"; \
case 'texi2any -c TEXI2HTML=1' in \
  *texi2any*) echo "set_from_init_file('PRE_BODY_CLOSE','$v');" ;; \
  *) echo "\$PRE_BODY_CLOSE = '$v';" ;; \
esac > texi2html.conf
texi2any -c TEXI2HTML=1 --output . --ifinfo --split=chapter --node-files \
             --init-file texi2html.conf ./zsh.texi
texi2any: error parsing ./texi2html.conf: Undefined subroutine &Texinfo::Config::set_from_init_file called at ./texi2html.conf line 1.
make[1]: *** [Makefile:320: zsh_toc.html] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-zsh-5.9.drv-0/zsh-5.9/Doc'

@afh
Copy link
Member Author

afh commented Jul 5, 2024

Thanks for chiming in on this, @reckenrode, any hint is helpful!

I'm looking at zsh's configure.ac, which might be related…

@afh
Copy link
Member Author

afh commented Jul 5, 2024

This email thread on texinfo mailing list might provide some helpful insights.

@afh
Copy link
Member Author

afh commented Jul 5, 2024

For ffmpeg a patch exist (0005-Patch-up-t2h-for-texinfo-7.1.patch), @trofi would be able and willing to give that patch a try?

@reckenrode
Copy link
Contributor

Thanks for chiming in on this, @reckenrode, any hint is helpful!

I'm looking at zsh's configure.ac, which might be related…

Thanks. I opened #324900 with a fix.

@trofi
Copy link
Contributor

trofi commented Jul 6, 2024

For ffmpeg a patch exist (0005-Patch-up-t2h-for-texinfo-7.1.patch), @trofi would be able and willing to give that patch a try?

Does not apply to ffmpeg_4::

ffmpeg> Running phase: patchPhase
ffmpeg> applying patch /nix/store/92a8fs5ab27v7fkvh57rib7jwbmm4fjy-texinfo-7.1.patch
ffmpeg> patching file doc/t2h.pm
ffmpeg> Hunk #3 FAILED at 127.
ffmpeg> Hunk #4 FAILED at 193.

@afh
Copy link
Member Author

afh commented Jul 6, 2024

@reckenrode thanks for the zsh fix, and glad to see it already got merged.

Thanks for giving the patch a try, too bad it fails. I'll dig deeper and will report back with any findings.

@afh
Copy link
Member Author

afh commented Jul 17, 2024

A quick update for folks following the conversation here:
My investigation into the matter shows that the update from texinfo 7.0 to 7.1 broke the ffmpeg_4 build and the fix proposed in #326249 addresses the issue.

Feel free to comment, test, double-check the changes proposed in #326249 🙂
The more eyes we get on this the surer we can be that a default texinfo of version 7.1 in nixpkgs will be stable by the time of the next release.

@jue89
Copy link
Contributor

jue89 commented Jul 20, 2024

e6f9072 broke cross-compiling for Raspberry Pi:

jue@baxxter ~/P/nixpi-node> nix build github:NixOS/nixpkgs/e6f90729d2a9cef030b48b58fad9180b134d2796#pkgsCross.raspberryPi.texinfoInteractive
error: builder for '/nix/store/y4dk6a45ry58a02g5qxgqf6kh2l1kqm9-texinfo-interactive-armv6l-unknown-linux-gnueabihf-7.1.drv' failed with exit code 1;
       last 10 log lines:
       > checking whether the compiler supports the __inline keyword... yes
       > checking for pthread_rwlock_t... yes
       > checking whether pthread_rwlock_rdlock prefers a writer to a reader... guessing no
       > checking for nl_langinfo... yes
       > checking whether YESEXPR works... guessing yes
       > checking whether wcrtomb works in the C locale... guessing yes
       > checking whether wcrtomb return value is correct... guessing yes
       > checking whether iconv converts EUC-CN to UTF-8... configure: error: in `/build/texinfo-7.1':
       > configure: error: cannot run test program while cross compiling
       > See `config.log' for more details
       For full logs, run 'nix log /nix/store/y4dk6a45ry58a02g5qxgqf6kh2l1kqm9-texinfo-interactive-armv6l-unknown-linux-gnueabihf-7.1.drv'.

Is this a problem to be reported upstream? Or can we fix this ourselves?

@afh
Copy link
Member Author

afh commented Jul 20, 2024

Thanks for bringing this to my attention, @jue89, much appreciated!

❓ Is this the merged fix 1e07a3b from #326249 already available in your Raspberry Pi build environment?

@afh
Copy link
Member Author

afh commented Jul 20, 2024

Oh wait, your building texinfo itself and not ffmpeg… 🤔

@afh
Copy link
Member Author

afh commented Jul 20, 2024

Can you post a link to a complete log, please?

@jue89
Copy link
Contributor

jue89 commented Jul 20, 2024

Can you post a link to a complete log, please?

Sure!

jue@baxxter ~/P/nixpi-node> nix log /nix/store/y4dk6a45ry58a02g5qxgqf6kh2l1kqm9-texinfo-interactive-armv6l-unknown-linux-gnueabihf-7.1.drv
warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/y4dk6a45ry58a02g5qxgqf6kh2l1kqm9-texinfo-interactive-armv6l-unknown-linux-gnueabihf-7.1.drv^*'
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/4y7w69wfavkdfnl2gpzvm3xs969cw418-texinfo-7.1.tar.xz
source root is texinfo-7.1
setting SOURCE_DATE_EPOCH to timestamp 1697635779 of file texinfo-7.1/po_document/uk.gmo
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/dnzx3qs20sivfmy7swl1grjzmpz2b9f7-cross-tools-flags.patch
patching file configure
Hunk #1 succeeded at 36771 (offset 13490 lines).
patching script interpreter paths in tp/maintain
tp/maintain/all_tests.sh: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
tp/maintain/change_perl_modules_version.sh: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
tp/maintain/regenerate_file_lists.pl: interpreter directive changed from "#! /usr/bin/env perl" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl"
tp/maintain/lib/libintl-perl/lib/Locale/Messages.pm: interpreter directive changed from "#! /bin/false" to "false"
tp/maintain/lib/libintl-perl/lib/Locale/gettext_pp.pm: interpreter directive changed from "#! /bin/false" to "false"
tp/maintain/lib/libintl-perl/lib/Locale/gettext_dumb.pm: interpreter directive changed from "#! /bin/false" to "false"
tp/maintain/lib/libintl-perl/lib/Locale/TextDomain.pm: interpreter directive changed from "#! /bin/false" to "false"
tp/maintain/lib/libintl-perl/lib/Locale/gettext_xs.pod: interpreter directive changed from "#! /bin/false" to "false"
tp/maintain/lib/libintl-perl/test.pl: interpreter directive changed from "#! /usr/local/bin/perl -w" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl -w"
tp/maintain/regenerate_docstr.sh: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
tp/maintain/regenerate_documentlanguages-iana.pl: interpreter directive changed from "#! /usr/bin/env perl" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl"
tp/maintain/regenerate_converters_documentation.sh: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
tp/maintain/regenerate_cmd_tests.sh: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
tp/maintain/regenerate_documentlanguages-loc.pl: interpreter directive changed from "#! /usr/bin/env perl" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl"
tp/maintain/copy_change_file_name_encoding.pl: interpreter directive changed from "#! /usr/bin/env perl" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl"
tp/maintain/regenerate_commands_perl_info.pl: interpreter directive changed from "#! /usr/bin/env perl" to "/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl"
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.guess
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.guess
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.guess
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.guess
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.sub
Updating Autotools / GNU config script to a newer upstream version: ./tp/Texinfo/XS/config.guess
Updating Autotools / GNU config script to a newer upstream version: ./build-aux/config.guess
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
fixing libtool script ./tp/Texinfo/XS/ltmain.sh
./tp/Texinfo/XS/configure
patching script interpreter paths in ./configure
./configure: interpreter directive changed from "#! /bin/sh" to "/nix/store/0xrld91hp7amy0fypkabsd2gbllnj7bw-bash-5.2p26/bin/sh"
configure flags: --disable-dependency-tracking --prefix=/nix/store/d3kj5fbcb53cfgl2411hyhifavgbbxqc-texinfo-interactive-armv6l-unknown-linux-gnueabihf-7.1 PERL=/nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl --enable-perl-xs=no TI_AWK=/nix/store/svjqna3573gjchcrvdq5fygmi5jpkq3n-gawk-armv6l-unknown-linux-gnueabihf-5.2.2/bin/awk --build=x86_64-unknown-linux-gnu --host=armv6l-unknown-linux-gnueabihf
checking for a BSD-compatible install... /nix/store/ml26aj8bfyz8qhdk62g68zfbp01vqmcd-coreutils-9.5/bin/install -c
checking whether build environment is sane... yes
checking for armv6l-unknown-linux-gnueabihf-strip... armv6l-unknown-linux-gnueabihf-strip
checking for a race-free mkdir -p... /nix/store/ml26aj8bfyz8qhdk62g68zfbp01vqmcd-coreutils-9.5/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '1000' is supported by ustar format... yes
checking whether GID '100' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking for perl... /nix/store/kn8z6dp100c057qcif81mvcj2ydcbmy7-perl-5.38.2/bin/perl
checking Perl version and modules... yes
checking Unicode::Collate... yes
checking for awk... /nix/store/svjqna3573gjchcrvdq5fygmi5jpkq3n-gawk-armv6l-unknown-linux-gnueabihf-5.2.2/bin/awk
checking for armv6l-unknown-linux-gnueabihf-gcc... armv6l-unknown-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether armv6l-unknown-linux-gnueabihf-gcc accepts -g... yes
checking for armv6l-unknown-linux-gnueabihf-gcc option to enable C11 features... none needed
checking whether armv6l-unknown-linux-gnueabihf-gcc understands -c and -o together... yes
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking whether make supports the include directive... yes (GNU style)
checking dependency style of armv6l-unknown-linux-gnueabihf-gcc... none
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for uchar.h... yes
checking for error.h... yes
checking for getopt.h... yes
checking for sys/cdefs.h... yes
checking for limits.h... yes
checking for crtdefs.h... no
checking for wctype.h... yes
checking for sys/mman.h... yes
checking for malloc.h... yes
checking for stdbool.h... yes
checking for stdckdint.h... no
checking for features.h... yes
checking for sys/socket.h... yes
checking for threads.h... yes
checking for langinfo.h... yes
checking for xlocale.h... no
checking for sys/param.h... yes
checking for sys/time.h... yes
checking for sys/random.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... armv6l-unknown-linux-gnueabihf
checking how to run the C preprocessor... armv6l-unknown-linux-gnueabihf-gcc -E
checking for grep that handles long lines and -e... /nix/store/5v3nx7ra6knlhn4mzvgph5ggkpisc6il-gnugrep-3.11/bin/grep
checking for egrep... /nix/store/5v3nx7ra6knlhn4mzvgph5ggkpisc6il-gnugrep-3.11/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for armv6l-unknown-linux-gnueabihf-ar... armv6l-unknown-linux-gnueabihf-ar
checking for armv6l-unknown-linux-gnueabihf-gcc option to enable large file support... -D_FILE_OFFSET_BITS=64
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for C/C++ restrict keyword... __restrict__
checking whether the preprocessor supports include_next... yes
checking whether source code line length is unlimited... yes
checking whether char8_t is correctly defined... yes
checking whether char16_t is correctly defined... yes
checking whether char32_t is correctly defined... yes
checking for bit size of wchar_t... 32
checking for mbstate_t... yes
checking for mbsinit... yes
checking for mbrtowc... yes
checking for getexecname... no
checking for iswcntrl... yes
checking for mbslen... no
checking for isascii... yes
checking for mprotect... yes
checking for mkstemp... yes
checking for isblank... yes
checking for iswctype... yes
checking for wcwidth... yes
checking for btowc... yes
checking for _set_invalid_parameter_handler... no
checking for fcntl... yes
checking for symlink... yes
checking for getdtablesize... yes
checking for lstat... yes
checking for strndup... yes
checking for vasnprintf... no
checking for snprintf... yes
checking for wcrtomb... yes
checking for nl_langinfo and CODESET... yes
checking for a traditional japanese locale... none
checking for a french Unicode locale... none
checking for a transitional chinese locale... none
checking whether mbrtowc handles incomplete characters... guessing yes
checking whether mbrtowc works as well as mbtowc... guessing yes
checking for armv6l-unknown-linux-gnueabihf-gcc options needed to detect all undeclared functions... none needed
checking whether mbrtoc32 is declared... yes
checking for mbrtoc32... yes
checking for a traditional french locale... none
checking whether mbrtoc32 works as well as mbrtowc... guessing yes
checking whether malloc is ptrdiff_t safe... yes
checking whether malloc, realloc, calloc set errno on failure... yes
checking for error... yes
checking whether error_at_line is declared... yes
checking for error_at_line... yes
checking for working error function... guessing yes
checking whether strerror_r is declared... yes
checking whether strerror_r returns char *... yes
checking whether ctype.h defines __header_inline... no
checking for getopt.h... (cached) yes
checking for getopt_long_only... yes
checking whether getopt is POSIX compatible... guessing yes
checking for working GNU getopt function... guessing no
checking for ld... armv6l-unknown-linux-gnueabihf-ld
checking if the linker (armv6l-unknown-linux-gnueabihf-ld) is GNU ld... yes
checking for shared library run path origin... done
checking 32-bit host C ABI... yes
checking for ELF binary format... yes
checking for the common suffixes of directories in the library search path... lib,lib,lib
checking for iconv... yes
checking for working iconv... guessing yes
checking whether iconv is compatible with its POSIX signature... yes
checking whether limits.h has WORD_BIT, BOOL_WIDTH etc.... yes
checking whether limits.h has SSIZE_MAX... yes
checking for wint_t... yes
checking whether wint_t is large enough... yes
checking whether the compiler produces multi-arch binaries... no
checking whether stdint.h conforms to C99... guessing yes
checking whether stdint.h works without ISO C predefines... yes
checking whether stdint.h has UINTMAX_WIDTH etc.... yes
checking whether iswcntrl works... guessing yes
checking for towlower... yes
checking for wctype_t... yes
checking for wctrans_t... yes
checking whether malloc (0) returns nonnull... guessing yes
checking for mmap... yes
checking for MAP_ANONYMOUS... yes
checking whether memchr works... guessing no
checking whether memrchr is declared... yes
checking whether <limits.h> defines MIN and MAX... no
checking whether <sys/param.h> defines MIN and MAX... yes
checking whether alarm is declared... yes
checking for inline... inline
checking for wchar_t... yes
checking for good max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking for unreachable... no
checking whether fcloseall is declared... yes
checking whether getw is declared... yes
checking whether putw is declared... yes
checking which flavor of printf attribute matches inttypes macros... system
checking whether ecvt is declared... yes
checking whether fcvt is declared... yes
checking whether gcvt is declared... yes
checking whether MB_CUR_MAX is correct... guessing yes
checking for strcasestr... yes
checking whether strdup is declared... yes
checking for complete errno.h... yes
checking whether strerror(0) succeeds... guessing yes
checking whether strnlen is declared... yes
checking for pid_t... yes
checking for mode_t... yes
checking whether execvpe is declared... yes
checking whether <wchar.h> uses 'inline' correctly... yes
checking whether wcsdup is declared... yes
checking for working fcntl.h... cross-compiling
checking whether stat file-mode macros are broken... no
checking for nlink_t... yes
checking whether getdtablesize is declared... yes
checking for pthread.h... yes
checking for pthread_kill in -lpthread... yes
checking whether POSIX threads API is available... yes
checking whether setlocale (LC_ALL, NULL) is multithread-safe... yes
checking whether setlocale (category, NULL) is multithread-safe... yes
checking whether wctype supports the "blank" and "punct" character classes... guessing yes
checking whether langinfo.h defines CODESET... yes
checking whether langinfo.h defines T_FMT_AMPM... yes
checking whether langinfo.h defines ALTMON_1... yes
checking whether langinfo.h defines ERA... yes
checking whether langinfo.h defines YESEXPR... yes
checking whether locale.h defines locale_t... yes
checking whether locale.h conforms to POSIX:2001... yes
checking whether struct lconv is properly defined... yes
checking whether imported symbols can be declared weak... guessing yes
checking for multithread API to use... posix
checking whether lstat correctly handles trailing slash... guessing yes
checking for O_CLOEXEC... yes
checking for promoted mode_t type... mode_t
checking whether strndup is declared... yes
checking for struct timespec in <time.h>... yes
checking for TIME_UTC in <time.h>... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for intmax_t... yes
checking whether snprintf returns a byte count as in C99... guessing yes
checking whether snprintf truncates the result as in C99... guessing yes
checking where to find the exponent in a 'double'... unknown
checking for wcslen... yes
checking for snprintf... (cached) yes
checking for strnlen... yes
checking for wcrtomb... (cached) yes
checking whether _snprintf is declared... no
checking for C compiler option to allow warnings... -Wno-error
checking for alignas and alignof... yes, <stdalign.h> macros
checking for alloca as a compiler built-in... yes
checking for argz.h... yes
checking for error_t... yes
checking for argz_replace... yes
checking if argz actually works... yes
checking for static_assert... yes, an <assert.h> macro
checking whether calloc (0, n) and calloc (n, 0) return nonnull... guessing yes
checking for getprogname... no
checking whether program_invocation_name is declared... yes
checking whether program_invocation_name is declared... (cached) yes
checking whether program_invocation_short_name is declared... yes
checking whether __argv is declared... no
checking for iswblank... yes
checking whether iswblank is declared... yes
checking whether iswdigit is ISO C compliant... guessing yes
checking whether iswpunct is consistent with ispunct... guessing yes
checking whether iswxdigit is ISO C compliant... guessing yes
checking whether malloc (0) returns nonnull... (cached) guessing yes
checking whether mbrtoc32 works on empty input... guessing no
checking whether the C locale is free of encoding errors... guessing no
checking whether mbswidth is declared in <wchar.h>... no
checking for mbstate_t... (cached) yes
checking for bp-sym.h... no
checking for memrchr... yes
checking for working mkstemp... guessing yes
checking whether realloc (0, 0) returns nonnull... guessing yes
checking for reallocarray... yes
checking for working re_compile_pattern... guessing no
checking for libintl.h... yes
checking whether isblank is declared... yes
checking for ssize_t... yes
checking for va_copy... yes
checking for bool, true, false... no
checking for strcasecmp... yes
checking for strncasecmp... yes
checking whether strncasecmp is declared... yes
checking for strcasestr... (cached) yes
checking for working strerror function... guessing yes
checking for working strnlen... yes
checking for variable-length arrays... yes
checking for vasprintf... yes
checking whether wcwidth is declared... yes
checking whether wcwidth works reasonably in UTF-8 locales... guessing yes
checking whether // is distinct from /... unknown, assuming no
checking whether open recognizes a trailing slash... guessing yes
checking whether setlocale (LC_ALL, NULL) is multithread-safe... (cached) yes
checking whether setlocale (category, NULL) is multithread-safe... (cached) yes
checking whether mbrtowc handles a NULL pwc argument... guessing yes
checking whether mbrtowc handles a NULL string argument... guessing yes
checking whether mbrtowc has a correct return value... guessing yes
checking whether mbrtowc returns 0 when parsing a NUL character... guessing yes
checking whether mbrtowc stores incomplete characters... guessing no
checking whether mbrtowc works on empty input... guessing no
checking whether the C locale is free of encoding errors... guessing no
checking whether btowc(0) is correct... guessing yes
checking whether btowc(EOF) is correct... guessing yes
checking whether btowc is consistent with mbrtowc in the C locale... guessing yes
checking whether the C locale is free of encoding errors... (cached) guessing no
checking for mbtowc... yes
checking for __builtin_expect... yes
checking whether the compiler supports the __inline keyword... yes
checking for pthread_rwlock_t... yes
checking whether pthread_rwlock_rdlock prefers a writer to a reader... guessing no
checking for nl_langinfo... yes
checking whether YESEXPR works... guessing yes
checking whether wcrtomb works in the C locale... guessing yes
checking whether wcrtomb return value is correct... guessing yes
checking whether iconv converts EUC-CN to UTF-8... configure: error: in `/build/texinfo-7.1':
configure: error: cannot run test program while cross compiling
See `config.log' for more details

@afh
Copy link
Member Author

afh commented Jul 20, 2024

Thanks, @jue89, that's helpful I'll have a closer look.

I'd like to suggest to attach larger files via drag and drop, as that makes consuming them much easier, or is there another way than just copy and pasting the text? 🙂

@afh
Copy link
Member Author

afh commented Jul 20, 2024

Could you nix build texinfo with the --keep-failed option and attach config.log here?

Also I'm struggling a bit with my own raspberry pi nixos setup (more specifically garbled serial console output), would you be willing to answer a few question and if yes, what would be your preferred means of communications?

@reckenrode
Copy link
Contributor

configure: error: cannot run test program while cross compiling

The configure script appears to be trying to test for something on the target platform. Does setting texinfo_cv_sys_iconv_converts_euc_cn=yes in configureFlags when cross-compiling allow the build to succeed?

@jue89
Copy link
Contributor

jue89 commented Jul 20, 2024

Could you nix build texinfo with the --keep-failed option and attach config.log here?

Here you go: config.log

@jue89
Copy link
Contributor

jue89 commented Jul 20, 2024

Also I'm struggling a bit with my own raspberry pi nixos setup (more specifically garbled serial console output), would you be willing to answer a few question and if yes, what would be your preferred means of communications?

Sure, I'd love to help you debugging this.
Are you at matrix? You can contact me here: @jue89:matrix.org
Otherwise mail would be fine, too: [email protected]

@jue89
Copy link
Contributor

jue89 commented Jul 23, 2024

The configure script appears to be trying to test for something on the target platform. Does setting texinfo_cv_sys_iconv_converts_euc_cn=yes in configureFlags when cross-compiling allow the build to succeed?

Indeed! This seems to work! I guess it's time for a follow-up PR?

jue@baxxter ~/P/nixpkgs ((3ddf4322))> git diff
diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix
index 9b5959d40e47..99a5d2858e27 100644
--- a/pkgs/development/tools/misc/texinfo/common.nix
+++ b/pkgs/development/tools/misc/texinfo/common.nix
@@ -100,6 +100,7 @@ stdenv.mkDerivation {
     ++ optionals crossBuildTools [
       "--enable-perl-xs=no"
       "TI_AWK=${getBin gawk}/bin/awk"
+      "texinfo_cv_sys_iconv_converts_euc_cn=yes"
     ]
     ++ optional stdenv.isSunOS "AWK=${gawk}/bin/awk";

@afh
Copy link
Member Author

afh commented Jul 23, 2024

Seems like @NickCao has a PR out already 😄

Mind doing a nix run .#nixpkgs-view -- --post-result 328919 on your Raspberry Pi, @jue89 ?

@afh
Copy link
Member Author

afh commented Jul 23, 2024

Also thanks to you, @reckenrode, for proposing a working fix. 👍

@jue89
Copy link
Contributor

jue89 commented Jul 23, 2024

Seems like @NickCao has a PR out already 😄

Mind doing a nix run .#nixpkgs-view -- --post-result 328919 on your Raspberry Pi, @jue89 ?

I'm sorry, currently cross-compiled RaspberryPi images are broken.
But I'm able to compile and can verify that created ELFs are working with some help from QEMU.

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.

None yet

9 participants