ocaml / ocaml/dune

Fl_dynload.load_packages in a PPX

Open
#3,214 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected Behavior

Fl_dynload.load_packages should load packages, even when used inside a PPX rewriter.

Actual Behavior

Fl_dynload.load_packages fails to load any packages since findlib is not properly initialized in the executable generated for PPX preprocessors: the file findlib_initl.ml-gen, which is generated usually for executable targets that link with findlib.dynload, is not generated for PPX preprocessors.

Reproduction

Specifications

  • Version of dune (output of dune --version): 2.3.1
  • Version of ocaml (output of ocamlc --version) 4.09.0
  • Operating system (distribution and version): Ubuntu 19.10

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 reproducing test in PR #3213 and inspect how findlib_initl.ml-gen is generated for executable targets versus PPX preprocessors. Verify the behavior of Fl_dynload.load_packages inside a PPX rewriter; done means the packages load successfully under the stated Dune and OCaml versions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.