Skip to content

Document that executables using dune-configurator depend on config file - #11964

Open
shym wants to merge 1 commit into
ocaml:mainfrom
shym:dep-configurator
Open

Document that executables using dune-configurator depend on config file#11964
shym wants to merge 1 commit into
ocaml:mainfrom
shym:dep-configurator

Conversation

@shym

@shym shym commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

This PR proposes to document in the example of a program using dune-configurator that it depends on the configuration file it will read so that dune will know it must run the program again if and when the configuration changes. The proposed approach uses a glob to make it a bit more robust to changes (of file names or paths and dune-configurator versions).

The corresponding issue, namely a case in which the program should be run again and wasn’t, came up with the mirage-crypto project which uses dune-configurator to detect some C flags that are specific to the target architecture: a change of the target architecture from x86_64 to arm64 didn’t trigger a re-run of the configure program; then the build failed when trying to pass x86_64-specific flags to the arm64 gcc compiler.

The explicit dependency suggested by this PR fixes that issue. The question that arose in the mirage-crypto PR is whether that’s the proper way to express that dependency, as it is referring to files that are created implicitly by dune. What do you think about that?

…file

In the documentation, indicate in the example of a program using
`dune-configurator` that it depends on the configuration file it will
read so that dune will know it must run the program again if and when
the configuration changes

Signed-off-by: Samuel Hym <samuel@tarides.com>
@rgrinberg

Copy link
Copy Markdown
Member

I would prefer not to point users at using this internal path. It has changed over the years and it might again.

How about we introduce a special action that runs a configurator binary and introduces a dependency on this file? Or, we add a new type of dependency to the specification in (deps ..).

@shym

shym commented Jul 7, 2025

Copy link
Copy Markdown
Contributor Author

I would prefer not to point users at using this internal path. It has changed over the years and it might again.

Indeed it felt dangerous territory to depend on something in .dune/

Or, we add a new type of dependency to the specification in (deps ..).

That would be a nice solution!

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.

5 participants