clerk behavior differs when using absolute or relative paths?
Hi,
Not sure whether it's a bug, just a behavior that I would like more context on and possibly a discussion? : running clerk run with a file yields a different behavior when the target file path is absolute or relative.
For instance, in catala-language-server:
(absolute path)
romain@enclume:~/inria/cat_root/catala-language-server$ clerk run /home/romain/inria/cat_root/catala-language-server/test-case-parser/examples/test_case_arith.catala_en --scope B_test
ninja: error: /tmp/clerk_build_ca1757.ninja:133: unknown target '/home/romain/inria/cat_root/catala-language-server/test-case-parser/examples/test_case_arith.catala_en@interpret'
(relative path)
romain@enclume:~/inria/cat_root/catala-language-server$ clerk run test-case-parser/examples/test_case_arith.catala_en --scope B_test
[5/6] <catala> interpret B_test ⇐ _b...ser/examples/test_case_arith.catala_en
┌─[RESULT]─
│ a = Arith.A { -- w: -4 -- x: 2 -- y: 2 -- z: 4,990.0 }
(if that matters, the clerk.toml file is in the examples direcory in this instance)
This is indeed a limitation of Ninja: the "key" identifying a target is a specific PATH, without resolution of the underlying file of any kind. I admit it's a sane default though.
What we could attempt to do is some resolution of file names specified on the command-line before we call Ninja from Clerk, though.
TODO Doc : clerk paths in the CLI should always be relative.