Skip to content

Directory targets that contain symlinks #5945

@corwin-of-amber

Description

@corwin-of-amber

Expected Behavior

If a rule make a directory, and that directory happens to be populated with symbolic links, I expect the symlinks to be present in the compiled tree.

Actual Behavior

Dune stops processing rules and issues this error:

Error: Rule produced a file with unrecognised kind "S_LNK"

Reproduction

E.g. I am using a rule to make node_modules by running npm install.
My rule is this:

(rule
 (targets (dir node_modules))
 (deps
   (sandbox always)
   package.json
   package-lock.json)
 (action
  (progn
   (run chmod +w package-lock.json)
   (run npm install))))

(an unrelated wrinkle is that NPM requires write access to package-lock.json, but that's NPM's problem IMHO)

  • PR with a reproducing test:
  1. Make a directory that contains a package.json file, e.g. this one.
  2. Add a dune file with the rule above (remove the references to package-lock.json if you don't want to have one).
  3. Run dune build.

Specifications

  • Version of dune (output of dune --version): 3.3.1
  • Version of ocaml (output of ocamlc --version): 4.12.0
  • Operating system (distribution and version): macOS Monterey 12.4

Additional information

  • Link to gist with verbose output (run dune with the --verbose flag):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions