Skip to content

buildDunePackage: fix doc installation#220592

Merged
vbgl merged 1 commit intoNixOS:masterfrom
anmonteiro:anmonteiro/fix-dune-install
Mar 13, 2023
Merged

buildDunePackage: fix doc installation#220592
vbgl merged 1 commit intoNixOS:masterfrom
anmonteiro:anmonteiro/fix-dune-install

Conversation

@anmonteiro
Copy link
Copy Markdown
Member

@anmonteiro anmonteiro commented Mar 11, 2023

The default directory where dune expects docs is in $out/doc, but Nix installs it in $out/share/doc

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.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.

@anmonteiro
Copy link
Copy Markdown
Member Author

  • This makes it possible to depend on (package PKG-NAME) for packages with a doc section
  • As a result, it allows running dune's own tests (which depend on (package cinaps)) inside a nix shell

@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Mar 11, 2023
@anmonteiro anmonteiro requested review from ulrikstrid and vbgl March 11, 2023 05:26
@anmonteiro
Copy link
Copy Markdown
Member Author

Ran nixpkgs-review:

2 packages marked as broken and skipped:
ocamlPackages.extlib-1-7-7 ocamlPackages.reason-native.qcheck-rely

905 packages built:

@vbgl
Copy link
Copy Markdown
Contributor

vbgl commented Mar 12, 2023

@GrahamcOfBorg build ocaml-ng.ocamlPackages_4_07.result

Copy link
Copy Markdown
Contributor

@vbgl vbgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not work for all versions of dune:

dune: unknown option `--docdir'.

Usage: dune install [OPTION]... [PACKAGE]...

Try dune install --help' or dune --help' for more information.

@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Mar 12, 2023

Changelog says --docdir was introduced in Dune 2.9. I suppose we can conditionally add the argument for dune_3?

@anmonteiro
Copy link
Copy Markdown
Member Author

@vbgl good catch, thanks. Is a good alternative to check for duneVersion being 2 or 3?

@ulrikstrid
Copy link
Copy Markdown
Member

@vbgl good catch, thanks. Is a good alternative to check for duneVersion being 2 or 3?

>= 2 should be fine right? Then we don't have to add another case for dune 4.

@ulrikstrid
Copy link
Copy Markdown
Member

Just adding that this is an actual problem and I've tested the repro on ocaml/dune repo. So as soon as we can get the version check in i intend on merging it unless you're strongly opposed @vbgl

The default directory where dune expects docs is in
`$out/doc`, but Nix installs it in `$out/share/doc`
@anmonteiro anmonteiro force-pushed the anmonteiro/fix-dune-install branch from 2da4818 to 143be39 Compare March 13, 2023 17:01
@anmonteiro
Copy link
Copy Markdown
Member Author

Added a check for the dune version

Copy link
Copy Markdown
Contributor

@vbgl vbgl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@vbgl vbgl merged commit 45c3600 into NixOS:master Mar 13, 2023
@anmonteiro anmonteiro deleted the anmonteiro/fix-dune-install branch March 13, 2023 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants