ocaml / ocaml/dune

Vendoring of foreign source trees with leading underscores

Open
#7,811 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

vendoring
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Following up on https://github.com/ocaml/dune/issues/4795, dune is still lacking convenient way to manage vendored foreign source trees that might include underscores.

I'm currently vendoring a bunch of Rust crates into my OCaml project and use the following stanza to depend on it in the rule, invoking cargo: (source_tree ../vendor). After adding new dependencies, cargo started to complain about missing files, after quick research (good thing I know dune has some oddities regarding underscores!) I found the issue linked above and applied a fix in my dune file:

(vendored_dirs vendor)
(subdir vendor/futures-core/src/task/ (dirs :standard __internal))

This behavior with underscores is certainly confusing, and lack of decent workaround is disappointing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked issue #4795 and the vendored_dirs and subdir stanzas shown in this report. Reproduce the missing-file behavior with the vendored Rust tree, then determine the intended handling for source paths containing leading underscores. Done means the foreign source tree can be vendored without the reported cargo failures and the behavior is covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml, rust
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.