Bug 2415126 - nix manpages contain @docroot@ and references to markdown files
Summary: nix manpages contain @docroot@ and references to markdown files
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: nix
Version: rawhide
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jens Petersen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-11-14 22:46 UTC by Dennis Schridde
Modified: 2025-11-24 17:01 UTC (History)
1 user (show)

Fixed In Version: nix-2.31.2-19.fc44
Clone Of:
Environment:
Last Closed: 2025-11-24 17:01:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dennis Schridde 2025-11-14 22:46:18 UTC
From nix-channel(1):
>               Dependencies  on  other  Nix  expressions  can  be  declared  explicitly with: - fetchurl ⟨@doc‐
>               root@/language/builtins.md#builtins-fetchurl⟩,           fetchTarball            ⟨@docroot@/lan‐
>               guage/builtins.md#builtins-fetchTarball⟩,  or fetchGit ⟨@docroot@/language/builtins.md#builtins-
>               fetchGit⟩ in Nix expressions - the -I option ⟨@docroot@/command-ref/opt-common.md#opt-I⟩ in com‐
>               mand line invocations

From nix(1):
>               Installables  are part of the unstable nix-command experimental feature ⟨@docroot@/development/experimen‐
>               tal-features.md#xp-feature-nix-command⟩, and subject to change without notice.


Reproducible: Always



Expected Results:
I would expect man pages to neither contain @docroot@ nor paths to markdown files.

Comment 1 Jens Petersen 2025-11-15 05:34:00 UTC
Reproduced: the @docroot@'s may be an artifact of my hack to disable mdbook perhaps.
I don't feel it is very serious but I can try to do something later perhaps.

The paths to .md files are also visible in the nixos nix package however.
Dunno if there is some way to disable them in lowdown?
If you are concerned about it please report it to nix upstream.
I agree it doesn't really make sense for them to appear in the manpages,
whereas they are needed for the manual I suppose:

cf https://hydra.nixos.org/build/313564044/download/1/manual/command-ref/new-cli/nix.html

Comment 2 Jens Petersen 2025-11-15 06:02:30 UTC
(In reply to Jens Petersen from comment #1)
> The paths to .md files are also visible in the nixos nix package however.

(Well I mean nix in nixpkgs (nixpkgs#nix) to be precise, but I think it is the same thing.)

> https://hydra.nixos.org/build/313564044/download/1/manual/command-ref/new-
> cli/nix.html

(^ redirected from https://nix.dev/manual/nix/development/)

https://nix.dev/manual/nix/2.32/command-ref/new-cli/nix is probably a better link


I tried briefly with pandoc, however it would need adaption to work as well.

$ pandoc -s -t man nix-build.md | man -l -

Comment 3 Jens Petersen 2025-11-15 06:04:57 UTC
I meant to add I didn't see a (good way) to suppress the filepaths with lowdown.

Comment 4 Jens Petersen 2025-11-15 06:10:45 UTC
Also looking a bit more at the manual code: indeed the substitute for @docroot@ is performed by mdbook preprocessing.

But anyway I think it would be easy/enough to replace `@docroot@` with `.` for now, shrug.

Comment 5 Jens Petersen 2025-11-15 06:16:24 UTC
(In reply to Jens Petersen from comment #4)
> But anyway I think it would be easy/enough to replace `@docroot@` with `.`

I will do that in the next build

Comment 6 Jens Petersen 2025-11-15 06:18:04 UTC
(Actually just removing `@docroot@/` is probably even cleaner)

Comment 7 Jens Petersen 2025-11-19 06:59:12 UTC
I opened https://github.com/kristapsdz/lowdown/issues/170

Comment 8 Jens Petersen 2025-11-19 08:02:26 UTC
Actually a much simpler fix is to remove the relative URL (.UR) lines from the roff files.


Note You need to log in before you can comment on or make changes to this bug.