From owner-freebsd-questions@FreeBSD.ORG Mon Mar 31 20:14:58 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99E72BC7 for ; Mon, 31 Mar 2014 20:14:58 +0000 (UTC) Received: from mailrelay008.isp.belgacom.be (mailrelay008.isp.belgacom.be [195.238.6.174]) by mx1.freebsd.org (Postfix) with ESMTP id 33908F8D for ; Mon, 31 Mar 2014 20:14:57 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmUGABzMOVNR8YpU/2dsb2JhbABZgwbEO4EgF3SCJQEBAQRWIxALDgoJJQ8qHgYTh30B0EMXjn8HhDgBA5BVh3iSNoMyOw Received: from 84.138-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.138.84]) by relay.skynet.be with ESMTP; 31 Mar 2014 22:13:34 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.8/8.14.8) with ESMTP id s2VKDVV8010952; Mon, 31 Mar 2014 22:13:31 +0200 (CEST) (envelope-from tijl@coosemans.org) Date: Mon, 31 Mar 2014 22:13:29 +0200 From: Tijl Coosemans To: Matthew Pherigo Subject: Re: lang/nimrod issue: missing forward slash Message-ID: <20140331221329.5e795449@kalimero.tijl.coosemans.org> In-Reply-To: <2C2F5FA3-D5F3-4223-A163-F689DA5056BF@gmail.com> References: <20140331201111.18f2688b@kalimero.tijl.coosemans.org> <2C2F5FA3-D5F3-4223-A163-F689DA5056BF@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/ORJnaCt_Ipyp5PRRWcplqy5" Cc: "freebsd-questions@freebsd.org" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2014 20:14:58 -0000 --MP_/ORJnaCt_Ipyp5PRRWcplqy5 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Mon, 31 Mar 2014 14:08:55 -0500 Matthew Pherigo wrote: >> On Mar 31, 2014, at 1:11 PM, Tijl Coosemans wrote: >>> On Mon, 31 Mar 2014 12:15:35 -0500 Matthew Pherigo wrote: >>> I'm having a problem with lang/nimrod that's keeping me from doing any >>> development at the moment. I think this is an issue created by the >>> person who created the port (nimrod works fine on my arch linux VM), >>> but I figured I'd check here in case anyone knows a fix. >>> >>> When I try to compile anything from nimrod, the paths calls the compiler >>> with are incorrect. For example, here is the (successful) compilation >>> output of a program that doesn't depend on any external Libs (besides >>> system.nim): >> >> Can you make these example program available somewhere so I can try to >> reproduce this? > > The programs themselves don't make any difference. But, here they are. > The first one is simply > echo("Hello, world!") > > The program that has external dependencies is a very incomplete calculator > program, as follows: > > import strutils > var a, b, c: float > var buf: string > echo("Enter your first number! \n> ") > buf = readLine(stdin) > a = ParseFloat(buf) It seems that nimrod currently requires procfs to be mounted. I've attached a patch to avoid that. You can place it in lang/nimrod/files and then rebuild the port. You should also be able to remove /etc/nimrod.cfg then. --MP_/ORJnaCt_Ipyp5PRRWcplqy5 Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=patch-lib-pure-os.nim --- lib/pure/os.nim.orig +++ lib/pure/os.nim @@ -1389,8 +1389,6 @@ result = getApplAux("/proc/self/exe") elif defined(solaris): result = getApplAux("/proc/" & $getpid() & "/path/a.out") - elif defined(freebsd): - result = getApplAux("/proc/" & $getpid() & "/file") elif defined(macosx): var size: cuint32 getExecPath1(nil, size) @@ -1399,16 +1397,14 @@ result = "" # error! else: # little heuristic that may work on other POSIX-like systems: - result = string(getEnv("_")) - if len(result) == 0: - result = string(ParamStr(0)) - # POSIX guaranties that this contains the executable - # as it has been executed by the calling process - if len(result) > 0 and result[0] != DirSep: # not an absolute path? - # iterate over any path in the $PATH environment variable - for p in split(string(getEnv("PATH")), {PathSep}): - var x = joinPath(p, result) - if ExistsFile(x): return x + result = string(ParamStr(0)) + # POSIX guaranties that this contains the executable + # as it has been executed by the calling process + if len(result) > 0 and result[0] != DirSep: # not an absolute path? + # iterate over any path in the $PATH environment variable + for p in split(string(getEnv("PATH")), {PathSep}): + var x = joinPath(p, result) + if ExistsFile(x): return x proc getApplicationFilename*(): string {.rtl, extern: "nos$1", deprecated.} = ## Returns the filename of the application's executable. --MP_/ORJnaCt_Ipyp5PRRWcplqy5--