From: Tadhg McDonald-Jensen <tadhgmister@gmail.com>
To: guix-devel@gnu.org
Subject: glibc-mesboot native inputs vs inputs
Date: Thu, 25 Apr 2024 09:58:47 -0400 [thread overview]
Message-ID: <d23ca56b-702f-3c33-0190-645704cd09e8@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1522 bytes --]
Hello,
I'm trying to cross compile an OS definition for arm and I ran into an
issue where it tried to compile glibc-mesboot from commencement.scm and
failed because in the `setenv` phase it does:
> (let* ((headers (assoc-ref inputs "headers"))
> (libc (assoc-ref inputs "libc"))
> (gcc (assoc-ref inputs "gcc"))
And then uses `libc` in string-append, however these are all native
inputs so when cross compiling this is the wrong way to access them and
the build fails because the returned `#f` is the wrong data type.
I tried replacing these with `this-package-native-input` and it seemed
to work but in the build log I noticed it also compiled a package called
`glibc-cross-arm-linux-gnueabihf` so I'm wondering if depending on
glibc-mesboot for arm was the real mistake, I'm not sure how to use
`guix graph` for my own os definition instead of a named package so I'm
not sure how to track down why there was a dependency on glibc-mesboot
being cross compiled.
I've attached my os definition in case it helps, I'm compiling it with
`guix system image --target=arm-linux-gnueabihf turris.scm`. I'm not
asking for any specific help with that definition beyond knowing which
part is trying to compile glibc-mesboot for arm and whether it is
because I'm doing something wrong or there is an incorrect dependency
for cross compiling or whether it is a bug in glibc-mesboot for not
using `this-package-native-input`.
I hope this makes sense, thanks for your input,
Tadhg
[-- Attachment #2: turris.scm --]
[-- Type: text/x-scheme, Size: 3210 bytes --]
(use-modules
(gnu)
(gnu image)
(gnu system image)
(guix gexp)
((guix packages) #:select (package origin base32 modify-inputs package-native-inputs))
((guix git-download) #:select (git-fetch git-reference git-file-name))
((gnu packages ssh) #:select(openssh))
((gnu packages autotools) #:select(automake autoconf))
((gnu bootloader grub) #:select(grub-efi-bootloader))
((gnu services networking) #:select(dhcp-client-service-type))
((gnu services ssh) #:select(openssh-service-type openssh-configuration))
)
;; this contains one commit to comment out the configure code for -fzero-call-used-regs
(define patched-ssh
(package
(inherit openssh)
(name "openssh_fzero-call-used-regs-removed")
;; autoconf is used to build the configure.ac and it failed saying it needed aclocal which seems to come from automake
(native-inputs (modify-inputs (package-native-inputs openssh) (append automake autoconf)))
(source (origin
(method git-fetch)
(sha256 (base32 "09rih4paiw9hpchjplf8szl7z7w0pqqqx6bij5fkxxsxd5mvy00n"))
(uri (git-reference (url "https://github.com/tadhgmister/openssh-portable")
(commit "59758a3c3764b35dca7f22f8e37eb301f688eab0")))
(file-name (git-file-name "openssh" "tadhgpatch"))))))
;;; STUFF FROM UBOOT
;;; TODO: remove this after confirming grub-efi works
;; (use-modules
;; ((gnu packages bootloaders) #:select(make-u-boot-package))
;; ((gnu packages tls) #:select(openssl))
;; ((gnu packages algebra) #:select(bc)))
;; (define TURRIS_SELF_DECLARED_ARCHITECTURE "arm-linux-muslgnueabi")
;; (define WORKING_ARCHITECTURE "arm-linux-gnueabihf")
;; (define base (make-u-boot-package "turris_omnia" WORKING_ARCHITECTURE))
;; (define omnia-u-boot (package (inherit base) (native-inputs (modify-inputs (package-native-inputs base) (append openssl bc)))))
(define HOSTNAME "omniaguix")
(define DEVICENAME "/dev/mmc0p1")
(define my-system (operating-system
(host-name HOSTNAME)
(timezone "America/Toronto")
(bootloader (bootloader-configuration
(bootloader grub-efi-bootloader)
(targets (list DEVICENAME))))
(file-systems (cons (file-system
(mount-point "/")
(device DEVICENAME)
(type "ext4"))
%base-file-systems))
(services
(cons* (service dhcp-client-service-type)
(service openssh-service-type
(openssh-configuration
(openssh patched-ssh)
(permit-root-login #t)
(allow-empty-passwords? #t)))
%base-services))))
(image
(format 'disk-image)
(operating-system my-system)
(partitions
(list
(partition
(size 'guess)
(label root-label)
(file-system "ext4")
(flags '(boot))
(initializer (gexp initialize-root-partition))))))
;; (list (machine
;; (operating-system my-system)
;; (environment managed-host-environment-type)
;; (configuration (machine-ssh-configuration
;; (host-name HOSTNAME)
;; (system "armhf-linux")
;; (user "alice")
;; (identity "./id_rsa")
;; (port 2222)))))
reply other threads:[~2024-05-04 17:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=d23ca56b-702f-3c33-0190-645704cd09e8@gmail.com \
--to=tadhgmister@gmail.com \
--cc=guix-devel@gnu.org \
/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).