unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Roman Scherer <roman.scherer@burningswell.com>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: 61959@debbugs.gnu.org, winter@winter.cafe
Subject: [bug#61959] [PATCH 0/7] Add some Asahi Linux packages
Date: Sun, 05 Mar 2023 12:15:58 +0100	[thread overview]
Message-ID: <86zg8rient.fsf@burningswell.com> (raw)
In-Reply-To: <86zg8rlb6k.fsf@burningswell.com>

[-- Attachment #1: Type: text/plain, Size: 6552 bytes --]


Hi Ricardo & Winter,

I didn't receive Winter's email and just saw it in the web interface
after I sent v2 of the patch series. Should I be subscribed to the whole
guix-patches mailing list as well to receive them? I'm new to the email
based workflow and sometimes still a bit lost.

I will address the feedback I got from Winter and send a v3.

@Winter, I will address your comments. You are right about the order of
libdrm, it should come before mesa-asahi.

> The next step would be to support building a Linux with Rust
> modules. I'm waiting for some patches from the Rust team to do this.

About this next step. The Asahi Linux team has a version of the Linux
kernel that contains a GPU kernel module written in Rust. To build this
module I used customize-linux and added the rust and the
rust-bindgen-cli packages to its native inputs.

This is what I currently did:

```
(define (make-asahi-linux name config)
  (let* ((version "6.2-rc3-6")
         (base (customize-linux
                #:linux linux-libre-arm64-generic
                #:name name
                #:source (origin
                           (method url-fetch)
                           (uri (string-append "https://github.com/AsahiLinux/linux/archive/"
                                               "asahi-" version ".tar.gz"))
                           (sha256
                            (base32 "0bk4grzcizk48hhalyyaa4alk5069z102vx5ddw12jfqzsrdfccn"))))))
    (package
      (inherit base)
      (version version)
      (arguments
       (substitute-keyword-arguments (package-arguments base)
         ((#:phases phases '%standard-phases)
          #~(modify-phases #$phases
              (add-before 'configure 'configure-rust
                (lambda* (#:key inputs #:allow-other-keys)
                  (setenv "LIBCLANG_PATH"
                          (string-append (assoc-ref inputs "clang") "/lib"))
                  (setenv "RUST_LIB_SRC"
                          (string-append (assoc-ref inputs "rust-src")
                                         "/lib/rustlib/src/rust/library"))))
              (replace 'configure
                (lambda* (#:key inputs #:allow-other-keys)
                  (copy-file #$config ".config")
                  (chmod ".config" #o644)))))))
      (native-inputs
       `(("clang" ,clang)
         ("llvm" ,llvm)
         ("python" ,python)
         ("rust" ,(replace-jemalloc (@@ (gnu packages rust) rust-1.62)))
         ("rust-bindgen-cli" ,(replace-jemalloc rust-bindgen-cli))
         ("rust-src" ,rust-src-1.62)
         ("zstd" ,zstd)
         ,@(package-native-inputs base)))
      (home-page "https://asahilinux.org")
      (synopsis "Linux on Apple Silicon")
      (description "Asahi Linux is a project and community with the goal of porting Linux
to Apple Silicon Macs, starting with the 2020 M1 Mac Mini, MacBook
Air, and MacBook Pro."))))

(define-public asahi-linux
  (make-asahi-linux "asahi-linux" (local-file "kernel.config")))

(define-public asahi-linux-edge
  (make-asahi-linux "asahi-linux-edge" (local-file "kernel.edge.config")))
```

However, rust-bindgen-cli isn't yet packaged, and the version I used
previously (0.59.2) somehow disappeared from crates.io. They now only
have versions > 0.61.0 available, which I plan to package.

The rust team is updating many packages at the moment, so my plan was to
wait until those made it into the main branch.

I think the differences of package/inherit vs (inherit) aren't very
clear to me. I'm guess I should use package/inherit to be able to use
input transformations. Is that correct?

Roman

Roman Scherer <roman.scherer@burningswell.com> writes:

> [[PGP Signed Part:Undecided]]
>
> Hi Ricardo,
>
> I updated the patch series and sent v2 of it.
>
> Thanks for your review!
>
> Roman
>
> Ricardo Wurmus <rekado@elephly.net> writes:
>
>> Thank you for the patches.
>>
>> Here a couple of comments:
>>
>> * Please do not use Github archive URLs like
>>   "https://github.com/AsahiLinux/m1n1/archive/v….tar.gz".  These are
>>   automatically generated and have changed in the past, leading to
>>   different hashes.  In the interest of reproducibility please use
>>   “git-fetch” with plain commit hashes instead.
>>
>> * Please use G-expressions instead of simple quoting with (assoc-ref
>>   outputs "out").  Instead of this:
>>
>> --8<---------------cut here---------------start------------->8---
>>     (arguments
>>      `(#:phases
>>        (modify-phases %standard-phases
>>          (replace 'configure
>>            (lambda _
>>              (setenv "RELEASE" "1")))
>>          (replace 'install
>>            (lambda* (#:key outputs #:allow-other-keys)
>>              (let ((dir (string-append (assoc-ref outputs "out") "/libexec/")))
>>                (mkdir-p dir)
>>                (copy-file "build/m1n1.bin" (string-append dir "m1n1.bin")))))
>>          ;; There are no tests
>>          (delete 'check))))
>> --8<---------------cut here---------------end--------------->8---
>>
>>
>>   Please do this:
>>
>> --8<---------------cut here---------------start------------->8---
>>     (arguments
>>      (list
>>       ;; There are no tests
>>       #:tests? #false
>>       #:phases
>>       #~(modify-phases %standard-phases
>>          (replace 'configure
>>            (lambda _
>>              (setenv "RELEASE" "1")))
>>          (replace 'install
>>            (lambda _
>>              (let ((dir (string-append #$output "/libexec/")))
>>                (mkdir-p dir)
>>                (copy-file "build/m1n1.bin" (string-append dir "m1n1.bin"))))))))
>> --8<---------------cut here---------------end--------------->8---
>>
>>   This also applies to “asahi-fwextract”.
>>
>> * The string labels for inputs are a deprecated style.  Please use plain
>>   lists of package variables.  If you want to modify an inherited list
>>   of inputs such as in “asahi-mesa” please use “modify-inputs”.
>>
>> * In “asahi-fwextract” the build phase “'remove-vendor” should be a
>>   source snippet instead.
>>
>> * Please use pyproject-build-system instead of python-build-system.  The
>>   pyproject-build-system is going to be the default in the future, and
>>   it would be good to use it already to address any incompatibilities
>>   early.
>>
>> Could you please send a new version of this patch set?  Thanks again!
>
> [[End of PGP Signed Part]]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

  reply	other threads:[~2023-03-05 12:09 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-04 14:44 [bug#61959] [PATCH 0/7] Add some Asahi Linux packages Roman Scherer
2023-03-04 14:46 ` [bug#61959] [PATCH 1/7] gnu: Add m1n1 Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 2/7] gnu: Add u-boot-apple-m1 Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 3/7] gnu: Add asahi-fwextract Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 4/7] gnu: libdrm: Update to 2.4.114 Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 5/7] gnu: Add asahi-mesa Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 6/7] gnu: Add asahi-mesa-headers Roman Scherer
2023-03-04 14:46   ` [bug#61959] [PATCH 7/7] gnu: Add asahi-mesa-utils Roman Scherer
2023-03-04 17:38 ` [bug#61959] [PATCH 0/7] Add some Asahi Linux packages Ricardo Wurmus
2023-03-05 10:53   ` Roman Scherer
2023-03-05 11:15     ` Roman Scherer [this message]
2023-03-04 19:42 ` Winter via Guix-patches via
2023-03-05 10:53 ` [bug#61959] [PATCH v2 1/7] gnu: Add m1n1 Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 2/7] gnu: Add u-boot-apple-m1 Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 3/7] gnu: libdrm: Update to 2.4.114 Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 4/7] gnu: Add asahi-fwextract Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 5/7] gnu: Add asahi-mesa Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 6/7] gnu: Add asahi-mesa-headers Roman Scherer
2023-03-05 10:53   ` [bug#61959] [PATCH v2 7/7] gnu: Add asahi-mesa-utils Roman Scherer
2023-03-05 16:13 ` [bug#61959] [PATCH v3 0/7] Add some Asahi Linux packages Roman Scherer
2023-03-05 16:13   ` [bug#61959] [PATCH v3 1/7] gnu: Add m1n1 Roman Scherer
2023-03-05 16:13   ` [bug#61959] [PATCH v3 2/7] gnu: Add u-boot-apple-m1 Roman Scherer
2023-03-05 16:13   ` [bug#61959] [PATCH v3 3/7] gnu: libdrm: Update to 2.4.114 and adjust renamed options Roman Scherer
2023-03-05 16:14   ` [bug#61959] [PATCH v3 4/7] gnu: Add asahi-fwextract Roman Scherer
2023-03-05 16:14   ` [bug#61959] [PATCH v3 5/7] gnu: Add asahi-mesa Roman Scherer
2023-03-05 16:14   ` [bug#61959] [PATCH v3 6/7] gnu: Add asahi-mesa-headers Roman Scherer
2023-03-05 16:14   ` [bug#61959] [PATCH v3 7/7] gnu: Add asahi-mesa-utils Roman Scherer
2023-03-05 23:43 ` [bug#61959] [PATCH 0/7] Add some Asahi Linux packages Denis 'GNUtoo' Carikli
2023-03-07  4:14 ` Winter via Guix-patches via
2023-03-08 12:14   ` Roman Scherer
2023-03-08 12:13 ` [bug#61959] [PATCH v4 0/7] Change patch order Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 1/7] gnu: Add m1n1 Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 2/7] gnu: Add u-boot-apple-m1 Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 3/7] gnu: libdrm: Update to 2.4.114 and adjust renamed options Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 4/7] gnu: Add asahi-mesa Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 5/7] gnu: Add asahi-mesa-headers Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 6/7] gnu: Add asahi-mesa-utils Roman Scherer
2023-03-08 12:13   ` [bug#61959] [PATCH v4 7/7] gnu: Add asahi-fwextract Roman Scherer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86zg8rient.fsf@burningswell.com \
    --to=roman.scherer@burningswell.com \
    --cc=61959@debbugs.gnu.org \
    --cc=rekado@elephly.net \
    --cc=winter@winter.cafe \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).