Broken symbolic link in cram tests involving dune sites

My application uses sites. Concretely, when the program runs it copies the contents of the site to an output folder. When running the program in a cram test, I am encountering broken symlinks:

   $ forester build
+ Success!

   $ file output/tree.xsl
+  output/tree.xsl: broken symbolic link to ../../../../../../default/bin/forester/theme/tree.xsl

I already tried configuring dune’s sandboxing behavior to no avail.

What can I do to make this work?

The docs say

How to Load Additional Files at Runtime - Dune documentation
During tests, the files are copied into the sites through the dependency (package mygui) and (package mygui_material_theme) as for other files in install stanza.

It’s not clear to me what that means. My dune file specifies:

(cram
 (deps
  %{bin:forester}
  (package forester)))

This ended up being an issue with my code. I was shelling out to cp -r. Switching to cp -rl seems to resolve this.