Skip to content

feature: introduce DUNE_PROJECT_ROOT#13934

Merged
rgrinberg merged 1 commit intoocaml:mainfrom
rgrinberg:push-kpkylzrlwrnx
Apr 5, 2026
Merged

feature: introduce DUNE_PROJECT_ROOT#13934
rgrinberg merged 1 commit intoocaml:mainfrom
rgrinberg:push-kpkylzrlwrnx

Conversation

@rgrinberg
Copy link
Copy Markdown
Member

Quite often, actions want to run or look up something relative to their project root rather than the directory when they're defined. The standard workaround is to %{project_root} to these actions. However, this workaround comes with some downsides:

  1. One has to pass this variable manually, and this is rather inconvenient for some actions (like preprocessors)

  2. Passing the %{project_root} this way records the directory in the action's digest. We shouldn't be encouraging actions from observing the project root in this way.

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Mar 27, 2026

@rgrinberg
Copy link
Copy Markdown
Member Author

Providing this via the CLI is fine as well of course.

@Alizter
Copy link
Copy Markdown
Collaborator

Alizter commented Mar 27, 2026

2. Passing the %{project_root} this way records the directory in the action's digest. We shouldn't be encouraging actions from observing the project root in this way.

Do these at least get included in the action digest? Surely changing the value of DUNE_PROJECT_ROOT should be something that can invalidate an action?

@rgrinberg
Copy link
Copy Markdown
Member Author

I don't know why you're so certain. We don't count INSIDE_DUNE towards the digest.

@rgrinberg rgrinberg force-pushed the push-kpkylzrlwrnx branch from 2d03e24 to 419b05c Compare April 4, 2026 22:11
Quite often, actions want to run or look up something relative to their
project root rather than the directory when they're defined. The
standard workaround is to %{project_root} to these actions. However,
this workaround comes with some downsides:

1. One has to pass this variable manually, and this is rather
   inconvenient for some actions (like preprocessors)

2. Passing the %{project_root} this way records the directory in the
   action's digest. We shouldn't be encouraging actions from observing
   the project root in this way.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg rgrinberg force-pushed the push-kpkylzrlwrnx branch from 419b05c to b1d37f0 Compare April 5, 2026 09:32
@rgrinberg rgrinberg merged commit 1f822eb into ocaml:main Apr 5, 2026
12 of 13 checks passed
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.

2 participants