Get dune build working on Windows#92
Conversation
- `CAPNP_INCLUDE` environment variable can be set if the build machine does not have a standard location to store `capnp/*.capnp` schema file (ex. `/usr/include` on Unix) - Windows compiler flags and commands are detected and used in benchmarks
talex5
left a comment
There was a problem hiding this comment.
I'm a bit confused about why CAPNP_INCLUDE is needed. If we can find the capnp binary OK on Windows, can't that can find the includes relative to itself?
| (name main) | ||
| (enabled_if (= %{architecture} amd64)) | ||
| (libraries capnp capnp_unix fast_rand base) | ||
| (ocamlopt_flags :standard -O3 -inline 2000)) |
There was a problem hiding this comment.
We could just get rid of this. It was for flambda, but it's probably out of date by now anyway.
| (rule | ||
| (enabled_if (= %{os_type} "Win32")) | ||
| (target ln.lines) | ||
| (action (with-stdout-to %{target} (echo "cmd\n/c\ncopy")))) | ||
|
|
There was a problem hiding this comment.
It might be easier to have main.ml just take the benchmark name as the first argument instead of using the program name. I'm not sure why it's using hard-links at the moment.
EDIT: Here is the |
|
Yes, it seems reasonable to get this in the upstream binary. Otherwise, we'll have to do this dune stuff in every project that uses capnp. |
If I were the maintainer of I'll let you ask for the upstream issue. In the meantime, we can keep this issue open. I'll update the other two minor and uncontroversial things you mentioned ( |
During capnp-ocaml development I want
dune buildto work. That compiles the whole project, including the benchmark code.dune buildmakes it easy to see if I'm breaking other code, even if I can't run the benchmarks (yet) on Windows.Two changes:
CAPNP_INCLUDEenvironment variable can be set if the build machine does not have a standard location to storecapnp/*.capnpschema file (ex./usr/includeon Unix)I also added in manual compile instructions for Windows.
The python benchmark tool was not modified. Running the benchmark on Unix is fine for now.