Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Wrong stubs are used when opam sources are embedded in a dune workspace #4726

Open
emillon opened this issue Jun 23, 2021 · 1 comment
Open

Comments

@emillon
Copy link
Contributor

emillon commented Jun 23, 2021

Hi,

We're using the opam libraries in a project. These libraries are not installed through opam, they are vendored within a dune workspace. The resulting binary fails at runtime on Windows with:

           (Failure "Windows only. This function isn't implemented.")
           Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
           Called from OpamStd.OpamSys.system in file "duniverse/opam/src/core/opamStd.ml" (inlined), line 850, characters 15-54
           Called from OpamProcess.cygwin_create_process_env.f in file "duniverse/opam/src/core/opamProcess.ml", line 159, characters 37-60
           Called from OpamStd.OpamList.filter_map.loop in file "duniverse/opam/src/core/opamStd.ml", line 129, characters 14-17
           Called from OpamProcess.cygwin_create_process_env in file "duniverse/opam/src/core/opamProcess.ml", line 183, characters 12-41

My understanding is that opamStubs.ml.dummy are selected because the fallback rules are triggering. I think that this does not happen in the "usual" build route because of what happens with ./configure but I'm curious to see if opam can support this use case better (the fallback behaviour could be to let dune detect the OS, for example).

Thanks!

@dra27
Copy link
Member

dra27 commented Jun 23, 2021

I should have a look at the current state of enabled_if support in Dune - the fallback files were added precisely to allow this kind of use to work on Linux so it's time to have a better look at Windows.

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

Successfully merging a pull request may close this issue.

3 participants