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

NixOS manual: docbook schema configuration uses missing path #24959

Closed
jmitchell opened this issue Apr 16, 2017 · 6 comments
Closed

NixOS manual: docbook schema configuration uses missing path #24959

jmitchell opened this issue Apr 16, 2017 · 6 comments

Comments

@jmitchell
Copy link
Contributor

Issue description

While following the instructions in the manual to support DocBook 5 XML editing in Emacs I discovered the recommended schema configuration doesn't work when docbook5 is installed via environment.systemPackages. Specifically, /run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc doesn't exist.

Steps to reproduce

  1. add docbook5 to environment.systemPackages in /etc/nixos/configuration.nix
  2. run nixos-rebuild switch
  3. add (add-to-list 'rng-schema-locating-files "~/.emacs.d/schemas.xml") to Emacs configuration
  4. write the following to ~/.emacs.d/schemas.xml
<?xml version="1.0"?>
<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
  <namespace ns="http://docbook.org/ns/docbook"
             uri="/run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc"/>
</locatingRules>
  1. open $NIXPKGS/doc/manual.xml in Emacs.
  2. go to *Messages* buffer and see the following error:
File mode specification error: (file-error Opening input file No such file or directory /run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc)
  1. notice that /run/current-system/sw/share has no xml directory.

Workaround

Use the other suggested approach where docbook5 is installed ad-hoc and the docbookxi.rnc path in the schemas.xml points to user profile instead.

Technical details

  • System: 17.03.945.5acb454e2a (Gorilla)
  • Nix version: nix-env (Nix) 1.11.8
  • Nixpkgs version: "17.03.945.5acb454e2a"
@rvl
Copy link
Contributor

rvl commented Apr 17, 2017

I have the file /run/current-system/sw/share/xml/docbook-5.0/rng/docbookxi.rnc.

When I remove pkgs.docbook5 from environment.systemPackages and nixos-rebuild switch, the directory /run/current-system/sw/share/xml/docbook-5.0 disappears.

Is docbook5 in the list when you run nixos-option environment.systemPackages | grep --color docbook5?

@jmitchell
Copy link
Contributor Author

jmitchell commented Apr 23, 2017

Is docbook5 in the list when you run nixos-option environment.systemPackages | grep --color docbook5?

Yes, but even so the /run/current-system/sw/share directory still has no xml directory. Steps to ensure my environment is properly cleaned and set up to have docbook5 in the configured system packages.

  1. nix-env -e docbook5
  2. removed pkgs.docbook5 from environment.systemPackages
  3. nix-collect-garbage
  4. confirmed your suggested command returns nothing
  5. added pkgs.docbook5 back to configured environment.systemPackages and run nixos-rebuild switch
  6. ran your command again and saw "/nix/store/vv6pg515z9n70drggdpc9h04aw6zmlv5-docbook5-5.0" in the output
  7. confirmed "/nix/store/vv6pg515z9n70drggdpc9h04aw6zmlv5-docbook5-5.0/share/xml/docbook-5.0/rng/docbookxi.rnc exists, but /run/current-system/sw/share/xml doesn't.

@rvl
Copy link
Contributor

rvl commented Oct 31, 2017

Hi @jmitchell, Just checking, do you now have /run/current-system/sw/share/xml/docbook-5.0 if pkgs.docbook5 is in environment.systemPackages?

@jtojnar
Copy link
Member

jtojnar commented Sep 7, 2019

I would suspect that this only works for some users because some module puts /share into their environment.pathsToLink. I believe this kind of carpet bombing is not correct, see #47173.

Instead of setting global paths in you profile, I would recommend to follow the suggestion in https://github.com/NixOS/nix-pills#development, along with a simplified config from #68236

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@pennae
Copy link
Contributor

pennae commented Jul 3, 2023

docbook is no longer used for the manuals :)

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 3, 2023
@pennae pennae closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants