[bug#36856] build: Add julia-build-system
diff mbox series

Message ID CAO7Ox=b7q6MKF7Y_i4KcsC4pnKEtauk0f4_J6+w+Mgt7LjNH0w@mail.gmail.com
State New
Headers show
Series
  • [bug#36856] build: Add julia-build-system
Related show

Commit Message

Nicolò Balzarotti Aug. 3, 2019, 10:04 a.m. UTC
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 <julien@lepiller.eu> writes:
>>>
>>> > Le 30 juillet 2019 16:11:19 GMT+02:00, Ricardo Wurmus <
>>> rekado@elephly.net> a écrit :
>>> >>
>>> >>Nicolò Balzarotti <anothersms@gmail.com> 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
>>>
>>>

Comments

Julien Lepiller Sept. 4, 2019, 8:21 p.m. UTC | #1
Hi Nicolò,

I've just pushed your patches as
a44a535ebecd40c52514623a44d31d927ecca9da and
11d73fb412d8728cf916eff9d9750be0bb593076. Sorry for the delay!

I took the liberty to remove some whitespace errors and transform tabs
into spaces, as well as changing the changelog from your second patch.

I'm closing this thread now, so please send your julia packages to a
new bug when they are ready (don't forget to fill in the description,
synopsis, and run guix lint :))

Julien

Le Sat, 3 Aug 2019 10:04:20 +0000,
Nicolò Balzarotti <anothersms@gmail.com> a écrit :

> 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 <julien@lepiller.eu> writes:
> >>>  
> >>> > Le 30 juillet 2019 16:11:19 GMT+02:00, Ricardo Wurmus <
> >>> rekado@elephly.net> a écrit :  
> >>> >>
> >>> >>Nicolò Balzarotti <anothersms@gmail.com> 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
> >>>
> >>>

Patch
diff mbox series

From a0b0bf1350023404b782656c2a093ca0bfd6abb8 Mon Sep 17 00:00:00 2001
From: nixo <nicolo@nixo.xyz>
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