Subject: Re: julia-1.6 guix

From: Nicolò Balzarotti <[email-masked]>
Date: Mon, 10 May 2021 09:07:58 +0200

I'll forward here the review I sent you privately.

I want to add that it built ok.  I tried building but
julia-benchmarktools and julia-staticarrays are failing.

Version 0.7.0 works fine and should work both on 1.6 (tested) and 1.5
(untested) [fn:1] so we should apply it before the julia update.

I tried updating StaticArrays, but the build still fails.  I opened a
bug report here [fn:2].

I attached here the patch, if you can please apply it before yours, apply my
suggestions and send the updated patch

[fn:1] https://github.com/JuliaCI/BenchmarkTools.jl/blob/e058ff249215671c196f2c24a0a3f401de27b718/test/TrialsTests.jl#L217
[fn:2] https://github.com/JuliaArrays/StaticArrays.jl/issues/912

>From 1376c9103b315492b123eeea1ffc93f81163a809 Mon Sep 17 00:00:00 2001
From: nixo <[email-masked]>
Date: Mon, 10 May 2021 08:55:16 +0200
Subject: [PATCH] gnu: julia-benchmarktools: Update to 0.7.0.

* gnu/packages/julia-xyz.scm (julia-benchmarktools): Update to 0.7.0.
---
 gnu/packages/julia-xyz.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/julia-xyz.scm b/gnu/packages/julia-xyz.scm
index 9812162ce1..04eddbd8b2 100644
--- a/gnu/packages/julia-xyz.scm
+++ b/gnu/packages/julia-xyz.scm
@@ -76,7 +76,7 @@ be GPU compatible without throwing away the wrapper.")
 (define-public julia-benchmarktools
   (package
     (name "julia-benchmarktools")
-    (version "0.5.0")
+    (version "0.7.0")
     (source
      (origin
        (method git-fetch)
@@ -85,7 +85,7 @@ be GPU compatible without throwing away the wrapper.")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0nsx21m3i5h22lkgyrmfj6r085va6ag40khwssqs8y7l0wz98lvp"))))
+        (base32 "000izw9pj7cbh9r35nnwg2ijkb9dpfd5nkl2889b8b2dpsh4fi63"))))
     (build-system julia-build-system)
     (propagated-inputs `(("julia-json" ,julia-json)))
     (home-page "https://github.com/JuliaCI/BenchmarkTools.jl")
-- 
2.31.1

Nicolò Balzarotti <[email-masked]> writes:

> seems to be ok (applied fine).  A few notes about the patch
>
> [...]
>>          `(list ;; Taken from NixOS. Only way I could get libLLVM-6.0.so
>> -           "-DCMAKE_BUILD_TYPE=Release"
>> +          "-DCMAKE_BUILD_TYPE=Release"
>> +
>> +          ;; Build a native compiler and the NVPTX backend (NVIDIA) since
>> +          ;; Julia insists on it, nothing more.  This reduces build times and
>> +          ;; disk usage.
>> +          ,(string-append "-DLLVM_TARGETS_TO_BUILD=" (system->llvm-target))
>> +          "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=NVPTX"
>>  
>> -           ;; Build a native compiler and the NVPTX backend (NVIDIA) since
>> -           ;; Julia insists on it, nothing more.  This reduces build times and
>> -           ;; disk usage.
>> -           ,(string-append "-DLLVM_TARGETS_TO_BUILD=" (system->llvm-target))
>> -           "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=NVPTX"
> Here it's difficult to see if there are changes, you should undo the
> indent edit.  If indentation is wrong, it should be fixed in a separate commit.
>
>> +          ;; "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}"
>> +          ;; "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
>> +          ;; "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly"
> Those seems to be taken from nixos, but is there a reason why are those
> commented?
>
>> +                        (invoke "patch" flag "-i" (string-append
>> "julia-src/deps/patches/" patchname ".patch")))))
> Line too long
>
>> +                 (mkdir-p "julia-src")
>> +                 (invoke "tar" "xf" (assoc-ref inputs "julia-source")
>> "-C" "julia-src" "--strip-components=1")
> DITTO
>
>> +                 (map (lambda (patchname)
>> +                        (patch patchname "-p1")) (list
>> "llvm-D27629-AArch64-large_model_6.0.1"
> Here we can slpit the line before (list
>
>>  
>> -           "-DLLVM_LINK_LLVM_DYLIB=ON"))))))
>> +                 #t)))))))
> Returning #t should not be needed anymore
>
>> +    (inputs
>> +     `(("julia-source" ,(package-source julia))
>> +       ,@(package-inputs llvm-11)))))
>>  
>> -                                         "suitesparse"))
>> +                                         "suitesparse" "libfortran"))
>>                                    ":"))
>>               #t))
> We can remove this #t now
>
>> +                      (string-append "stdlib/" pkgname "_jll/src/"
>> pkgname "_jll.jl")))
> Long line
>> +           (lambda* (#:key inputs #:allow-other-keys)
>> +             ;; some tests execute julia in an environment that needs
>> to propagate GUIX_LOCPATH
> Good catch, I was wondering which ENV variable was needed
>
>> +             (substitute* "test/cmdlineargs.jl"
>> +               (("\"HOME\"\\s=>\\shomedir\\(\\)") "\"HOME\" =>
>> homedir(), \"GUIX_LOCPATH\" => ENV[\"GUIX_LOCPATH\"]"))
>>               #t))
> again, long line and #t
>> +         (add-before 'install 'symlink-libraries ;; FIXME change
>> build to install
> What does this comment refer to?
>>          (string-append "prefix=" (assoc-ref %outputs "out"))
>>  
>> -         ;; Passing the MARCH flag is necessary to build binary substitutes for
>> -         ;; the supported architectures.
>> -         ,(match (or (%current-target-system)
>> -                     (%current-system))
>> -                 ("x86_64-linux" "MARCH=x86-64")
>> -                 ("i686-linux" "MARCH=pentium4")
>> -                 ("aarch64-linux" "MARCH=armv8-a")
>> -                 ;; Prevent errors when querying this package on unsupported
>> -                 ;; platforms, e.g. when running "guix package --search="
>> -                 (_ "MARCH=UNSUPPORTED"))
>> +        ;; Passing the MARCH flag is necessary to build binary substitutes for
>> +        ;; the supported architectures.
>> +        ,(match (or (%current-target-system)
>> +                    (%current-system))
>> +           ("x86_64-linux" "MARCH=x86-64")
>> +           ("i686-linux" "MARCH=pentium4")
>> +           ("aarch64-linux" "MARCH=armv8-a")
>> +           ;; Prevent errors when querying this package on unsupported
>> +           ;; platforms, e.g. when running "guix package --search="
>> +           (_ "MARCH=UNSUPPORTED"))
>>
> Again the indentation stuff
>
>