OpenBSD Journal

Marc Espie on portability

Contributed by weerd on from the all-the-world dept.

A short while ago, Marc Espie (espie@) wrote to the ports mailinglist with a short rant about autoconf. His mail gives good insights into the problems porters face when dealing with GNU software, especially those using autoconf.

Please read on for Marc's post:

Date: Mon, 8 Mar 2010 15:06:09 +0100
From: Marc Espie
To: ports@openbsd.org
Subject: autoconf and portable programs: the joke

At some point in the past, autoconf was *meant* to simplify porting programs.
These days, it's more a "use gnu-linux, or die" (no wonder bsd is dying).

I'm really, really, fed up of all these EXCUSES for configure tests
(remember, a configure test is supposed to test for a *feature*) that
are solely

program --version

gnu string with required version => okay, we work.
anything else => okay, we refuse to work.

Between a "test" for mkdir -p being thread-safe, which ends up being
--version=coreutils, a "test" for tar supporting ustar archives, which ends
up being --version for gnu-tar, and numerous other examples, I'm really
becoming fed-up with that.

This is utter complacency from the part of the guys who write these tests.
They can ask *us* if they want to support other OSes, instead of silently
going over to GNU-make/GNU-bash/GNU-tar/GNU-m4/GNU-mkdir...

Since you read this mailing-list, I assume you have at least a remote interest
in BSD.

I have a simple request for you: each time you run into software that does
this idiotic kind of test, please interact with the idiots upstream for
whom all the world is linux, and try to get them to replace their "joke"
of an autoconf macro with actual genuine tests that actually CHECK FOR THE
FUCKING FEATURE.

If you hadn't read Marc's post on ports yet, now you read it here, on undeadly, which again shows at least a remote interest in BSD. Therefore, Marc's request still holds. There is more available than just Linux. Writing free, open and portable software means having your code run in environments you maybe didn't even knew existed. Be it Linux, BSD, HP-UX, Solaris, or any other UNIX-like operating system. The ecosystem is pretty large, try not to assume everybody has the full GNU userland, it's good for diversity.

(Comments are closed)


Comments
  1. By Nima Hoda (Nima) nimahoda@gmail.com on

    Somebody had to say it. Thanks Marc.

  2. By Berk S. Daemon (bsdaem0n) on

  3. By marcm (lectroidmarc) marcm@lectroid.net on http://www.lectroid.net

    The ecosystem is pretty large...

    Is it really? I mean really? Come on, HP-UX? Solaris? Ok, maaaaybe Solaris but how much OSS do people run on Solaris these days? When is the last time you've even seen an Irix box in the wild? I don't mean in your home rack or something earning you geek cred. Face it, except for the small percentage of *BSD out there, it really is a Linux-centric world.

    It's awful, I agree (I prefer a BSD), and it's sloppy to assume tests that simply test for GNU-whatever but sadly, it's also quite safe.

    Comments
    1. By Renaud Allard (renaud) on

      > The ecosystem is pretty large...
      >
      > Is it really? I mean really? Come on, HP-UX? Solaris? Ok, maaaaybe Solaris but how much OSS do people run on Solaris these days? When is the last time you've even seen an Irix box in the wild? I don't mean in your home rack or something earning you geek cred. Face it, except for the small percentage of *BSD out there, it really is a Linux-centric world.
      >

      I must admit HP-UX, TRU64 and Irix boxes are on the decline, but Solaris boxes (8->10) are still quite present nowadays and they will maybe raise in number now that Oracle acquired SUN. MacOSX boxes are coming very strong too with a great presence on the desktop and many OSS people are using them. AIX boxes are also very present on some business critical environments. And of course all the BSD boxes are also present in many hosting environments.
      And I can tell you, you often need a small piece of software based on autoconf which compiles fine on linux but takes hours to modify to compile on whatever other OS due to stupid version checks.

      Comments
      1. By Martin Schröder (oneiros) on http://www.oneiros.de

        Not forgetting Windows et.al. (cygwin, mingw, ...). "autoconf" should work there, too.

    2. By Nick Holland (NickHolland) on http://www.openbsd.org/faq/

      > The ecosystem is pretty large...
      >
      > Is it really? I mean really? Come on, HP-UX? Solaris? Ok, maaaaybe Solaris but how much OSS do people run on Solaris these days? When is the last time you've even seen an Irix box in the wild? I don't mean in your home rack or something earning you geek cred. Face it, except for the small percentage of *BSD out there, it really is a Linux-centric world.

      When's the last time you saw a Solaris box WITHOUT open source software on it?? I'd say the base system is barely usable without some add-in software, most of it open source.

      It is entertaining to look at how many Linux people will kick and moan about something that is Windows Only, and preach "portability". Very much like they will complain about non-free software, until it makes their video card or wireless adapter work for the moment.

      Pretty clear that to most,
      -- "portable" = "works on my system"
      -- "free" = "doesn't cost me money"
      the rest is just window dressing to make it look more noble and less selfish.

  4. By vesa norrman (vesbula) vesbula@hotmail.com on

    It's not possible to test thread safety reliably. For example, the test result could depend on number of processors in computer.

    About tar testing, what if the test needs to create a large tar archive? Overhead would be too much.

    Comments
    1. By Joachim Schipper (Joachim) on http://www.joachimschipper.nl/About me

      > It's not possible to test thread safety reliably. For example, the test result could depend on number of processors in computer.
      >
      > About tar testing, what if the test needs to create a large tar archive? Overhead would be too much.

      Yes, but this assumes the default state is broken. It would be much better to check for known-broken versions and assume it works otherwise. (Hey, it's not their fault if you have a broken tar...)

      Comments
      1. By Marc Espie (espie) on

        > > It's not possible to test thread safety reliably. For example, the test result could depend on number of processors in computer.
        > >
        > > About tar testing, what if the test needs to create a large tar archive? Overhead would be too much.
        >
        > Yes, but this assumes the default state is broken. It would be much better to check for known-broken versions and assume it works otherwise. (Hey, it's not their fault if you have a broken tar...)

        Those are all standard excuses. You might not realize that, but they are offensive to BSD people.

        How would *you* feel if I started to do things the other way around ? check for BSD-specific tools, and tell you to go fuck yourself if I don't find them, even if there are sane GNU equivalents (actually, wait, the likelyhood of a sane GNU equivalent is fairly low).

        Take that thread-safety issue: we actually *fixed* that specific bug a while back. How come the autoconf test can't check for OpenBSD > version and assume it works ?

        As far as tar goes, the test in question was just "can we create ustar archives ?" it's fairly trivial to check for real, again. Instead of just blindly assuming gnutar.

        One extra thing is that a lot of times, there is *no way* for the knowledgeable user to override those darn stupid tests... except by patching configure or configure.ac proper.

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]