From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WG5eMJrocmc0wQAAqHPOHw:P1 (envelope-from ) for ; Mon, 30 Dec 2024 18:38:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id WG5eMJrocmc0wQAAqHPOHw (envelope-from ) for ; Mon, 30 Dec 2024 19:38:18 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b="j/DgICtd"; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1735583898; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=4k/lrxXI1DGGSlb9nPYFOU2xpTkhh1JQ2j50VbgTJ7o=; b=QyIE/ekcOhwQpLGfX5OFgcOtBRMc8md0D2vZi299scIcWv5y2xJBR2x3WlGP6VNACt+u0c COkApBTs0Ak+h42hKFA+q6yrIGUQAPaKupJRhWkP/pGMT2eipqCFz70SKc75a+LJwgN4s+ gSS/lKY1sGkBaYoQMllut6cwVD3KpCDjryObTvhZCf6HZzSltjCe4BvW1Vz99PN3rbu96m LSCXYLWU+lSRBiC2gkrQyZwsSVX/1KjGH09ChskKMjXq82rXdHfoK2NTD/xBYGNb2zFiK/ 9Dgo/rzmPvGMZECaIkJVG9Qm/qP0LviaL3RjYDRFeGwHZo8RcpqVi5q/LcaDxg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=posteo.de header.s=2017 header.b="j/DgICtd"; 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"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1735583898; a=rsa-sha256; cv=none; b=HyJ1JmAAJyjmhKh4cB/oD7eAioK0nfezhEEHkmomY2edzknBWeuxObsK0kOSTUZOJgenej sA57DE4XSVr5hRiKPqUG8P3T/JorEVn+PHDMzySi0+yeJOuTiPQpUsysP90c3KO0xPlnoB CZ4i0PWb+eKwDglwOILjUkaOzMQnznlW4QYIcIkekvdfE1c421iw98/kTay2DdCdgUnj7O 8zfDfCwPneh1v7NHoHffMw2H02RdgY8ov3RX25jXCbC5Hk1rW8fnf0GnrLla5DaIUnJuWs 21HJc3ywPSPHgoeCpZDmlkvXuHXf6DrNGAXEdK4ZoFAMtqts77A8kyvRAPNXFw== 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 170199EC96 for ; Mon, 30 Dec 2024 19:38:18 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSJx4-0003pp-MA; Mon, 30 Dec 2024 12:53:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSJx3-0003pc-Mv for help-guix@gnu.org; Mon, 30 Dec 2024 12:53:13 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSJx0-0008O2-Jd for help-guix@gnu.org; Mon, 30 Dec 2024 12:53:13 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A81CC240028 for ; Mon, 30 Dec 2024 18:53:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1735581188; bh=vlLdjy/OpdOSLRSZXvu02Y2QRWpP+9Mi8q4XHLGsHN4=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:From:Cc:From; b=j/DgICtdOl9rH3Zv2abxvLVjoEkWMxF4OAWCMYztHEKvMQ+nrz+Me24Xc2bPnEjSt ss6TAIhwRQFL4Vo2L/pEoj3H1zLhYd9zFTcaCyrAcMceI9SlvLsmu+up6tZxUis5Kn nJIH91TwjmbTvcnHTQD6qjZ0yA6bKGtKWT/xPu1HaB1YIY2y2p7DLD9taMrWEZfdwA 84monhK2HY4Ck+l1I5DQQfqut8SjA7Y5YV6j14pVNeCbG+aAp+kbEj/46X4WXKz0nm 7EsZDiCTOupybu85PsZPeOFUdBPMX0K+KLOSp5suRS+YpSjtYffiKmSBFm0knwJfiC X/4x5IQ/YQCXA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YMNxH0Cn7z9rxL for ; Mon, 30 Dec 2024 18:53:06 +0100 (CET) Message-ID: Date: Mon, 30 Dec 2024 17:53:06 +0000 MIME-Version: 1.0 Subject: Re: OCaml package `ocaml-zarith` not working / Guix installed `ocamlc` not picking up installed libraries (addendum 1) From: Zelphir Kaltstahl References: <62213a9d-3bab-4f0f-bd7b-9a98b880ae0d@posteo.de> Content-Language: en-US Cc: help-guix In-Reply-To: <62213a9d-3bab-4f0f-bd7b-9a98b880ae0d@posteo.de> Received-SPF: pass client-ip=185.67.36.65; envelope-from=zelphirkaltstahl@posteo.de; helo=mout01.posteo.de X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 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, HTML_MESSAGE=0.001, MISSING_HEADERS=1.021, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 5.00 X-Spam-Score: 5.00 X-Migadu-Queue-Id: 170199EC96 X-Migadu-Scanner: mx10.migadu.com X-TUID: zGSJrqmwno2D On 30.12.24 18:50, Zelphir Kaltstahl wrote: > > Hello Guix users, > > I am facing a problem trying to use Guix to install Ocaml packages. > > I was implementing a simple recursive factorial function, as part of learning > the language, and tested what would happen, if I calculated factorial of 100 > ... Result: 0. "Ah!" I thought, "all I need to do is get that Zarith package I > have been reading about before, and import that in my code!". So I added it to > my manifest.scm file, which I use for a `guix shell`, and expected the Ocaml > compiler to naturally pick up packages installed via guix, since the Ocaml > compiler ocamlc is also installed using guix. However, it seems this is > dysfunctional currently and ocamlc does not realize that the library is in > fact installed. I am not sure where it is looking for libraries. > > Here is how to reproduce: > > ~~~~guix-env/channels.scm~~~~ > (list (channel > (name 'guix) > (url"https://git.savannah.gnu.org/git/guix.git") > (branch "master") > (commit > "4473f8ae902c2192cab6919363a9101ce9861e45") > (introduction > (make-channel-introduction > "9edb3f66fd807b096b48283debdcddccfea34bad" > (openpgp-fingerprint > "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))) > ~~~~ > > ~~~~guix-env/manifest.scm~~~~ > (specifications->manifest > '("ocaml" > "ocaml-utop" > "dune" > ;; "opam" ; using guix to install packages, should not need opam > "bash" > "ocaml-zarith")) > ~~~~ > > ~~~~main.ml~~~~ > open Z > > let factorial n = > let rec iter n = > if n < (of_int 2) > then of_int 1 > else mul n (iter (sub n (of_int 1))) > in > iter (of_int n) > > > let _ = 5 |> factorial |> to_string |> print_endline > let _ = 100 |> factorial |> to_string |> print_endline > ~~~~ > > ~~~~command~~~~ > guix time-machine --channels=guix-env/channels.scm -- shell --check --manifest=guix-env/manifest.scm -- bash -c 'ocamlc -c main.ml -o main.byte' > > guix shell: checking the environment variables visible from shell '/bin/bash'... > guix shell: All is good! The shell gets correct environment variables. > File "main.ml", line 1, characters 5-6: > 1 | open Z > ^ > Error: Unbound module Z > ~~~~ I would also like to add, that utop _does_ pick up the library and that in utop I can: ~~~~in utop~~~~ #require "zarith";; ~~~~ And work with its functions. So this really seems to be about ocamlc. -- repositories:https://notabug.org/ZelphirKaltstahl,https://codeberg.org/ZelphirKaltstahl