Skip to content

Promote into doesn't accept dune variables #12742

@pedrobslisboa

Description

@pedrobslisboa

Current behavior

Currently, Dune doesn't accept variables in (mode (promote (into ...))). When trying to use it, we get this error:

File "frontend/packages/admin-support/src/dune", line 61, characters 9-62:
61 |    (into %{workspace_root}/public/app/assets/css/admin-support)))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Atom or quoted string expected
Had 1 error, waiting for filesystem changes...

Desired Behavior

It would be nice if we could use variables like %{workspace_root} in the (mode (promote (into ...)))

Example

(rule
 (target styles.css)
 (alias fe.extract-styles)
 (mode
  (promote
   (into %{workspace_root}/public/app/assets/css/admin-support)))
 (deps
  (glob_files_rec ./**.pp.ml))
 (action
  (progn
   (echo "Generating styles.css")
   (run styled-ppx.generate --output %{target} %{deps}))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions