GNU bug report logs - #46195
[PATCH] Add julia-http with dependencies

Previous Next

Package: guix-patches;

Reported by: Nicolò Balzarotti <anothersms <at> gmail.com>

Date: Sat, 30 Jan 2021 21:22:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#46195: closed ([PATCH] Add julia-http with dependencies)
Date: Sat, 20 Mar 2021 21:33:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 20 Mar 2021 22:32:50 +0100
with message-id <877dm14ikd.fsf <at> gnu.org>
and subject line Re: bug#46195: [PATCH] Add julia-http with dependencies
has caused the debbugs.gnu.org bug report #46195,
regarding [PATCH] Add julia-http with dependencies
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
46195: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=46195
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Nicolò Balzarotti <anothersms <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add julia-http with dependencies
Date: Sat, 30 Jan 2021 22:21:04 +0100
[Message part 3 (text/plain, inline)]
Hi guix!
Here's my second set of patches adding Julia packages.

This time one package (julia-mbedtls-jll) requires a shared library
(mbedtls-apache).  The most recent way (threre has been a few during the
years) Julia packages use to ship binaries is by using jllwrappers
[fn:1], which generates package_jll (e.g. mbedtls-jll [fn:2]), a Julia
package which is then included by the real Julia package (e.g. mbedtls
[fn:3]).  Jllwrappers usually downloads prebuild binaries.  There's an
override mechanism (creating a folder named "override" under the julia
module dir).

They recently added an easiesr way to override this behaviour
(https://github.com/JuliaPackaging/JLLWrappers.jl/pull/27), but this
will be available on julia 1.6+.

In the meanwhile I see two ways around this:
- symlinking deps into
  /gnu/store/...julia-packagename-jll/[...]/override
- patching both jllwrappers to support a custom override path, and then
  patching the jllwrapper call inside each package-jll so that the
  library/binary is searched in the correct directory.

I do like this second approach more (but I don't have a strong opinion
on this), so in this patchset I patched @generate_wrapper_header macro,
so that it takes an optional parameter with the overidden library path.
While we wait for julia 1.6, the way to use this is (like I'm doing in
mbedtls-jll) to add the path to the library the generate_wrapper_header
call, and everything works fine.  I also added the relative
documentation.  If you think symlinking is a better approach, let me
know so that I can update this patch set.

(Also, somehow I managed to add to errors in previous patches (wrong
arugment name in build system, wrong file name in julia-adapt, which I
fixed now.  I'm really sorry)

Thanks again!

Nicolò

[fn:1] https://github.com/JuliaPackaging/JLLWrappers.jl
[fn:2] https://github.com/JuliaBinaryWrappers/MbedTLS_jll.jl
[fn:3]
https://github.com/JuliaLang/MbedTLS.jl/blob/ec0d189551406b883259872611d913defb5cd423/Project.toml#L8

[0001-doc-guix.texi-Fix-typo-in-julia-build-system.patch (text/x-patch, attachment)]
[0002-gnu-julia-xyz-julia-adapt-Set-file-name-according-to.patch (text/x-patch, attachment)]
[0003-gnu-Add-julia-benchmarktools.patch (text/x-patch, attachment)]
[0004-gnu-Add-julia-jllwrappers.patch (text/x-patch, attachment)]
[0005-gnu-Add-julia-mbedtls-jll.patch (text/x-patch, attachment)]
[0006-gnu-Add-julia-mbedtls.patch (text/x-patch, attachment)]
[0007-gnu-Add-julia-uris.patch (text/x-patch, attachment)]
[0008-gnu-Add-julia-inifile.patch (text/x-patch, attachment)]
[0009-gnu-Add-julia-bufferedstreams.patch (text/x-patch, attachment)]
[0010-gnu-Add-julia-http.patch (text/x-patch, attachment)]
[Message part 14 (message/rfc822, inline)]
From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolò Balzarotti <anothersms <at> gmail.com>
Cc: 46195-done <at> debbugs.gnu.org
Subject: Re: bug#46195: [PATCH] Add julia-http with dependencies
Date: Sat, 20 Mar 2021 22:32:50 +0100
Hi Nicolò,

Nicolò Balzarotti <anothersms <at> gmail.com> skribis:

> This time one package (julia-mbedtls-jll) requires a shared library
> (mbedtls-apache).  The most recent way (threre has been a few during the
> years) Julia packages use to ship binaries is by using jllwrappers
> [fn:1], which generates package_jll (e.g. mbedtls-jll [fn:2]), a Julia
> package which is then included by the real Julia package (e.g. mbedtls
> [fn:3]).  Jllwrappers usually downloads prebuild binaries.  There's an
> override mechanism (creating a folder named "override" under the julia
> module dir).

So JLL is a “foreign function interface” (FFI), right?

> They recently added an easiesr way to override this behaviour
> (https://github.com/JuliaPackaging/JLLWrappers.jl/pull/27), but this
> will be available on julia 1.6+.
>
> In the meanwhile I see two ways around this:
> - symlinking deps into
>   /gnu/store/...julia-packagename-jll/[...]/override
> - patching both jllwrappers to support a custom override path, and then
>   patching the jllwrapper call inside each package-jll so that the
>   library/binary is searched in the correct directory.
>
> I do like this second approach more (but I don't have a strong opinion
> on this), so in this patchset I patched @generate_wrapper_header macro,
> so that it takes an optional parameter with the overidden library path.
> While we wait for julia 1.6, the way to use this is (like I'm doing in
> mbedtls-jll) to add the path to the library the generate_wrapper_header
> call, and everything works fine.  I also added the relative
> documentation.  If you think symlinking is a better approach, let me
> know so that I can update this patch set.

Sounds reasonable to me.

I pushed the whole series, tweaking one or two commit logs; I also took
the liberty to adjust this example:

> +The package @code{MbetTLS} can be taken as an example:
> +@lisp
> +(add-after 'unpack 'override-binary-path
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (map
> +              (lambda (wrapper)
> +                (substitute* wrapper
> +                  (("generate_wrapper_header.*")
> +                   (string-append
> +                    "generate_wrapper_header(\"MbedTLS\", \""
> +                    (assoc-ref inputs "mbedtls-apache") "\")\n"))))
> +              ;; There's a Julia file for each platform, override them all
> +              (find-files "src/wrappers/" "\\.jl$"))
> +             #t))
> +@end lisp

… where I “fixed” indentation, used ‘for-each’ instead of ‘map’, and
removed the trailing #t (it’s obsolescent).

Thank you, and apologies for the delay!

Ludo’.


This bug report was last modified 4 years and 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.