moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.11k stars 190 forks source link

OCaml for Windows Discontinuation and BinTray 403 Errors #548

Open cassie-nahar opened 3 years ago

cassie-nahar commented 3 years ago

The current build procedure for Windows uses the discontinued (as of August 2021) opam-repository-mingw.

Further, the mingw64c compiler from that repository is currently unavailable with a 403 (forbidden) error. I'm not sure whether this is due to BinTray rate-limiting or due to the repository being discontinued. Thankfully the WayBackMachine does have a previous copy of the file.

It seems necessary to find an alternative long-term solution for building on Windows.


As a temporary work-around, you can manually download and install the compiler by downloading the archived file from your browser, then change repo/win32/compilers/4.07.0+mingw64c.comp as follows:

opam-version: "1"
version: "4.07.0"
-src: "https://dl.bintray.com/fdopen/prebuild-win32-ocaml-packages/4.07.0+mingw64c.tar.xz"
+archive: "file:///home/krak/Downloads/4.07.0+mingw64c.tar.xz"

build: [
  [ "sed" "-i" "s#@PREFIX@#%{prefix}%#g" "lib/ocaml/ld.conf" ]
  [ "sed" "-i" "s#@PREFIX@#%{prefix}%#g" "lib/ocaml/Makefile.config" ]
  [ "dash.exe" "install.sh" prefix ]
]

packages: [
  "base-unix"
  "base-bigarray"
  "base-threads"
]
env: [
  [OCAMLLIB = "%{prefix}%/lib/ocaml"]
  [CAML_LD_LIBRARY_PATH = "%{lib}%/stublibs"]
  [CC = "x86_64-w64-mingw32-gcc.exe"]
  [CPP = "x86_64-w64-mingw32-cpp.exe"]
]
djs55 commented 3 years ago

Thanks for the reminder! After a general package update #543 and switching to the "luv" library #539 it should be possible to (for example) build in a Windows container containing ocaml and opam. Now that the old build tools have gone, we should accelerate this work.

junquero commented 3 years ago

I can't downolad the package from WayBackMachine. The download is always interrupted at around 3 or 6 MB. Any other public location to download the package from?

sakai135 commented 3 years ago

@junquero You can download the package from https://github.com/fdopen/ocaml/releases/4.07.0-1