You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opam doesn't handle well setenv in Windows / Cygwin, especially with file lists.
To demonstrate, I'm using the opam images for Docker on Windows. The image ships OCaml for Windows from fdopen, and opam 2.0.8.
Dockerfile
FROM ocaml/opam:windows-mingw-ocaml-4.13
COPY bugs.cmd .
RUN .\bugs.cmd
bugs.cmd
ocaml-env exec -- echo%PKG_CONFIG_PATH%@rem nothing, ok
ocaml-env exec -- printenv PKG_CONFIG_PATH
@rem nothing, ok
ocaml-env exec -- opam depext -yi conf-pkg-config
ocaml-env exec -- echo%PKG_CONFIG_PATH%@rem wrong: nothing's exported
ocaml-env exec -- printenv PKG_CONFIG_PATH
@rem good C:/opam/.opam/4.13/lib/pkgconfig
ocaml-env exec -- C:\cygwin64\bin\bash.exe --login -c "printenv PKG_CONFIG_PATH"@rem C:/opam/.opam/4.13/lib/pkgconfig:C:/opam/.opam/4.13/lib/pkgconfig@rem wrong: duplicated, uses : as path separator, should use cygwin-style paths
C:\cygwin64\bin\bash.exe --login -c "ocaml-env exec -- printenv PKG_CONFIG_PATH"@rem C:/opam/.opam/4.13/lib/pkgconfig;C:/opam/.opam/4.13/lib/pkgconfig:@rem wrong: duplicated, ends with a :, should use cygwin-style paths
For reference, the ENTRYPOINT of the image is ["ocaml-env" "exec" "--64" "--"] and its CMD is cmd.exe.
I have to work around this issue with lines such as
ocaml-env exec -- opam source mirage-crypto.0.10.4
cd mirage-crypto.0.10.4
ocaml-env exec -- opam install -y --deps-only --with-test ./mirage-crypto.opam
ocaml-env exec -- env PKG_CONFIG_PATH=/cygdrive/c/opam/.opam/4.13/lib/pkgconfig dune build -p mirage-crypto @install
ocaml-env exec -- env PKG_CONFIG_PATH=/cygdrive/c/opam/.opam/4.13/lib/pkgconfig opam install -y ./mirage-crypto.opam
# the following would be simpler, but doesn't work (maybe it's another unrelated problem)
ocaml-env exec -- env PKG_CONFIG_PATH=/cygdrive/c/opam/.opam/4.13/lib/pkgconfig opam install -y mirage-crypto
Opam doesn't handle well
setenv
in Windows / Cygwin, especially with file lists.To demonstrate, I'm using the opam images for Docker on Windows. The image ships OCaml for Windows from fdopen, and opam 2.0.8.
Dockerfile
bugs.cmd
For reference, the
ENTRYPOINT
of the image is["ocaml-env" "exec" "--64" "--"]
and itsCMD
iscmd.exe
.I have to work around this issue with lines such as
The culprit line in conf-pkg-config is here:
The text was updated successfully, but these errors were encountered: