Skip to content

Windows findlib.conf path variable breaks. Needs a semicolon instead of colon as a path separator #110

@jesse-greathouse

Description

@jesse-greathouse

On Windows 11

I'm not executing under Cygwin or WSL, this is just on plain Windows in PowerShell.

PS C:\Users\jessegreathouse> opam config report
# opam config report
# opam-version         2.4.1
# self-upgrade         no
# system               arch=x86_64 os=win32 os-distribution=msys2 os-version=10.0.26100
# solver               builtin-mccs+glpk
# install-criteria     -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria     -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs                 23
# repositories         1 (http) (default repo at 5b99878077ddf3134c09e188d937954bd33cfa58)
# pinned               1 (git)
# current-switch       5.3.0
# invariant            ["ocaml-base-compiler" {= "5.3.0"}]
# compiler-packages    arch-x86_64.1, conf-mingw-w64-gcc-x86_64.1, flexdll.0.44, msys2.0.1.0, msys2-mingw64.1, ocaml-base-compiler.5.3.0, ocaml-compiler.5.3.0, ocaml-env-mingw64.1, ocaml-options-vanilla.1, system-mingw.1
# msys2:msystem        MINGW64
# msys2:carch          x86_64
# msys2:chost          x86_64-w64-mingw32
# msys2:root           /mingw64
# msys2:native-root    C:\msys64\mingw64
# msys2:package-prefix mingw-w64-x86_64
# ocaml:native         true
# ocaml:native-tools   true
# ocaml:native-dynlink true
# ocaml:stubsdir       C:\Users\jessegreathouse\AppData\Local\opam\5.3.0/lib/ocaml/stublibs;C:\Users\jessegreathouse\AppData\Local\opam\5.3.0/lib/ocaml
# ocaml:preinstalled   false
# ocaml:compiler       5.3.0

The findlib.conf file was generated using ":" (colon) as a path separator instead of ";" (semicolon). With Windows paths this won't work because Windows paths recognize the colon character as part of the path for it's drive letters. (e.g. "C:" , "D:", etc...)

The findlib.conf was originally generated like this:

destdir="C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0\\lib"
path="C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0/lib/ocaml:C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0\\lib"
ocamlc="ocamlc.opt"
ocamlopt="ocamlopt.opt"
ocamldep="ocamldep.opt"
ocamldoc="ocamldoc.opt"

The problem was the colon in the middle of the path= value:

path="C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0/lib/ocaml:C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0\\lib"

Once I changed it to this (semicolon):

path="C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0/lib/ocaml;C:\\Users\\jessegreathouse\\AppData\\Local\\opam\\5.3.0\\lib"

everything was fine.

Difficult to understand how severe or important this is; but I thought I'd mention it in case anyone needed to see this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions