From patchwork Sat Aug 3 10:04:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Nicol=C3=B2_Balzarotti?= X-Patchwork-Id: 14820 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 724F117266; Sat, 3 Aug 2019 11:05:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9ED6A17232 for ; Sat, 3 Aug 2019 11:05:27 +0100 (BST) Received: from localhost ([::1]:39166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htqul-0004ew-At for patchwork@mira.cbaines.net; Sat, 03 Aug 2019 06:05:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57420) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1htquQ-0004Ym-Dz for guix-patches@gnu.org; Sat, 03 Aug 2019 06:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1htquN-00008d-NQ for guix-patches@gnu.org; Sat, 03 Aug 2019 06:05:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49486) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1htquM-00007N-Sp for guix-patches@gnu.org; Sat, 03 Aug 2019 06:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1htquM-000397-NT for guix-patches@gnu.org; Sat, 03 Aug 2019 06:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36856] build: Add julia-build-system Resent-From: =?utf-8?q?Nicol=C3=B2?= Balzarotti Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 03 Aug 2019 10:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36856 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ricardo Wurmus Received: via spool by 36856-submit@debbugs.gnu.org id=B36856.156482668712060 (code B ref 36856); Sat, 03 Aug 2019 10:05:02 +0000 Received: (at 36856) by debbugs.gnu.org; 3 Aug 2019 10:04:47 +0000 Received: from localhost ([127.0.0.1]:58306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htqu1-00038J-CW for submit@debbugs.gnu.org; Sat, 03 Aug 2019 06:04:47 -0400 Received: from mail-io1-f43.google.com ([209.85.166.43]:33334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1htqty-000382-74 for 36856@debbugs.gnu.org; Sat, 03 Aug 2019 06:04:39 -0400 Received: by mail-io1-f43.google.com with SMTP id z3so16567840iog.0 for <36856@debbugs.gnu.org>; Sat, 03 Aug 2019 03:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d+0yKTPxYOVyrXdMoho1ZjYgmA2wqtmlA6mZnO0+hrA=; b=TYQjXe6Mh6FTYmKu2oLN447hYxAnYBxlfjSi8DvomefRBp9jZ1P9drZcOv2AXfZB5t jV+tBmscozwuHzHKC1W/QYuH3O8WQQyqbWKlQinU/asWpEcdIvnnvx2GtQ7CQxMSLA8X Nqf7nP4yoHBJtsEvfIAZVKpiKIggJ8mNI1E7dmXRgKSVD1tDruHvS91g1tEwjXFy3Dm5 SS9W/9flzQ/JrBBw5WLnZWZSkQR/wIyZm2RSrnIQcWF3ztCGySHAq7pFtY786XX3SBti 2KHj3BX1qGsIvseQ1gCQFrVYulpM3VdV+WAy3AGalhbBJUVGFyiygCJ5O1YGLuOrGcHT eShw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d+0yKTPxYOVyrXdMoho1ZjYgmA2wqtmlA6mZnO0+hrA=; b=D00WLYo/palHBzYa7x/CLkqsGPYngH/xOd1xZAihMpMpF9CTdukWgbcRyiEXBHW/Re vpKAFNGV6ImoWepos5ynq6r1tITJyAPXQ/pcV8UAT5SNnWHJRMgpbEnulUUwwOW/BC+z 0Gagn3bj8Y+sIeFByGPteKnVKTKcD+22lTya5DnqmXu2+70xn1gnhI3trx7I3ee4dwun CkfiHTZHZL1YlOToQdNbDjINd+4g+4Y/2elmple51aX7Dw8bwVpIi0Su5uaAL21/+0+H PygVTBejsz/tCftqu5Z8Ve2/VeVDRZGSI/pQ4WLPX18PrfXMnIJyS2X1yA6awp4bIUAf o+/Q== X-Gm-Message-State: APjAAAVe5R2GdgRvNf7+SpFZJz3iEunA+rn4MCZwHaFztXPhwucJ5h2C iTYa2kZHVtqlaABzhgyD2KFOu8fhkgZ3fCGV6XOXMQ== X-Google-Smtp-Source: APXvYqxHzf3nj2pwGpE1GeT2xqN7wnyy66HiG916bZ8stv/JPHdADNWPwJcCuuJn18vq8hfOZjl2kbqObksIx2Y6a/4= X-Received: by 2002:a6b:4f0d:: with SMTP id d13mr20083524iob.170.1564826672794; Sat, 03 Aug 2019 03:04:32 -0700 (PDT) MIME-Version: 1.0 References: <87sgqn629k.fsf@elephly.net> <1DBAF4CE-8BA5-43EF-9CFE-5A73FB8118EB@lepiller.eu> <87o91b619c.fsf@elephly.net> In-Reply-To: From: =?utf-8?q?Nicol=C3=B2?= Balzarotti Date: Sat, 3 Aug 2019 10:04:20 +0000 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36856@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Yeah I forgot to attach the patches. Here we go Il giorno sab 3 ago 2019 alle ore 10:03 Nicolò Balzarotti < anothersms@gmail.com> ha scritto: > Hi, I'm back. > > I fixed the problem I had (I forgot the ./pre-inst-env -.-") > > Following this discussion, I'm adding ``native-search-paths'' to the julia > package. Now, without any other hack (like the setup.jl one), it can find > the packages but only when installed with guix package -i . It cannot find > them when in an environment (guix environment --ad-hoc julia-package). > Can you help? > > Except from this, I cleaned everything a bit, and added a draft of the > documentation. I'm attaching the new patches here (without the julia-xyz > part one, to which I'll add all package synopsis and description, and I'll > split in multiple patches before re-submitting). > > Thanks, Nicolò > > Il giorno mar 30 lug 2019 alle ore 16:02 Nicolò Balzarotti < > anothersms@gmail.com> ha scritto: > >> Thanks for the quick response! >> >> Well, the environment variable JULIA_LOAD_PATH (that inside julia is just >> LOAD_PATH) works exactly like that (is a column-concatenated path list). It >> just needs the special ":@stdlib" path to let julia find its standard >> libraries. >> Example: >> > JULIA_LOAD_PATH=/my/new/path/:/profile/path/:@stdlib julia --startup=no >> -E 'LOAD_PATH' >> ["/my/new/path/", "/profile/path/", "@stdlib"] >> >> Is setting this variable from guix fine, or we need a special >> GUIX_SOMETHING variable? >> Where exactly should I set this? >> >> Thanks >> >> Il giorno mar 30 lug 2019 alle ore 14:33 Ricardo Wurmus < >> rekado@elephly.net> ha scritto: >> >>> >>> Julien Lepiller writes: >>> >>> > Le 30 juillet 2019 16:11:19 GMT+02:00, Ricardo Wurmus < >>> rekado@elephly.net> a écrit : >>> >> >>> >>Nicolò Balzarotti writes: >>> >> >>> >>> 3. By adding a simple startup.jl script, inspired by what emacs does. >>> >>This >>> >>> is simplified so I'm not sure it works for every corner case. >>> >>> #+begin_src julia >>> >>> let paths = [expanduser("~/.guix-profile"), >>> >>"/run/current-system/profile"] >>> >>> ("GUIX_ENVIRONMENT" in keys(ENV)) && push!(paths, >>> >>> ENV["GUIX_ENVIRONMENT"]) >>> >>> empty!(LOAD_PATH) >>> >>> push!.(Ref(LOAD_PATH), joinpath.(paths, "share/julia/packages/")) >>> >>> push!(LOAD_PATH, "@stdlib") >>> >>> push!.(Ref(DEPOT_PATH), joinpath.(paths, "share/julia/")) >>> >>> nothing >>> >>> end >>> >>> #+end_src >>> >> >>> >>Could this perhaps be handled by a profile hook that is included only >>> >>when the profile manifest contains a julia package? >>> > >>> > Or simply with an environment variable? GUIX_JULIA_PATH or something? >>> >>> If this is the route you go down, please ensure that it can be used as a >>> search path with more than one directory. This would make it possible >>> to extend a Julia environment with the contents of more than one >>> profile. >>> >>> -- >>> Ricardo >>> >>> From a0b0bf1350023404b782656c2a093ca0bfd6abb8 Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 3 Aug 2019 11:19:11 +0200 Subject: [PATCH 2/2] packages: julia: set JULIA_LOAD_PATH to be able to find packages --- gnu/packages/julia.scm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index 43254f25fd..65a5e42beb 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -482,6 +482,10 @@ ("patchelf" ,patchelf) ("pkg-config" ,pkg-config) ("python" ,python-2))) + (native-search-paths + (list (search-path-specification + (variable "JULIA_LOAD_PATH") + (files (list "share/julia/packages/"))))) ;; Julia is not officially released for ARM and MIPS. ;; See https://github.com/JuliaLang/julia/issues/10639 (supported-systems '("i686-linux" "x86_64-linux" "aarch64-linux")) -- 2.22.0