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

pkg: config reading not supported on Windows #9474

Closed
Alizter opened this issue Dec 12, 2023 · 1 comment · Fixed by #10500
Closed

pkg: config reading not supported on Windows #9474

Alizter opened this issue Dec 12, 2023 · 1 comment · Fixed by #10500

Comments

@Alizter
Copy link
Collaborator

Alizter commented Dec 12, 2023

When building packages on Windows, we get the following error:

PS C:\Users\ali\test> C:\Users\ali\dune\_build\install\default\bin\dune.exe build
Internal error, please report upstream including the contents of _build/log.
Description:
  ("unable to serialize exception",
  { exn = "Failure(\"Windows only. This function isn't implemented.\")" })
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml",
  line 31, characters 17-27
Re-raised at CamlinternalLazy.force_lazy_block in file "camlinternalLazy.ml",
  line 36, characters 4-11
Called from OpamFilename.prettify_path in file
  "vendor/opam/src/core/opamFilename.ml", line 497, characters 33-54
Called from OpamFile.MakeIO.read_opt in file
  "vendor/opam/src/format/opamFile.ml", line 125, characters 19-42
Called from OpamFile.MakeIO.read in file
  "vendor/opam/src/format/opamFile.ml", line 149, characters 10-20
Called from Dune_rules__Pkg_rules.Install_action.Spec.read_variables in file
  "src/dune_rules/pkg_rules.ml", line 1258, characters 16-45
Called from Dune_rules__Async.async in file "src/dune_rules/async.ml", line
  6, characters 30-36
Called from Dune_rules__Pkg_rules.Install_action.Spec.action in file
  "src/dune_rules/pkg_rules.ml", line 1384, characters 25-75
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
  "otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
  "otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11
-> required by
   ("execute-rule",
   { id = 0
   ; info =
       From_dune_file
         { pos_fname = "<none>"
         ; start = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }
         ; stop = { pos_lnum = 1; pos_bol = 0; pos_cnum = 0 }
         }
   })
-> required by ("<unnamed>", ())
-> required by
   ("build-file",
   In_build_dir "_private/default/.pkg/ocaml-system/target/cookie")
-> required by ("pkg-resolve", <opaque>)
-> required by ("pkg-resolve", <opaque>)
-> required by ("pkg-resolve", <opaque>)
-> required by ("native-context", ())
-> required by ("build-contexts", ())
-> required by ("toplevel", ())

It seems that the code from opam that is reading the .config files is a unix-only implementation.

Likely there is something in opamStubs.ml that needs to be supported, but further investigation is needed to work out what.

@Alizter
Copy link
Collaborator Author

Alizter commented Dec 12, 2023

We are missing the implementation of shGetFolderPath. I will work on a patch adding it in.

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

Successfully merging a pull request may close this issue.

1 participant