From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CLGqI6hh3WIcdAAAbAwnHQ (envelope-from ) for ; Sun, 24 Jul 2022 17:13:44 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id qE3YIqhh3WKY6gAAG6o9tA (envelope-from ) for ; Sun, 24 Jul 2022 17:13:44 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 65D84EC55 for ; Sun, 24 Jul 2022 17:13:43 +0200 (CEST) Received: from localhost ([::1]:54240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFdIc-0006EQ-Ir for larch@yhetil.org; Sun, 24 Jul 2022 11:13:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFdIO-0006EH-QD for help-guix@gnu.org; Sun, 24 Jul 2022 11:13:28 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:35199) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFdIM-0007C9-BR for help-guix@gnu.org; Sun, 24 Jul 2022 11:13:28 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AB3A55C007D; Sun, 24 Jul 2022 11:13:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 24 Jul 2022 11:13:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trevdev.ca; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1658675601; x=1658762001; bh=dzCrHFdh+1 PS/YIU0JNxuwCArL7In4JUW68SUNVQJcY=; b=JQHRV19z52UnZ1uIu+DEyxJmf4 GTLmIRbbgkd4tFD2tfKKULQndItzoScdx2J4RLstAml4JGr8heZk6pQkkOyqi1f9 gk+XX9wXnE6kMUeRPgg4AVl4WfSkVRrg90xk9KeTg3YGVnb0l7HePm6gbdrspQ0H Bko/Gqb2DiHnJilny5abnKdVA3l34en7oN4c9aUnkcqL/lm+jvbF2qL1neZFgGsi b6D4SbOlzP4cnbVJCvFBowJJmhp+3zBa0Btl6zblcsgkE+7lsKQtRzqrSv9uIU2Q XCWr/o6F2e6+KNJyGQBDZG2kdlUKG0/YeekXCo/yzbrqtqWYYsgIGGwgMl0g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1658675601; x=1658762001; bh=dzCrHFdh+1PS/YIU0JNxuwCArL7I n4JUW68SUNVQJcY=; b=lpIjzsndGA/7Dh2PAtw60yH5gx9fR5qx0xTN/IFgPSbo hoNc+MK5DNAhE2CoRST6p9na7wPBMvWbteh0H+3+AT1xqqAlSWRVIhGS+8mHT5Ti oGS0NbwOOXAtBYmo0TLYZy3/yUsEKkByY5zguNhnW1sqltSpTt0sIlXU7dn1jc2p Lb1rVoDFhdk8AKNpanG+ojeJRgZrUdboJ9L7+s7jGoX99CVbFp1Lt2XAOfoDcP28 +9F8k0dUpm+DRpHQ4+T6ZK3uDvEuz3aan9zJmeujoyKRm1wYMKSF19abUy6LBovE T3WqoQJcorzEB3eR15kgT2ivZzMUWE3fo2u8j5XQWQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddtiedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefujghffgffkfggtgesghdtreertderjeenucfhrhhomhepvfhrvghv uceothhrvghvsehtrhgvvhguvghvrdgtrgeqnecuggftrfgrthhtvghrnhepteeuieejfe eiteduuefgvdfhfeeuheeuueffhfeftdefgfeiudfhhfekveejgfeunecuffhomhgrihhn pehnihhmrdgtihdpnhhimhdqlhgrnhhgrdhorhhgpdhgihhthhhusgdrtghomhdpihhnsh htrghllhdrshhhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepthhrvghvsehtrhgvvhguvghvrdgtrg X-ME-Proxy: Feedback-ID: i762946f9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Jul 2022 11:13:20 -0400 (EDT) From: Trev To: Efraim Flashner Cc: GUIX Help Subject: Re: Troubles building "nimble" with nim In-Reply-To: References: <87tu7uceff.fsf@codinator.mail-host-address-is-not-set> User-Agent: Notmuch/0.36 (https://notmuchmail.org) Emacs/28.1 (x86_64-pc-linux-gnu) Date: Sun, 24 Jul 2022 08:13:16 -0700 Message-ID: <87zggy5ysz.fsf@codinator.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=66.111.4.29; envelope-from=trev@trevdev.ca; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658675624; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=dzCrHFdh+1PS/YIU0JNxuwCArL7In4JUW68SUNVQJcY=; b=BG5ICj7H31CFKKzy64IHp/27PiCr0Y/zPO45Bd61Z2m6aZmHCxCRPEgCcfbTKvDmDaulZs n/dFQrj9HA8cLM6G3USMOIRdIsRymfnCaecWGv+qPfG/xej4g5BVWWJwtS/SbCAiLYraVK yTl8SYcQLp/fT54efZ2+iX9p9SjUdc3CVMm/+XDXrNuVdpX52egZvbLaOyWEIypDRv7DTj 8x/sfaFJL2PTMKWGgciYwamtM+n0aneHHNSA9luDFvJmNGgUfTHtCDpTseEH2vVap5mgrj eGPfZQVuJVMftUdzc1v3DKYvsiZsJXzq+3PRJLP/nDbI3gvfvtwxeQietjBSqg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658675624; a=rsa-sha256; cv=none; b=vDKsWBPTHH/zbDV7vS6lEkDfGWIVLkl5reFDPghpPiVdoTPPtSP+ElM4Pn7nTFF3vdHSQu SmukADTLdDASXRKhYPbm0b9KqGFL+jvnUlwjCwd2VCPQNNQR/a3MRY8ACnU3/KWrwwTbEr vgIeoWnVIJIRm8NkKdwZI3nBzgtyJ2g354Ddy20ae56nxVA644NBZ5tHC896kGndmjNCr5 d/R7k+qnf9iaLT4V7dK634fM4ANRPwy7tHZnF5L6iskKShKwf71+kqjIpqqyuPqksDLvaJ MhaBFLI67EJNc29Hj9otwCGWEkqb/dzaNCp5lcL+vAbkyBOoPjchATxhetFr8w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trevdev.ca header.s=fm1 header.b=JQHRV19z; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=lpIjzsnd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -1.23 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trevdev.ca header.s=fm1 header.b=JQHRV19z; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm3 header.b=lpIjzsnd; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 65D84EC55 X-Spam-Score: -1.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: cjMdsPdtK0M+ --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Efraim Flashner writes: > > try changing this to "stdlib_osproc.nim.c" > I am not sure how I missed this with grep, but I clearly did. I am able to finish the build :D I just need to tell the install step to move the additional binaries. Thanks for your help! > On Wed, Jul 06, 2022 at 10:57:08AM -0700, Trev wrote: >>=20 >> Hello Guix! >>=20 >> I am in the weeds while trying to properly build "nimble", the package >> manager that is included with the nim programming language. The current >> guix package (gnu/packages/nim) completely misses this build step. I >> wonder if previous contributors also struggled with this. >>=20 >> For some context I am attempting to directly replicate these steps from >> https://nim-lang.org/install_unix.html: >>=20 >> #+BEGIN_QUOTE >> sh build.sh >> bin/nim c koch >> ./koch boot -d:release >> ./koch tools >> #+END_QUOTE >>=20 >> My (and the current package record) can build the nim binary using gcc, = no problem. However when we get to the part where nim builds its own featur= es with the compiled compiler, something seems to be trying to call =3D/bin= /sh=3D directly, despite hard-coded references to that process having been = been substituted out. >>=20 >> I have submitted a ticket with Nim here just so that I may ask some thou= ghtful questions. That conversation is here: https://github.com/nim-lang/Ni= m/issues/19976 >>=20 >> The error output is: >>=20 >> #+BEGIN_SRC sh >> c_code/2_2/stdlib_browsers.nim.o c_code/2_2/@mnim.nim.o -ldl -lm -lrt >> : SUCCESS >> Hint: used config file '/tmp/guix-build-nim-1.6.6.drv-0/nim-1.6.6/config= /nim.cfg' [Conf] >> Hint: used config file '/tmp/guix-build-nim-1.6.6.drv-0/nim-1.6.6/config= /config.nims' [Conf] >> ........................................................................= .............................................. >> CC: stdlib_digitsutils.nim >> Error: invocation of external compiler program failed. No such file or d= irectory >> Additional info: Could not find command: '/bin/sh'. OS error: No such fi= le or directory 2 >> error: in phase 'build': uncaught exception: >> %exception #<&invoke-error program: "./bin/nim" arguments: ("c" "koch") = exit-status: 1 term-signal: #f stop-signal: #f>=20 >> phase `build' failed after 96.6 seconds >> command "./bin/nim" "c" "koch" failed with status 1 >> #+END_SRC >>=20 >> My current attempt at packaging this looks like this: >>=20 >> #+BEGIN_SRC scheme >> (define-module (gnu packages nim) >> #:use-module (guix build-system gnu) >> #:use-module (guix gexp) >> #:use-module (guix download) >> #:use-module ((guix licenses) #:prefix license:) >> #:use-module (guix packages) >> #:use-module (gnu packages pcre) >> #:use-module (gnu packages tls) >> #:use-module (gnu packages cmake)) >>=20 >> (define-public nim >> (package >> (name "nim") >> (version "1.6.6") >> (source >> (origin >> (method url-fetch) >> (uri (string-append "https://nim-lang.org/download/" >> name "-" version ".tar.xz")) >> (sha256 >> (base32 "0lm4450ig8k4l3rzxv6kcqji5l1lzicsw76ckwxm0q9qdz713cb7"))= )) >> (build-system gnu-build-system) >> (native-inputs (list pcre openssl cmake)) >> (arguments >> `(#:tests? #f ; No tests. >> #:phases >> (modify-phases %standard-phases >> (delete 'configure) ; no configure script >> (add-after 'unpack 'patch-installer >> (lambda* (#:key outputs #:allow-other-keys) >> (let ((out (assoc-ref outputs "out"))) >> (substitute* "install.sh" >> (("/usr/") (string-append out "/usr/")) >> (("/etc/") (string-append out "/etc/")) >> (("/opt/") (string-append out "/opt/"))) >> #t))) >> (add-after 'patch-source-shebangs 'patch-more-shebangs >> (lambda _ >> (let ((sh (which "sh"))) >> (substitute* '("tests/stdlib/tosprocterminate.nim" >> "tests/stdlib/tstrscans.nim" >> "lib/pure/osproc.nim") >> (("/bin/sh") sh)) >> (substitute* (find-files "c_code" "stdlib_osproc.c") > > try changing this to "stdlib_osproc.nim.c" > >> (("\"/bin/sh\", 7") (format #f "~s, ~s" sh (string-leng= th sh))))) >> #t)) >> (replace 'build >> (lambda _ >> (setenv "XDG_CACHE_HOME" "./cache-home") >> (mkdir-p "./cache-home") >> (invoke "sh" "build.sh") >> (invoke "./bin/nim" "c" "koch") >> (invoke "koch" "boot" "-d:release") >> (invoke "koch" "tools") >> #t)) >> (replace 'install >> (lambda* (#:key outputs #:allow-other-keys) >> (let ((out (assoc-ref outputs "out"))) >> (mkdir-p (string-append out "/usr/bin")) >> (invoke "./install.sh" (string-append out "/usr/bin")) >> #t)))))) >> (home-page "https://nim-lang.org") >> (synopsis "Statically-typed, imperative programming language") >> (description "Nim (formerly known as Nimrod) is a statically-typed, >> imperative programming language that tries to give the programmer ultima= te power >> without compromises on runtime efficiency. This means it focuses on com= pile-time >> mechanisms in all their various forms.") >> (license license:expat))) >> #+END_SRC >>=20 >> I have tried: >>=20 >> 1. Symlinking (without any success) /bin/sh to (which "bash") >> 2. Exporting $SHELL to (which "bash") >> 3. Attempted (without much luck) to ~alias cc=3Dgcc~ to see if it's not = the shell that's missing, it's the command "cc", and adding cmake as a sepa= rate input >> 4. Grokking the Nim source code that I don't perfectly understand to see= how it could somehow decide to call something that isn't on path aside fro= m a string that's "/bin/sh". >>=20=20=20=20 >> If someone appreciates packaging this better than can share some wisdom,= it would be appreciated. >>=20 > >> --=20 >>=20 >> Trev : 0FB7 D06B 4A2A F07E AD5B 1169 183B 6306 8AA1 D206 > > > > > --=20 > Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7= =9D =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 > GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 > Confidentiality cannot be guaranteed on emails sent or received unencrypt= ed =2D-=20 Trev : 0FB7 D06B 4A2A F07E AD5B 1169 183B 6306 8AA1 D206 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTXT7EGCbVt/Iwh9m+FRs+EoT3V7wUCYt1hjxAcdHJldkB0cmV2 ZGV2LmNhAAoJEIVGz4ShPdXvf2UBAIgUkwGjHxvznQIV2GqXBUQ4e41Cn4eT6s63 jsw2SuUZAP49zz949oCgdCwIR3VC3jpqlJX8H1Vk167rV/6uceAuAw== =HXty -----END PGP SIGNATURE----- --=-=-=--