caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Adrien Nader <adrien@notk.org>
To: Yotam Barnoy <yotambarnoy@gmail.com>
Cc: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] One build system to rule them all?
Date: Wed, 10 Sep 2014 22:13:48 +0200	[thread overview]
Message-ID: <20140910201348.GA10443@notk.org> (raw)
In-Reply-To: <CAN6ygOndvw0McYKsB20LtFAdZED-CnzEEZ9qc7PJAXRPBdDWAQ@mail.gmail.com>

On Wed, Sep 10, 2014, Yotam Barnoy wrote:
> Here's part of my motivation for starting this discussion now: I recently
> experienced a hard-drive failure and had to switch to my backup windows
> laptop. I was dismayed that opam is still not available for Windows, and
> while wodi is available, it's not nearly as well developed, and apparently
> requires many hacks for different packages.
> 
> It seems to me that these hacks are some of the things that make platform
> compatibility hard for opam. Each build system has different requirements
> and methods of compilation, and making this approach cross-platform
> compatible is difficult. Ideally, a build system will abstract away the
> things that are not inter-platform compatible. This is why I don't like
> people using makefiles. Makefiles are not available natively on Windows,
> and they often contain other bits of shell code that isn't available on all
> POSIX platforms, let alone on Windows. Not to mention the fact that
> makefiles have a very tricky and sensitive syntax.

You're taking the wrong approach IMHO. The issue is not with the build
systems (usually) but with the build environements and how you're using
them.

On Windows you have three choices to build from. Chose one. Stick to it.
Don't mix.

1- Cygwin or MSYS/MSYS2 (MSYS is a fork of Cygwin; MSYS2 is a fork of
newer Cygwin).
They are POSIXish (Cygwin) or POSIX-like-but-actually-doing-dirtytricks
(MSYS*). They can run both regular Windows apps and specific cygwin/msys
apps too.
Consider that when from Cygwin, you will be doing a special
cases of cross-compilation which allows you to run what you've built
(but you will probably have to post-process the output of what you run
if it contains paths).
On MSYS*, you'll try to mix both that not-really-posix universe with
windows and it should work most of the time. If you look deeper at how
it's mixing things, you will probably feel like never using it ever
again.

2- Visual Studio.
First you need to click on the "I accept this EULA" tickbox to sell your
soul to Microsoft.
Then you will discover a world of ad-hoc solutions, collection of blobs
and random binaries, build cargo cult and "I'm keeping this installation
since it builds what I need and it's too risky to change it; I know it's
running Windows 98 and Visual Studio 6 but it works!".
This beast is also the reason CMake is engineered the fail at finding
dependencies except when you give it their full path along with every
possible bit of information it might need during build since it won't
find anything (handy, hey?).
[ that's really the design idea behind cmake's configuration
"discovery": you list paths and libs and it tries them until it finds
something which passes the insufficient match tests given; you're
supposed to avoid pkg-config or at least make it a secondary citizen,
which means it's broken and every lib detection script has to reinvent
pkg-config usage in a broken way using the horrible cmake macro language
]

3- Other IDEs.
Some tend to use a make. A native one which spawns cmd.exe. I guess they
write Makefiles which contain very simple commands. It seems they work
fine. Makefiles are generated from some IDE-specific code. They share
some of the bad things MSVC but at least they're not building using a
dump of blobs and they don't change their project description
fileformats with each version.

Pick your broken system. Send love letters to Microsoft.

As far as I'm concerned, I'm cross-compiling from Linux. Or sometimes
from Cygwin. And when I really need to, from MSYS. In other words, I
solve the issue by avoiding Windows as much as possible, even when on
Windows.

Pick one. Understand it. Don't cross the streams. Eat five vegetables
and fruits per day. Alcohol and other drugs are not the answer (violence
is).

-- 
Adrien Nader

  parent reply	other threads:[~2014-09-10 20:13 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10 12:49 Yotam Barnoy
2014-09-10 13:00 ` Simon Cruanes
2014-09-10 13:02 ` Adrien Nader
2014-09-10 13:05 ` David Sheets
2014-09-10 14:04   ` Thomas Braibant
2014-09-10 14:13     ` Adrien Nader
2014-09-10 13:18 ` Mark Shinwell
2014-09-10 13:29 ` Francois Berenger
2014-09-10 13:53   ` Jacques-Pascal Deplaix
2014-09-10 13:55     ` Francois Berenger
2014-09-10 14:17   ` Maxence Guesdon
2014-09-10 19:13     ` Drup
2014-09-10 22:56       ` Gerd Stolpmann
2014-09-13 12:01       ` rixed
2014-09-13 12:21         ` Drup
2014-09-13 12:37           ` rixed
2014-09-13 12:50             ` Adrien Nader
2014-09-13 13:05             ` Drup
2014-09-19 11:15       ` Matej Kosik
2014-09-10 14:23   ` Gerd Stolpmann
2014-09-10 15:17     ` Leonardo Laguna Ruiz
2014-09-10 18:59       ` Yotam Barnoy
2014-09-10 19:16         ` Peter Zotov
2014-09-10 19:56           ` Sebastien Mondet
2014-09-10 20:15             ` Gabriel Scherer
2014-09-10 23:20             ` Gerd Stolpmann
2014-09-10 20:13         ` Adrien Nader [this message]
2014-09-11  7:53         ` Francois Berenger
2014-09-11 10:37           ` Yaron Minsky
2014-09-12 14:08             ` Yotam Barnoy
2014-09-12 14:31               ` Francois Berenger
2014-09-12 14:36               ` Anil Madhavapeddy
2014-09-12 18:49                 ` Yaron Minsky
2014-09-12 15:10               ` SF Markus Elfring
2014-09-12 15:34               ` Adrien Nader
2014-09-12 18:50               ` Fabrice Le Fessant
2014-09-14 18:46               ` Richard W.M. Jones
2014-09-13 12:22         ` rixed
2014-09-15 13:34         ` Stéphane Glondu
2014-09-18 21:15           ` Yotam Barnoy
2014-09-18 21:21             ` Anil Madhavapeddy
2014-09-18 21:36               ` Yaron Minsky
2014-09-19 12:31                 ` Daniel Bünzli
2014-09-19 13:06                   ` Anil Madhavapeddy
2014-09-18 21:23             ` Yaron Minsky
2014-09-19  7:27               ` Gabriel Scherer
2014-09-19 15:03                 ` Yaron Minsky
2014-09-12 16:54 ` [Caml-list] Re : " r.3
2014-09-14 18:16 ` [Caml-list] " Richard W.M. Jones
2014-09-19  9:14 ` r.3

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140910201348.GA10443@notk.org \
    --to=adrien@notk.org \
    --cc=caml-list@inria.fr \
    --cc=yotambarnoy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).