-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output relative paths in error output to improve reproducibility #4832
Comments
We're aiming to deliver a RWOv2 to our publisher in early September, so if this could be snuck into a dune point release that would be very helpful to us getting the book stable in August ;-) |
I checked dune's code and we already make an attempt to make paths from _build relative. Do you have a special setup in rwo where you invoke dune from inside dune? |
@ejgallego should this be added to the 2.9.1 milestone ? |
That's exactly what seems to be happening @rgrinberg -- we're calling dune-in-dune in order to evaluate examples within the book. It's calling dune with a --root within the tree. But why would that make the invoked dune output an absolute build path? |
If memory serves the logic only outputs relative paths when they are children of the |
I'm not sure. This PR shows where the bad paths show up: And here's the error: Scroll to the bottom to see the problematic corrections. The paths do look like they're under _build. We're doing something a little weird here, where we want to run dune-within-dune, because we're invoking dune as part of an example, as part of the overall build of the book. |
It happens because the outer instance of dune is appending its own build directory to However, some possible workarounds are:
|
I would have no problem if we converge on a solution. |
I can't quite find a clean workaround for this in RWO. The specific stanza we had is this:
What's going on here is that there is a README.md file with an mdx stanza, and the environment entirely built using a duniverse (the "outer dune"). The One other workaround: is it necessary to show the results of a patdiff exit 1 in the build output? This is the normal course of events if there is a diff, so perhaps we could just show the diff and not the exact arguments to patdiff (unless in verbose mode)? I.e. instead of:
just show
for the diff. |
Another alternative is also to be able to manually specify a |
This is a good idea. There's already a hack to clean up the output of ocamlc. We could do something similar for diff and patdiff. Note that to be consistent with our hack for ocamlc, this will only be enabled in the
One of the workarounds I've mentioned to is to include the following stanza somewhere in your dune projects: (env
(_
(binaries ./patdiff.exe)))
(copy /path/to/patdiff ./patdiff.exe) Your suggestion would replace the |
In RWO, we have expect tests that fail, but result in host-paths being leaked into the expect tests. For example
could be
in order to have the same output irrespective of what host its run on. See realworldocaml/book#3448 for more.
The text was updated successfully, but these errors were encountered: