caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] opam-cross-windows
@ 2016-03-13  9:02 whitequark
  2016-03-14 19:55 ` Martin DeMello
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: whitequark @ 2016-03-13  9:02 UTC (permalink / raw)
  To: caml-list

Hi all,

I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain
in the spirit of opam-cross-android[2] (ex opam-android).
It provides easy cross-compilation of the OCaml compiler
and select packages from any *nix environment to 32-bit
and 64-bit x86 Windows.

There aren't many packages yet but you're encouraged to submit
your own. Personally, I find the porting process that uses
the opam-cross-* conventions so simple and robust that it
can be done nearly mindlessly.

The cross-compiled package definitions themselves are
identical to the ones from opam-cross-android (except for
s/android/windows) so I think cross-compilation should gain
at least minimal OPAM support; I've described my proposal
at [3].

[1]: https://github.com/whitequark/opam-cross-windows
[2]: https://github.com/whitequark/opam-cross-android
[3]: https://github.com/ocaml/opam/issues/2476

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-13  9:02 [Caml-list] [ANN] opam-cross-windows whitequark
@ 2016-03-14 19:55 ` Martin DeMello
  2016-03-14 20:14   ` Adrien Nader
  2016-03-15  8:26 ` Soegtrop, Michael
  2016-05-20 18:38 ` Boutillier, Pierre
  2 siblings, 1 reply; 21+ messages in thread
From: Martin DeMello @ 2016-03-14 19:55 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

If anyone has gotten this working on ubuntu, please share the mingw
packages you had to install for it. (If not I'll report back once I do.)

martin

On Sun, Mar 13, 2016 at 1:02 AM, whitequark <whitequark@whitequark.org>
wrote:

> Hi all,
>
> I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain
> in the spirit of opam-cross-android[2] (ex opam-android).
> It provides easy cross-compilation of the OCaml compiler
> and select packages from any *nix environment to 32-bit
> and 64-bit x86 Windows.
>
> There aren't many packages yet but you're encouraged to submit
> your own. Personally, I find the porting process that uses
> the opam-cross-* conventions so simple and robust that it
> can be done nearly mindlessly.
>
> The cross-compiled package definitions themselves are
> identical to the ones from opam-cross-android (except for
> s/android/windows) so I think cross-compilation should gain
> at least minimal OPAM support; I've described my proposal
> at [3].
>
> [1]: https://github.com/whitequark/opam-cross-windows
> [2]: https://github.com/whitequark/opam-cross-android
> [3]: https://github.com/ocaml/opam/issues/2476
>
> --
> whitequark
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 2448 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-14 19:55 ` Martin DeMello
@ 2016-03-14 20:14   ` Adrien Nader
  2016-03-14 20:26     ` Martin DeMello
  0 siblings, 1 reply; 21+ messages in thread
From: Adrien Nader @ 2016-03-14 20:14 UTC (permalink / raw)
  To: Martin DeMello; +Cc: whitequark, caml-list

Hi,

I can't tell much about Ubuntu specifically but there aren't many
mingw-w64-related packages in Ubuntu. I'm assuming you're not trying to
use mingw.org because it's 2016.
It would be useful that you mention which Ubuntu version you're using
because 12.04 has GCC 4.6.3 and mingw-w64 2.0.1 while 16.04 has GCC
5.3.1 and mingw-w64 4.0.4. There shouldn't be issues but it's possible
nonetheless.

There is a "mingw-w64" meta package (maybe not in all versions though)
that should give you a complete environment.

Apart from that, providing the error message(s) would be useful. :) 

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-14 20:14   ` Adrien Nader
@ 2016-03-14 20:26     ` Martin DeMello
  2016-03-14 20:39       ` Adrien Nader
  2016-03-15  8:37       ` whitequark
  0 siblings, 2 replies; 21+ messages in thread
From: Martin DeMello @ 2016-03-14 20:26 UTC (permalink / raw)
  To: Adrien Nader; +Cc: whitequark, caml-list

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

Oh, it's just a matter of installing packages one by one until things
compile :) More tedious than anything else; I just didn't want to go
through the process if someone had already. e.g. this is how I started off

$ wajig install mingw-w64-x86-64-dev
$ wajig install mingw-w64-i686-dev
$ opam install ocaml-windows

### stderr ###
# + x86_64-w64-mingw32-gcc --version
# sh: x86_64-w64-mingw32-gcc: command not found

I missed that there was a metapackage though; I'll give that a try.

martin


On Mon, Mar 14, 2016 at 1:14 PM, Adrien Nader <adrien@notk.org> wrote:

> Hi,
>
> I can't tell much about Ubuntu specifically but there aren't many
> mingw-w64-related packages in Ubuntu. I'm assuming you're not trying to
> use mingw.org because it's 2016.
> It would be useful that you mention which Ubuntu version you're using
> because 12.04 has GCC 4.6.3 and mingw-w64 2.0.1 while 16.04 has GCC
> 5.3.1 and mingw-w64 4.0.4. There shouldn't be issues but it's possible
> nonetheless.
>
> There is a "mingw-w64" meta package (maybe not in all versions though)
> that should give you a complete environment.
>
> Apart from that, providing the error message(s) would be useful. :)
>
> --
> Adrien Nader
>

[-- Attachment #2: Type: text/html, Size: 1901 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-14 20:26     ` Martin DeMello
@ 2016-03-14 20:39       ` Adrien Nader
  2016-03-14 21:10         ` Martin DeMello
  2016-03-15  8:37       ` whitequark
  1 sibling, 1 reply; 21+ messages in thread
From: Adrien Nader @ 2016-03-14 20:39 UTC (permalink / raw)
  To: Martin DeMello; +Cc: whitequark, caml-list

On Mon, Mar 14, 2016, Martin DeMello wrote:
> Oh, it's just a matter of installing packages one by one until things
> compile :) More tedious than anything else; I just didn't want to go
> through the process if someone had already. e.g. this is how I started off
> 
> $ wajig install mingw-w64-x86-64-dev
> $ wajig install mingw-w64-i686-dev
> $ opam install ocaml-windows
> 
> ### stderr ###
> # + x86_64-w64-mingw32-gcc --version
> # sh: x86_64-w64-mingw32-gcc: command not found
> 
> I missed that there was a metapackage though; I'll give that a try.

These are the packages for the headers and libraries that are required
to get linking against Windows libraries, nothing more. In particular
this doesn't provide a binutils nor a GCC. The metapackage should
therefore solve your (current) issue.

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-14 20:39       ` Adrien Nader
@ 2016-03-14 21:10         ` Martin DeMello
  0 siblings, 0 replies; 21+ messages in thread
From: Martin DeMello @ 2016-03-14 21:10 UTC (permalink / raw)
  To: Adrien Nader; +Cc: whitequark, caml-list

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Yep, metapackage worked like a charm! Thanks, I think I've gotten too used
to just searching for the packages marked -dev when I run into compilation
issues.

martin

On Mon, Mar 14, 2016 at 1:39 PM, Adrien Nader <adrien@notk.org> wrote:

> On Mon, Mar 14, 2016, Martin DeMello wrote:
> > Oh, it's just a matter of installing packages one by one until things
> > compile :) More tedious than anything else; I just didn't want to go
> > through the process if someone had already. e.g. this is how I started
> off
> >
> > $ wajig install mingw-w64-x86-64-dev
> > $ wajig install mingw-w64-i686-dev
> > $ opam install ocaml-windows
> >
> > ### stderr ###
> > # + x86_64-w64-mingw32-gcc --version
> > # sh: x86_64-w64-mingw32-gcc: command not found
> >
> > I missed that there was a metapackage though; I'll give that a try.
>
> These are the packages for the headers and libraries that are required
> to get linking against Windows libraries, nothing more. In particular
> this doesn't provide a binutils nor a GCC. The metapackage should
> therefore solve your (current) issue.
>
> --
> Adrien Nader
>

[-- Attachment #2: Type: text/html, Size: 1617 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-13  9:02 [Caml-list] [ANN] opam-cross-windows whitequark
  2016-03-14 19:55 ` Martin DeMello
@ 2016-03-15  8:26 ` Soegtrop, Michael
  2016-03-15  8:36   ` whitequark
  2016-03-15  9:12   ` David Allsopp
  2016-05-20 18:38 ` Boutillier, Pierre
  2 siblings, 2 replies; 21+ messages in thread
From: Soegtrop, Michael @ 2016-03-15  8:26 UTC (permalink / raw)
  To: whitequark, caml-list

Dear Whitequark,

> I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain in the spirit
> of opam-cross-android[2] (ex opam-android).

Do you think there are good chances that this also works for cross compiling for MinGW on cygwin.
Or asked in another way: are there known reasons why this shouldn't work?

I made some scripts to compile things like GTK, pango, cairo, ocaml, menhir, Coq, CoqIDE, ... for MinGW on cygwin and also to setup cygwin with the required packages automatically in a reproducible way. A MinGW cross Opam for cygwin would be the logical next step. Together with my scripts this might be a reproducible and maintainable way to compile and setup ocaml and required libraries on Windows.

One more question: on Windows there is (or was) a circular dependency between flexdll and Ocaml. One of the two needs to be installed in binary form. Did you also run into this issue? If so, how did you solve it?

Btw: I also experimented with MSys, MSys2 instead of cygwin, but found that cross compiling mayn packages for for MinGW under cygwin is easier than under MSys, MSys2.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:26 ` Soegtrop, Michael
@ 2016-03-15  8:36   ` whitequark
  2016-03-15  8:53     ` Soegtrop, Michael
  2016-03-15  9:18     ` Adrien Nader
  2016-03-15  9:12   ` David Allsopp
  1 sibling, 2 replies; 21+ messages in thread
From: whitequark @ 2016-03-15  8:36 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

On 2016-03-15 11:26, Soegtrop, Michael wrote:
> Dear Whitequark,
> 
>> I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain in the 
>> spirit
>> of opam-cross-android[2] (ex opam-android).
> 
> Do you think there are good chances that this also works for cross
> compiling for MinGW on cygwin.
> Or asked in another way: are there known reasons why this shouldn't 
> work?

opam-cross-windows builds OCaml to run on top of bare Win32 i.e. it uses
win32unix and otherwise embeds such assumptions in the compiler 
configuration.
Since Cygwin is striving to present a Unix-like environment, those
assumptions would not hold. So I don't think opam-cross-windows will
work on Cygwin, sorry.

> I made some scripts to compile things like GTK, pango, cairo, ocaml,
> menhir, Coq, CoqIDE, ... for MinGW on cygwin and also to setup cygwin
> with the required packages automatically in a reproducible way. A
> MinGW cross Opam for cygwin would be the logical next step. Together
> with my scripts this might be a reproducible and maintainable way to
> compile and setup ocaml and required libraries on Windows.

Perhaps. I find Cygwin annoying to deal with so I don't care for it 
much.
Feel free to fork opam-cross-windows and reuse my technique to solve
your problem. It can be adapted with minimal changes to almost any
set of host and target systems, given that the OCaml buildsystem
supports it.

> One more question: on Windows there is (or was) a circular dependency
> between flexdll and Ocaml. One of the two needs to be installed in
> binary form. Did you also run into this issue? If so, how did you
> solve it?

Inherent deficiencies in the current OCaml buildsystem mean that
any cross-compiler build requires an OCaml compiler targeting the build
system, with exactly matching version and bitness. Similarly, since
opam-cross-windows does not provide a compiler switch, an OCaml compiler
is inherently present (and it is required anyway to compile packages
which invoke build system components such as ppx, camlp4, cppo, etc).
So, the need to build flexdll does not present a problem.

> Btw: I also experimented with MSys, MSys2 instead of cygwin, but found
> that cross compiling mayn packages for for MinGW under cygwin is
> easier than under MSys, MSys2.

Note that opam-cross-windows uses a toolchain that targets plain Win32
API without using any kind of POSIX emulation such as MSYS or Cygwin.

> 
> Best regards,
> 
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-14 20:26     ` Martin DeMello
  2016-03-14 20:39       ` Adrien Nader
@ 2016-03-15  8:37       ` whitequark
  1 sibling, 0 replies; 21+ messages in thread
From: whitequark @ 2016-03-15  8:37 UTC (permalink / raw)
  To: Martin DeMello; +Cc: Adrien Nader, caml-list

On 2016-03-14 23:26, Martin DeMello wrote:
> Oh, it's just a matter of installing packages one by one until things
> compile :) More tedious than anything else; I just didn't want to go
> through the process if someone had already. e.g. this is how I started
> off
> 
> $ wajig install mingw-w64-x86-64-dev
> $ wajig install mingw-w64-i686-dev

I politely quote the opam-cross-windows README:

> A C cross-compiler targeting the appropriate Windows platform must
> be installed. On Debian derivatives they are provided in
> the gcc-mingw-w64-i686 (for 32-bit x86 Windows targets) or
> gcc-mingw-w64-x86_64 (for 64-bit x86 Windows targets) packages.

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:36   ` whitequark
@ 2016-03-15  8:53     ` Soegtrop, Michael
  2016-03-15  8:56       ` whitequark
  2016-03-16 14:27       ` Andreas Hauptmann
  2016-03-15  9:18     ` Adrien Nader
  1 sibling, 2 replies; 21+ messages in thread
From: Soegtrop, Michael @ 2016-03-15  8:53 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

Dear Whitequark,

> Since Cygwin is striving to present a Unix-like environment, those
> assumptions would not hold. So I don't think opam-cross-windows will work
> on Cygwin, sorry.

> Note that opam-cross-windows uses a toolchain that targets plain Win32 API
> without using any kind of POSIX emulation such as MSYS or Cygwin.

I talked about cross compiling for MinGW under cygwin. This should be fairly similar to cross compiling for MinGW under Unix. The Ocaml compiler created by my scripts runs on plain windows (without cygwin installed) and also creates executables for such systems. I use cygwin just as a build environment.

Ideally I would like to have an opam running on plain windows, but I think an Opam running on cygwin but creating plain windows tools might be a good compromise between usability and maintainability. 
 
Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:53     ` Soegtrop, Michael
@ 2016-03-15  8:56       ` whitequark
  2016-03-15 11:29         ` Soegtrop, Michael
  2016-03-16 14:27       ` Andreas Hauptmann
  1 sibling, 1 reply; 21+ messages in thread
From: whitequark @ 2016-03-15  8:56 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

On 2016-03-15 11:53, Soegtrop, Michael wrote:
> Dear Whitequark,
> 
>> Since Cygwin is striving to present a Unix-like environment, those
>> assumptions would not hold. So I don't think opam-cross-windows will 
>> work
>> on Cygwin, sorry.
> 
>> Note that opam-cross-windows uses a toolchain that targets plain Win32 
>> API
>> without using any kind of POSIX emulation such as MSYS or Cygwin.
> 
> I talked about cross compiling for MinGW under cygwin. This should be
> fairly similar to cross compiling for MinGW under Unix. The Ocaml
> compiler created by my scripts runs on plain windows (without cygwin
> installed) and also creates executables for such systems. I use cygwin
> just as a build environment.
> 
> Ideally I would like to have an opam running on plain windows, but I
> think an Opam running on cygwin but creating plain windows tools might
> be a good compromise between usability and maintainability.

Ah. Yeah, that should just work. I don't see any reason why it wouldn't.

> 
> Best regards,
> 
> Michael
> Intel Deutschland GmbH
> Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
> Tel: +49 89 99 8853-0, www.intel.de
> Managing Directors: Christin Eisenschmid, Christian Lamprechter
> Chairperson of the Supervisory Board: Nicole Lau
> Registered Office: Munich
> Commercial Register: Amtsgericht Muenchen HRB 186928

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:26 ` Soegtrop, Michael
  2016-03-15  8:36   ` whitequark
@ 2016-03-15  9:12   ` David Allsopp
  1 sibling, 0 replies; 21+ messages in thread
From: David Allsopp @ 2016-03-15  9:12 UTC (permalink / raw)
  To: Soegtrop, Michael, whitequark, caml-list

Soegtrop, Michael wrote:
> One more question: on Windows there is (or was) a circular dependency
> between flexdll and Ocaml. One of the two needs to be installed in binary
> form. Did you also run into this issue? If so, how did you solve it?

I haven't yet updated the build documentation (because it needs a wholesale rewrite), but in trunk (and 4.03), the circular dependency is gone.

  1. Ensure FlexDLL sources are in flexdll/ in the OCaml build tree
	1a. If you're building from a git clone, issue git submodule update --init
	1b. If you're building from a sources tarball, issue git clone https://github.com/alainfrisch/flexdll.git 
  2. Follow usual configuration steps in config/
  3. make -f Makefile.nt flexdll world opt opt.opt install

flexlink.exe (and the .manifest files for the MSVC ports) are installed to bin. flexlink.exe will be a bytecode executable unless opt.opt is compiled. The correct .o/.obj files are installed to lib. Note that FlexDLL 0.35 or later is required, so you can't yet use a FlexDLL sources tarball.

Note that this procedure is not (yet) available for building the FlexDLL for Cygwin (because that uses the configure, rather than Makefile.nt route, and at this stage I didn't have the time to put the changes in both places...)


David

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:36   ` whitequark
  2016-03-15  8:53     ` Soegtrop, Michael
@ 2016-03-15  9:18     ` Adrien Nader
  1 sibling, 0 replies; 21+ messages in thread
From: Adrien Nader @ 2016-03-15  9:18 UTC (permalink / raw)
  To: whitequark; +Cc: Soegtrop, Michael, caml-list

On Tue, Mar 15, 2016, whitequark wrote:
> On 2016-03-15 11:26, Soegtrop, Michael wrote:
> >Dear Whitequark,
> >
> >>I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain in
> >>the spirit
> >>of opam-cross-android[2] (ex opam-android).
> >
> >Do you think there are good chances that this also works for cross
> >compiling for MinGW on cygwin.
> >Or asked in another way: are there known reasons why this
> >shouldn't work?
> 
> opam-cross-windows builds OCaml to run on top of bare Win32 i.e. it uses
> win32unix and otherwise embeds such assumptions in the compiler
> configuration.
> Since Cygwin is striving to present a Unix-like environment, those
> assumptions would not hold. So I don't think opam-cross-windows will
> work on Cygwin, sorry.

My understanding of the question was to build the cross-compiler from
Cygwin rather than from Linux. As far as I'm concerned, I see no reason
for this not to work besides small implementation.

> >I made some scripts to compile things like GTK, pango, cairo, ocaml,
> >menhir, Coq, CoqIDE, ... for MinGW on cygwin and also to setup cygwin
> >with the required packages automatically in a reproducible way. A
> >MinGW cross Opam for cygwin would be the logical next step. Together
> >with my scripts this might be a reproducible and maintainable way to
> >compile and setup ocaml and required libraries on Windows.
> 
> Perhaps. I find Cygwin annoying to deal with so I don't care for it
> much.
> Feel free to fork opam-cross-windows and reuse my technique to solve
> your problem. It can be adapted with minimal changes to almost any
> set of host and target systems, given that the OCaml buildsystem
> supports it.

At that point I should point out win-builds.org which has the C packages
buildable in a portable and reproducible manner. Not the OCaml ones
because I hadn't been confident enough in its cross-compiler until now
(seeing toplevel expressions not being evaluated sometimes has been a
really cold shower). Unfotunately I need to finish a set of large
changes before I can push a large update to win-builds that simplifies
setup a lot.

> >One more question: on Windows there is (or was) a circular dependency
> >between flexdll and Ocaml. One of the two needs to be installed in
> >binary form. Did you also run into this issue? If so, how did you
> >solve it?
> 
> Inherent deficiencies in the current OCaml buildsystem mean that
> any cross-compiler build requires an OCaml compiler targeting the build
> system, with exactly matching version and bitness. Similarly, since
> opam-cross-windows does not provide a compiler switch, an OCaml compiler
> is inherently present (and it is required anyway to compile packages
> which invoke build system components such as ppx, camlp4, cppo, etc).
> So, the need to build flexdll does not present a problem.

I saw mentions of flexdll being embedded in the compiler sources now too
so that it is possible to break that loop. Haven't had time to try it
though. In any case, as whitequark points out, there is no such loop for
cross-compilers.

> >Btw: I also experimented with MSys, MSys2 instead of cygwin, but found
> >that cross compiling mayn packages for for MinGW under cygwin is
> >easier than under MSys, MSys2.
> 
> Note that opam-cross-windows uses a toolchain that targets plain Win32
> API without using any kind of POSIX emulation such as MSYS or Cygwin.

It is important to note that Msys was never meant for people to compile
and link against but only as a posix environment to run applications in.

MSYS2 updates it against a much more recent cygwin and builds many many
more things against it. However noone wants their application to link
against any msys*.

The difference between cygwin and msys is that with cygwin you do
cross-compile while with msys* you light a candle, pray to $deity and
hope that whatever you're building will not notice it is building in a
posix-ish environment that automatically translates paths that go to and
come from win32 applications depending on a set of heuristics.

It is possible to do cross-compilation under msys* too but I've found it
to be less reliable, especially with msys2 because it does weird things
and changes every other day. In particular, issues when building an
ocaml cross-compiler seemed impossible to understand.

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:56       ` whitequark
@ 2016-03-15 11:29         ` Soegtrop, Michael
  0 siblings, 0 replies; 21+ messages in thread
From: Soegtrop, Michael @ 2016-03-15 11:29 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

Dear Whitequark,

> Ah. Yeah, that should just work. I don't see any reason why it wouldn't.

perfect, I will give it a try. It might take a few weeks, since I am busy with other things right now.

Best regards,

Michael

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-15  8:53     ` Soegtrop, Michael
  2016-03-15  8:56       ` whitequark
@ 2016-03-16 14:27       ` Andreas Hauptmann
  1 sibling, 0 replies; 21+ messages in thread
From: Andreas Hauptmann @ 2016-03-16 14:27 UTC (permalink / raw)
  To: caml-list

"Soegtrop, Michael" <michael.soegtrop@intel.com> writes:

> Ideally I would like to have an opam running on plain windows,

I (sometimes) maintain a windows repository for opam and an opam build
at: https://github.com/fdopen/opam-repository-mingw/

To a certain extent, it is "plain windows": neither opam nor OCaml are
linked against cygwin. However, cygwin is still necessary for nearly
everything else: git, rsync, a shell to run configure scripts, make, ...


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-03-13  9:02 [Caml-list] [ANN] opam-cross-windows whitequark
  2016-03-14 19:55 ` Martin DeMello
  2016-03-15  8:26 ` Soegtrop, Michael
@ 2016-05-20 18:38 ` Boutillier, Pierre
  2016-05-20 18:45   ` whitequark
  2016-05-23  9:53   ` Mauricio Fernández
  2 siblings, 2 replies; 21+ messages in thread
From: Boutillier, Pierre @ 2016-05-20 18:38 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

Hi list,

Sorry to:
- reactivate an old thread
- maybe going into human-relation issue (hopefully not)

On github live:
https://github.com/whitequark/opam-cross-windows
and
https://github.com/vouillon/opam-windows-repository

Both are active (9 days old commit vs 10 days old commit). One has yojson, the other (a bit old) lwt. I sit in the middle.
Could you give me insight of technical design choice differences (i don't see) in order to allow me to decide in which direction I should put my energy toward helping a "merge"?

All the best,
Pierre B.


> Le 13 mars 2016 à 05:02, whitequark <whitequark@whitequark.org> a écrit :
> 
> Hi all,
> 
> I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain
> in the spirit of opam-cross-android[2] (ex opam-android).
> It provides easy cross-compilation of the OCaml compiler
> and select packages from any *nix environment to 32-bit
> and 64-bit x86 Windows.
> 
> There aren't many packages yet but you're encouraged to submit
> your own. Personally, I find the porting process that uses
> the opam-cross-* conventions so simple and robust that it
> can be done nearly mindlessly.
> 
> The cross-compiled package definitions themselves are
> identical to the ones from opam-cross-android (except for
> s/android/windows) so I think cross-compilation should gain
> at least minimal OPAM support; I've described my proposal
> at [3].
> 
> [1]: https://github.com/whitequark/opam-cross-windows
> [2]: https://github.com/whitequark/opam-cross-android
> [3]: https://github.com/ocaml/opam/issues/2476
> 
> -- 
> whitequark
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-05-20 18:38 ` Boutillier, Pierre
@ 2016-05-20 18:45   ` whitequark
  2016-05-23  8:24     ` Soegtrop, Michael
  2016-05-23  9:53   ` Mauricio Fernández
  1 sibling, 1 reply; 21+ messages in thread
From: whitequark @ 2016-05-20 18:45 UTC (permalink / raw)
  To: Boutillier, Pierre; +Cc: caml-list

On 2016-05-20 18:38, Boutillier, Pierre wrote:
> Hi list,
> 
> Sorry to:
> - reactivate an old thread
> - maybe going into human-relation issue (hopefully not)
> 
> On github live:
> https://github.com/whitequark/opam-cross-windows
> and
> https://github.com/vouillon/opam-windows-repository
> 
> Both are active (9 days old commit vs 10 days old commit). One has
> yojson, the other (a bit old) lwt. I sit in the middle.
> Could you give me insight of technical design choice differences (i
> don't see) in order to allow me to decide in which direction I should
> put my energy toward helping a "merge"?

My repository uses MXE so that a wide range of native dependencies can
be easily compiled. Moreover, you get opam-cross-android and 
opam-cross-ios
for free, with exact same conventions, largely similar package sets, 
etc,
and it is easy to port packages between the three as well.

Also, Jerome has expressed a desire to merge the opam-cross-* 
repositories
but that didn't go anywhere so far.

> 
> All the best,
> Pierre B.
> 
> 
>> Le 13 mars 2016 à 05:02, whitequark <whitequark@whitequark.org> a 
>> écrit :
>> 
>> Hi all,
>> 
>> I've released opam-cross-windows[1], a 4.02.3 OCaml toolchain
>> in the spirit of opam-cross-android[2] (ex opam-android).
>> It provides easy cross-compilation of the OCaml compiler
>> and select packages from any *nix environment to 32-bit
>> and 64-bit x86 Windows.
>> 
>> There aren't many packages yet but you're encouraged to submit
>> your own. Personally, I find the porting process that uses
>> the opam-cross-* conventions so simple and robust that it
>> can be done nearly mindlessly.
>> 
>> The cross-compiled package definitions themselves are
>> identical to the ones from opam-cross-android (except for
>> s/android/windows) so I think cross-compilation should gain
>> at least minimal OPAM support; I've described my proposal
>> at [3].
>> 
>> [1]: https://github.com/whitequark/opam-cross-windows
>> [2]: https://github.com/whitequark/opam-cross-android
>> [3]: https://github.com/ocaml/opam/issues/2476
>> 
>> --
>> whitequark
>> 
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-05-20 18:45   ` whitequark
@ 2016-05-23  8:24     ` Soegtrop, Michael
  2016-05-24  6:57       ` whitequark
  0 siblings, 1 reply; 21+ messages in thread
From: Soegtrop, Michael @ 2016-05-23  8:24 UTC (permalink / raw)
  To: whitequark; +Cc: caml-list

Dear whitequark,

> My repository uses MXE so that a wide range of native dependencies can be
> easily compiled. Moreover, you get opam-cross-android and opam-cross-ios
> for free, with exact same conventions, largely similar package sets, etc, and
> it is easy to port packages between the three as well.

Thanks for the pointer to MXE (http://mxe.cc/). A very interesting project! It might help to put MinGW cross opam for cygwin on a solid foundation.

One question: how happy are you with the make file approach of MXE? I worked an something similar as MXE, but based on shell scripts, since I thought "meta makefiles" might be hard to maintain and to debug and shell scripts might be more appropriate for this task. But it was a difficult decision and I still see some advantages in using make for this.

Best regards,

Michael
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-05-20 18:38 ` Boutillier, Pierre
  2016-05-20 18:45   ` whitequark
@ 2016-05-23  9:53   ` Mauricio Fernández
  1 sibling, 0 replies; 21+ messages in thread
From: Mauricio Fernández @ 2016-05-23  9:53 UTC (permalink / raw)
  To: caml-list

On Fri, May 20, 2016 at 06:38:03PM +0000, Boutillier, Pierre wrote:
> Sorry to:
> - reactivate an old thread
> - maybe going into human-relation issue (hopefully not)
> 
> On github live:
> https://github.com/whitequark/opam-cross-windows
> and
> https://github.com/vouillon/opam-windows-repository
> 
> Both are active (9 days old commit vs 10 days old commit). One has yojson, the other (a bit old) lwt. I sit in the middle.

FYI I have packaged several libs for opam-cross-windows and will soon submit
them for inclusion in the main repos, see

    https://github.com/mfp/opam-cross-windows-repos/tree/master/packages

-- 
Mauricio Fernández

^ permalink raw reply	[flat|nested] 21+ messages in thread

* RE: [Caml-list] [ANN] opam-cross-windows
  2016-05-23  8:24     ` Soegtrop, Michael
@ 2016-05-24  6:57       ` whitequark
  2016-05-24 12:35         ` Adrien Nader
  0 siblings, 1 reply; 21+ messages in thread
From: whitequark @ 2016-05-24  6:57 UTC (permalink / raw)
  To: Soegtrop, Michael; +Cc: caml-list

On 2016-05-23 08:24, Soegtrop, Michael wrote:
> Dear whitequark,
> 
>> My repository uses MXE so that a wide range of native dependencies can 
>> be
>> easily compiled. Moreover, you get opam-cross-android and 
>> opam-cross-ios
>> for free, with exact same conventions, largely similar package sets, 
>> etc, and
>> it is easy to port packages between the three as well.
> 
> Thanks for the pointer to MXE (http://mxe.cc/). A very interesting
> project! It might help to put MinGW cross opam for cygwin on a solid
> foundation.
> 
> One question: how happy are you with the make file approach of MXE? I
> worked an something similar as MXE, but based on shell scripts, since
> I thought "meta makefiles" might be hard to maintain and to debug and
> shell scripts might be more appropriate for this task. But it was a
> difficult decision and I still see some advantages in using make for
> this.

I have absolutely none in-depth understanding of how MXE functions, but 
I
can say that I never needed one, or wanted it, so I'd say it is a 
success :)
Of course, this is only valid from the perspective of a user.

-- 
whitequark

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Caml-list] [ANN] opam-cross-windows
  2016-05-24  6:57       ` whitequark
@ 2016-05-24 12:35         ` Adrien Nader
  0 siblings, 0 replies; 21+ messages in thread
From: Adrien Nader @ 2016-05-24 12:35 UTC (permalink / raw)
  To: whitequark; +Cc: Soegtrop, Michael, caml-list

On Tue, May 24, 2016, whitequark wrote:
> On 2016-05-23 08:24, Soegtrop, Michael wrote:
> >Dear whitequark,
> >
> >>My repository uses MXE so that a wide range of native
> >>dependencies can be
> >>easily compiled. Moreover, you get opam-cross-android and
> >>opam-cross-ios
> >>for free, with exact same conventions, largely similar package
> >>sets, etc, and
> >>it is easy to port packages between the three as well.
> >
> >Thanks for the pointer to MXE (http://mxe.cc/). A very interesting
> >project! It might help to put MinGW cross opam for cygwin on a solid
> >foundation.
> >
> >One question: how happy are you with the make file approach of MXE? I
> >worked an something similar as MXE, but based on shell scripts, since
> >I thought "meta makefiles" might be hard to maintain and to debug and
> >shell scripts might be more appropriate for this task. But it was a
> >difficult decision and I still see some advantages in using make for
> >this.
> 
> I have absolutely none in-depth understanding of how MXE functions,
> but I
> can say that I never needed one, or wanted it, so I'd say it is a
> success :)
> Of course, this is only valid from the perspective of a user.

I make win-builds.org and there's a really large update coming amost any
time soon. Currently it has C and C++ things.

The goal is to make a distribution roughly in the Linux sense and it's
very "standard". MXE on the other hand only does static linking.
Different goals and approaches.

-- 
Adrien Nader

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-05-24 12:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-13  9:02 [Caml-list] [ANN] opam-cross-windows whitequark
2016-03-14 19:55 ` Martin DeMello
2016-03-14 20:14   ` Adrien Nader
2016-03-14 20:26     ` Martin DeMello
2016-03-14 20:39       ` Adrien Nader
2016-03-14 21:10         ` Martin DeMello
2016-03-15  8:37       ` whitequark
2016-03-15  8:26 ` Soegtrop, Michael
2016-03-15  8:36   ` whitequark
2016-03-15  8:53     ` Soegtrop, Michael
2016-03-15  8:56       ` whitequark
2016-03-15 11:29         ` Soegtrop, Michael
2016-03-16 14:27       ` Andreas Hauptmann
2016-03-15  9:18     ` Adrien Nader
2016-03-15  9:12   ` David Allsopp
2016-05-20 18:38 ` Boutillier, Pierre
2016-05-20 18:45   ` whitequark
2016-05-23  8:24     ` Soegtrop, Michael
2016-05-24  6:57       ` whitequark
2016-05-24 12:35         ` Adrien Nader
2016-05-23  9:53   ` Mauricio Fernández

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).