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

Doc: nix-shell doc doesn't work (only nix develop .#nixpkgs-manual.shell works) and the redirects complains doc/build-helpers/fixed-point-arguments.chapter.md #362850

Closed
ShamrockLee opened this issue Dec 7, 2024 · 3 comments · Fixed by #375194
Labels
6.topic: documentation Meta-discussion about documentation and its workflow

Comments

@ShamrockLee
Copy link
Contributor

Issue description

  1. Both https://github.com/NixOS/nixpkgs/blob/master/doc/README.md and the Nixpkgs Manual build log is telling me to run nix-shell doc and run redirects <identifier> <path> after adding new documentation anchors, and doc/README.md also sais that nix-shell doc will provide a devmode command. None of the commands presented after invoking nix-shell doc.
  2. When I finally work around the above issue with nix develop .#nixpkgs-manual.shell, I typed redirects add-content ex-build-helpers-mkLocalDerivation-migration doc/build-helpers/fixed-point-arguments.chapter.md, and got OSError: [Errno 30] Read-only file system: '/nix/store/nhx2zqvzxr10wzcn6zgx0y7ynzcgag7w-source/doc/redirects.json'.
  3. Including the redirects-related instructions in the build error message is helpful but doesn't explain the <path> to use. The help message of redirects offers nothing but the available commands and the names of their parameters, which is not very helpful.

Cc:
@GetPsyched (author of #353513)
@NixOS/documentation-team

Steps to reproduce

  1. cd to the Nixpkgs code base.
  2. Check out my feature branch for lib.extendMkDerivation: init #234651.
  3. Run nix-shell doc at the root of the Nixpkgs code base.
  4. Run type redirects and see error.
  5. Run type devmode and see error.
  6. Run nix develop .#nixpkgs-manual.shell get into the shell and get the above two commands.
  7. Run redirects add-content ex-build-helpers-mkLocalDerivation-migration doc/build-helpers/fixed-point-arguments.chapter.md
  8. See the following error messages:
Added new identifier: ex-build-helpers-mkLocalDerivation-migration
Traceback (most recent call last):
  File "/nix/store/74bkxpm7plcajxpn9ayhghwfgv0ddjhd-nixos-render-docs-redirects-0.0/bin/.redirects-wrapped", line 9, in <module>
    sys.exit(main())
             ^^^^^^
  File "/nix/store/74bkxpm7plcajxpn9ayhghwfgv0ddjhd-nixos-render-docs-redirects-0.0/lib/python3.12/site-packages/nixos_render_docs_redirects/__init__.py", line 112, in main
    with open(args.file, "w") as file:
         ^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 30] Read-only file system: '/nix/store/nhx2zqvzxr10wzcn6zgx0y7ynzcgag7w-source/doc/redirects.json'

Technical details

@ShamrockLee ShamrockLee added the 6.topic: documentation Meta-discussion about documentation and its workflow label Dec 7, 2024
@GetPsyched
Copy link
Member

Thanks for reporting, I had this issue during development but it was resolved before merger; looks like some edge case was missed. I'm looking into this

@magneticflux-
Copy link
Contributor

I got this same error trying to work from the main nixpkgs directory. Moving to the nixpkgs/doc directory and running nix-shell worked as expected.

@fricklerhandwerk
Copy link
Contributor

@ShamrockLee thanks for reporting, fixed 1 and 2 in #375194. Please open a separate issue for 3, this needs a bit more deliberation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: documentation Meta-discussion about documentation and its workflow
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants