Skip to content
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

Install the "flexdll" package in the toolchains directory on windows #11158

Closed
Tracked by #11161
gridbugs opened this issue Nov 26, 2024 · 5 comments
Closed
Tracked by #11161

Install the "flexdll" package in the toolchains directory on windows #11158

gridbugs opened this issue Nov 26, 2024 · 5 comments

Comments

@gridbugs
Copy link
Collaborator

Dune installs the ocaml compiler package to ~/.cache/dune/toolchains when using package management features. On unix systems the compiler has no dependencies so the only package that must be installed this way is the compiler itself. However on windows the compiler (specifically ocaml-base-compiler) depends on the package flexdll. On windows, flexdll must be installed to the toolchains directory along with the compiler in order to resolve the compiler's dependency on flexdll.

@gridbugs
Copy link
Collaborator Author

Note that dune currently has some logic for rewriting the compiler's build and install commands to install the package to the toolchains directory rather than inside the project's _build directory. This logic is highly specialized to build and install commands for the ocaml-base-compiler's opam package ind it won't generalize to flexdll.

@gridbugs
Copy link
Collaborator Author

gridbugs commented Dec 9, 2024

This turns out not to be necessary. When ocaml is built it needs access to flexdll but after that point flexdll can be removed. Thus there's no reason to keep flexdll around in a user-wide place such as the toolchains dir. Installing it into the _build directory of the first dune project that needs the compiler is an acceptable solution, so no work here is needed.

@gridbugs gridbugs closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
@nojb
Copy link
Collaborator

nojb commented Dec 9, 2024

When ocaml is built it needs access to flexdll but after that point flexdll can be removed.

Are you sure? flexlink is used as a linker on Windows, it is used whenever OCaml builds an executable or plugin in native code.

@gridbugs
Copy link
Collaborator Author

That has been my experience. I built and installed the compiler manually, pointing ./configure at a checkout of flexdll. Then I deleted flexdll and tried using the compiler and it worked fine. @dra27 is there a case where it's necessary to still have flexdll around when the compiler is running?

@nojb
Copy link
Collaborator

nojb commented Dec 12, 2024

That has been my experience. I built and installed the compiler manually, pointing ./configure at a checkout of flexdll. Then I deleted flexdll and tried using the compiler and it worked fine. @dra27 is there a case where it's necessary to still have flexdll around when the compiler is running?

Note that depending on how you configure OCaml, flexlink will be installed next to the compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants