Fix #4842: Installation of different LICENSE files (per opam package in a multi-opam repository/project) by pamod-madubashana · Pull Request #16524 · ocaml/dune · GitHub
Skip to content

Fix #4842: Installation of different LICENSE files (per opam package in a multi-opam repository/project) - #16524

Open
pamod-madubashana wants to merge 1 commit into
ocaml:mainfrom
pamod-madubashana:pamod-madubashana/issue-4842-36992758557
Open

pamod-madubashana wants to merge 1 commit into
ocaml:mainfrom
pamod-madubashana:pamod-madubashana/issue-4842-36992758557

Conversation

@pamod-madubashana

Copy link
Copy Markdown

Fixes #4842

Description

Allow explicit (install) stanzas to override the auto-detected odig doc
files (README*, LICENSE*, CHANGE*, HISTORY*).

Dune automatically installs those files found in the package directory into
the doc section of every package. Until now there was no way to replace
them: adding an (install) stanza that installs e.g.
(LICENSE.md.<package> as LICENSE.md) for a single package produced a
Multiple rules generated for .../doc/<package>/LICENSE.md error, so there
was no way to ship a different LICENSE file per opam package in a
multi-package project.

I now drop an auto-detected doc entry when an explicit user-written
install entry targets the same (section, dst). The explicit entry wins and
no duplicate rule is generated. Auto-detection is unchanged when there is no
explicit override.

Fixes #4842

Verification

The relevant test for this area is the existing odig workspace test:

./dune.exe runtest test/blackbox-tests/test-cases/odig-files-workspace.t

plus a full check with:

./dune.exe build @check @fmt @runtest

I could not run them here: this environment has no OCaml toolchain
(_boot/dune.exe is absent and neither dune nor ocaml is on PATH), so
no test could be run. The change is confined to stanzas_to_entries in
src/dune_rules/install_rules.ml and only filters Dune-sourced Doc
entries that collide with a User-sourced entry on (section, dst).

…kage in a multi-opam repository/project)

Signed-off-by: Pamod Madubashana <contact@pamod.is-a.dev>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Installation of different LICENSE files (per opam package in a multi-opam repository/project)

1 participant