Bug 291079 - sysutils/nix: Fails to build with mdbook 0.5.1 (DOCS option)
Summary: sysutils/nix: Fails to build with mdbook 0.5.1 (DOCS option)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ashish SHUKLA
URL:
Keywords:
Depends on:
Blocks: 291078
  Show dependency treegraph
 
Reported: 2025-11-18 12:48 UTC by Nuno Teixeira
Modified: 2025-12-09 14:44 UTC (History)
1 user (show)

See Also:
ashish: maintainer-feedback+


Attachments
Upstream patch (3.54 KB, patch)
2025-12-02 21:45 UTC, Nuno Teixeira
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Teixeira freebsd_committer freebsd_triage 2025-11-18 12:48:09 UTC
Hello,

Looking for help on:

```
[ 72% 356/491] env ASAN_OPTIONS=abort_on_error=1:print_summary=1:detect_leaks=0 HOME=/tmp/dummy NIX_CONF_DIR=/tmp/dummy NIX_SSL_CERT_FILE=/tmp/dummy/no-ca-bundle.crt NIX_STATE_DIR=/tmp/dummy 'NIX_CONFIG=cores = 0' /usr/local/bin/python3.11 ../src/nix-manual/source/command-ref/../../remove_before_wrapper.py src/nix-manual/source/command-ref/new-cli -- /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix/nix --experimental-features nix-command eval -I nix=/wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/src/nix-manual --store dummy:// --impure --raw --expr 'import ../src/nix-manual/source/command-ref/../../generate-manpage.nix true (builtins.readFile ./src/nix-manual/nix.json)'
warning: you don't have Internet access; disabling some network-dependent features
[ 72% 357/491] /usr/local/bin/meson --internal exe --unpickle /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/meson-private/meson_exe_bash_615756088fe0f31b84b52f98d8a05c1fb32c29ec.dat
FAILED: [code=101] src/nix-manual/manual src/nix-manual/markdown
/usr/local/bin/meson --internal exe --unpickle /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/meson-private/meson_exe_bash_615756088fe0f31b84b52f98d8a05c1fb32c29ec.dat
while executing ['/usr/local/bin/bash', '-euo', 'pipefail', '-c', '\n        /usr/local/bin/python3.11 ../src/nix-manual/generate-deps.py ../src/nix-manual > src/nix-manual/manual.d\n        /usr/local/bin/python3.11 ../src/nix-manual/substitute.py summary /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual < ../src/nix-manual/source/SUMMARY.md.in > /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/source/SUMMARY.md\n        sed -e \'s|@version@|2.32.1|g\' < ../src/nix-manual/book.toml.in > /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/book.toml\n        /usr/local/bin/rsync -r --include=\'*.md\' ../src/nix-manual/ /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/\n        (cd /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual; RUST_LOG=warn /usr/local/bin/mdbook build -d /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn\'t implemented" || :; } 3>&2 2>&1 1>&3\n
     rm -rf /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/manual\n        mv /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/html /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/manual\n        find /wrkdirs/usr/ports/sysutils/nix/work/nix-2.32.1/_build/src/nix-manual/manual -iname meson.build -delete\n    ']
--- stdout ---
skipping non-regular file ".version"

--- stderr ---
ERROR invalid key `substitute-search`
```

Thanks
Comment 1 Ashish SHUKLA freebsd_committer freebsd_triage 2025-11-19 10:52:25 UTC
Thanks for the report.

There is also a new release of Nix out. I'll look at updating to it sometime this week.
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2025-11-20 07:51:52 UTC
0.5.1 is out and it could fix this build error.
Laters I will test it.

https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-051

Cheers
Comment 3 Ashish SHUKLA freebsd_committer freebsd_triage 2025-11-20 10:35:51 UTC
(In reply to Nuno Teixeira from comment #2)

I was able to reproduce this in the update (of nix to 2.32.4) as well, so I'm looking forward to the updated patch of mdbook.

Thanks!
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2025-11-20 21:03:28 UTC
(In reply to Ashish SHUKLA from comment #3)

I did some testing with 0.5.1 and error is diferent, log got bigger as 3.7MB and I see there a lot of text that should be processed and it seems not.

Log ends with:

ERROR The "substitute" preprocessor exited unsuccessfully with exit status: 1 status

Let's see if upstream find more incompatibilities or if we can find more info to open an upstream PR.

NOTE: I've updated mdbook PR to 0.5.1.

Cheers
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2025-11-23 15:39:37 UTC
Opened upstream PR: https://github.com/NixOS/nix/issues/14628
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2025-12-02 21:45:09 UTC
Created attachment 265784 [details]
Upstream patch

Results at https://github.com/NixOS/nix/issues/14628#issuecomment-3581120530
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2025-12-07 11:18:04 UTC
(In reply to Nuno Teixeira from comment #6)
(...)

Author answer to pull commit:

https://github.com/NixOS/nix/pull/14690#issuecomment-3604551240

For my tests suffixes are created with old mdbook (at ports) but patch works OK.

What are your thoughts? Commit new mdbook + patched nix (with pkg-plist adjusted)?
Comment 8 Ashish SHUKLA freebsd_committer freebsd_triage 2025-12-08 13:25:41 UTC
(In reply to Nuno Teixeira from comment #7)

The submitted patch worked fine, except for the pkg-plist issue mentioned in the PR. I'll strip cachebuster suffixes in post-install, if they're not referenced anywhere.  I'll commit the update to sysutils/nix later today in the evening.

So, you can commit mdbook update. Sorry to keep you waiting. And many thanks for your help.

Thanks!
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2025-12-08 13:53:16 UTC
(In reply to Ashish SHUKLA from comment #8)

Nice!

As you are about to patch the suffixes and in case that patch conflicts with older mdbook on ports, please feel free to commit mdbook 0.5.1 as well.

Cheers
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-12-09 14:41:02 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1f95bd627f73bbe7b1ec05ef92aed84400ee8c61

commit 1f95bd627f73bbe7b1ec05ef92aed84400ee8c61
Author:     Ashish SHUKLA <ashish@FreeBSD.org>
AuthorDate: 2025-12-09 14:37:29 +0000
Commit:     Ashish SHUKLA <ashish@FreeBSD.org>
CommitDate: 2025-12-09 14:37:29 +0000

    sysutils/nix: Update to 2.32.4

    Many thanks to eduardo@ for help finding the upstream fix for
    fixing with mdbook 0.5.1

    PR:             291079

 sysutils/nix/Makefile  |  6 +++-
 sysutils/nix/distinfo  |  8 +++--
 sysutils/nix/pkg-plist | 93 ++++++++++++++++++++++++--------------------------
 3 files changed, 54 insertions(+), 53 deletions(-)
Comment 11 Ashish SHUKLA freebsd_committer freebsd_triage 2025-12-09 14:43:52 UTC
(In reply to Nuno Teixeira from comment #9)

Hi Nuno,

Since you deferred committing on me, I decided to keep suffixes as mdbook 0.5.1 generates.

Thank you so much for your help.