From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 2B7FABBCA for ; Thu, 3 Apr 2008 04:43:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArgBAIvh80fAFOFwomdsb2JhbACCQTGCGYxFAQEBAQEBBwUHCRaaIw X-IronPort-AV: E=Sophos;i="4.25,596,1199660400"; d="scan'208,217";a="24529634" Received: from mail-dark.research.att.com (HELO mail-yellow.research.att.com) ([192.20.225.112]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Apr 2008 04:43:10 +0200 Received: from [192.168.0.100] (vpn-22.research.att.com [135.207.240.22]) by bigmail.research.att.com (8.13.7+Sun/8.11.6) with ESMTP id m332h8x9028509; Wed, 2 Apr 2008 22:43:09 -0400 (EDT) In-Reply-To: <20080403023058.GA22150@stratocaster.home> References: <42D3D95E-3C90-4C9E-BB4B-34F8107DE4F6@research.att.com> <20080403015251.GA20849@stratocaster.home> <46F1D786-911B-4177-8D51-82D86F4E6D45@research.att.com> <20080403023058.GA22150@stratocaster.home> Mime-Version: 1.0 (Apple Message framework v753) Content-Type: multipart/alternative; boundary=Apple-Mail-85--897362955 Message-Id: <2E48665C-67B4-4182-BC23-EBA1A6DF9BF6@research.att.com> Cc: caml-list@yquem.inria.fr From: Yitzhak Mandelbaum Subject: Re: [Caml-list] Ocamlnet and EINPROGRESS Date: Wed, 2 Apr 2008 22:43:07 -0400 To: Eric Cooper X-Mailer: Apple Mail (2.753) X-Spam: no; 0.00; yitzhak:01 mandelbaum:01 yitzhak:01 ocamlnet:01 arises:01 makefile:01 arbitrarily:01 makefile:01 ocamlfind:01 ocamlc:01 -package:01 -linkpkg:01 ocamlfind:01 ocamlc:01 -thread:01 --Apple-Mail-85--897362955 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Its a little more complicated than that. The problem arises when linking with 1) a library that links with Unix and 2) a file that depends on Unix. I've found a minimal example that fails on my system (OS X). It involves 4 files: Makefile, mintime.ml, unixprog.ml, minprog.ml (names chosen arbitrarily): ######################## Makefile: ######################## all: minprog timelib.cma: mintime.ml ocamlfind ocamlc -package unix -linkpkg \ -o $@ -a mintime.ml minprog: timelib.cma unixprog.ml ocamlfind ocamlc $(INCLUDES) -thread -o $@ \ -package netclient -linkpkg $^ minprog.ml ######################## mintime.ml: ####################### let now () = Unix.time () ######################## unixprog.ml: ####################### let foo x = let in_channel, out_channel = Unix.open_process "cat" in let read_fd = Unix.descr_of_in_channel in_channel in let write_fd = Unix.descr_of_out_channel out_channel in () ######################## minprog.ml: ####################### let mystring = Http_client.Convenience.http_get "http://www.cnn.com" Then, make minprog ./minprog results in Fatal error: exception Unix.Unix_error(38, "connect", "") Yitzhak On Apr 2, 2008, at 10:30 PM, Eric Cooper wrote: > On Wed, Apr 02, 2008 at 10:08:55PM -0400, Yitzhak Mandelbaum wrote: >> Sure, here's one: >> >> let mystring = Http_client.Convenience.http_get "http:// >> www.cnn.com" >> >> But, whether or not it raises the exception depends what I link it >> with, which is the essential problem. > > On my (Debian) system, I can't build that program without linking in > the Unix module, since it's referenced by almost all of the ocamlnet > modules. So I don't understand the problem you're seeing. > > -- > Eric Cooper e c c @ c m u . e d u > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -------------------------------------------------- Yitzhak Mandelbaum AT&T Labs - Research http://www.research.att.com/~yitzhak --Apple-Mail-85--897362955 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 Its a little more complicated than that. The problem arises when linking = with 1) a library that links with Unix and 2) a file that depends on = Unix. I've found a minimal example that fails on my system (OS X). It = involves 4 files: Makefile, mintime.ml, unixprog.ml, minprog.ml (names = chosen = arbitrarily):

########################
Makefi= le:
########################

all: = minprog

timelib.cma: = mintime.ml ocamlfind ocamlc -package unix = -linkpkg \ -o $@ -a = mintime.ml
minprog: timelib.cma = =A0unixprog.ml=A0 ocamlfind ocamlc $(INCLUDES) = -thread -o $@ \ -package netclient -linkpkg $^ = minprog.ml


######################= ##
mintime.ml:
#######################
let now () =3D Unix.time = ()

########################
unix= prog.ml:#######################

le= t foo x =3D=A0=A0let in_channel, out_channel =3D = Unix.open_process "cat" in=A0=A0let read_fd =3D = Unix.descr_of_in_channel in_channel in=A0=A0let write_fd =3D = Unix.descr_of_out_channel out_channel = in=A0=A0()

########################=
minprog.ml:
#######################

let mystring =3D Http_client.Convenience.http_get "http://www.cnn.com"

<= /div>

Then,=A0

make = minprog
./minprog

results = in

Fatal error: exception = Unix.Unix_error(38, "connect", = "")

Yitzhak

On Apr 2, 2008, at 10:30 PM, Eric Cooper wrote:
On Wed, Apr 02, 2008 at 10:08:55PM -0400, Yitzhak = Mandelbaum wrote:
=A0=A0 = Sure, here's one:

=A0=A0 let mystring =3D = Http_client.Convenience.http_get "http://www.cnn.com"

=A0=A0 But, whether or not it = raises the exception depends what I link it
=A0=A0 with, which is the = essential problem.

On my (Debian) system, I can't = build that program without linking in
the Unix = module, since it's referenced by almost all of the ocamlnet
modules. =A0 = So I don't understand the problem you're seeing.

--=A0
Eric = Cooper =A0 =A0 =A0 =A0 =A0 =A0 = e c c @ c m u . e d u

Caml-list mailing list. Subscription = management:


=

= --Apple-Mail-85--897362955--