From owner-freebsd-perl@FreeBSD.ORG Fri Jan 2 17:00:01 2009 Return-Path: Delivered-To: freebsd-perl@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 862E4106564A for ; Fri, 2 Jan 2009 17:00:01 +0000 (UTC) (envelope-from tobez@tobez.org) Received: from heechee.tobez.org (heechee.tobez.org [194.255.56.42]) by mx1.freebsd.org (Postfix) with ESMTP id 42AEF8FC17 for ; Fri, 2 Jan 2009 17:00:01 +0000 (UTC) (envelope-from tobez@tobez.org) Received: by heechee.tobez.org (Postfix, from userid 1001) id DB0DE6D400; Fri, 2 Jan 2009 17:44:39 +0100 (CET) Date: Fri, 2 Jan 2009 17:44:39 +0100 From: Anton Berezin To: Fernan Aguero Message-ID: <20090102164439.GF40649@heechee.tobez.org> References: <520894aa0901020758o79bb1233teee539f6d599d10a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <520894aa0901020758o79bb1233teee539f6d599d10a@mail.gmail.com> X-Powered-By: FreeBSD http://www.freebsd.org/ User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-perl@freebsd.org Subject: Re: Storable byteorder incompatibilities in different FreeBSD installations X-BeenThere: freebsd-perl@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: maintainer of a number of perl-related ports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2009 17:00:02 -0000 On Fri, Jan 02, 2009 at 01:58:06PM -0200, Fernan Aguero wrote: > I've been bitten by binary incompatibilitiess (bytorder, and/or byte > sizes of ints, longs, and whatnot) between two perl installations > (both on FreeBSD, using latest perl5.8 from ports). [...] > Binary incompatibilities when reading the Storable binary data have > been observed in the past when running the web application from Linux > boxes (Ubuntu, i386 or amd64). > So why is it that building Perl outside of the ports system makes the > test program report '1234' which is what I would expect from an i386 > box, while it gives '12345678' when running from within the ports > system? Why this unusual byteorder? This is because of PERL_64BITINT (aka -Duse64bitint) is the default with the port. > And now for a pragmatic and urgent question: > iv) how can I use the ports system to build a Perl in different FBSD > boxes that would result in the same binary configuration (byteorder, > shortsize, intsize, etc.) to guarantee it would produce compatible > (i.e. readable from other FBSD boxes) dumps of Perl data structures? Uncheck PERL_64BITINT in the configuration dialog. (make rmconfig first) Apart from that, do you actually use "nstore" variants of Storable functions? If you use it consistently in you application, you might find out that the problem disappears, and it would not matter what platform you use. Cheers, \Anton. -- There is no beauty in entropy. -- Eliezer Yudkowsky