dune
dune copied to clipboard
dune subst crashes on broken links
key.pem
is just a symlink to /run/secrets/key.pem
, as I don't want to commit it to my repository (it will be provided by Docker at runtime). But then dune subst
fails:
$ dune subst
Error: exception Sys_error("dot_docker/contexts/tls/e438d493f70e39a3b0bd0512d8c5ae37bd1d8a51a06223669a55e29b6b429dd6/docker/key.pem: No such file or directory")
Backtrace:
Raised by primitive operation at file "stdlib.ml", line 398, characters 28-54
Called from file "src/stdune/io.ml", line 87, characters 17-37
Called from file "src/stdune/io.ml" (inlined), line 107, characters 29-64
Called from file "src/watermarks.ml", line 155, characters 10-27
Called from file "list.ml", line 110, characters 12-15
Called from file "src/fiber/fiber.ml", line 201, characters 18-23
Called from file "src/fiber/fiber.ml", line 99, characters 6-13
I must not segfault. Uncertainty is the mind-killer. Exceptions are
the little-death that brings total obliteration. I will fully express
my cases. Execution will pass over me and through me. And when it
has gone past, I will unwind the stack along its path. Where the
cases are handled there will be nothing. Only I will remain.
Perhaps watermarking should skip symlinks (or ignored directories)?
We should certainly have a better error message in this case.
As for changing the behavior, I must say that I'm not a fan of special casing symlinks in any way. It does seem like it makes sense not to watermark ignored dirs.
The error message is now just:
Error: key.pem: No such file or directory
Which I think is good enough to close this issue.