From: Sarthak Shah <shahsarthakw@gmail.com>
To: "Marek Paśnikowski" <marek@marekpasnikowski.pl>
Cc: guix-devel@gnu.org
Subject: Re: Global modification of #:make-flags
Date: Wed, 21 Aug 2024 12:51:39 +0530 [thread overview]
Message-ID: <CADBZEVnmHzU7XzpOYWmJVdN8cTZ+gnjhR2AHfu=wABj3USXcng@mail.gmail.com> (raw)
In-Reply-To: <87h6bel5d0.fsf@marekpasnikowski.pl>
[-- Attachment #1: Type: text/plain, Size: 5402 bytes --]
Hey Marek,
It looks like I need to update the patch as it's failing to apply to
Makefile.am
In the meantime, you could try to apply the one failed hunk in
Makefile.am.rej yourself, that should fix the problem.
Another thing that needs a bit of fixing is that this doesn't work on fresh
Guix repositories, you need to have built Guix once from a repository
before applying the patch. I'll try and fix both of these problems as soon
as I get the time to, but once you've taken care of this it should work
smoothly.
Regards,
Sarthak.
On Wed, Aug 21, 2024, 12:40 Marek Paśnikowski <marek@marekpasnikowski.pl>
wrote:
> Sarthak Shah <shahsarthakw@gmail.com> writes:
>
> > Hey Marek,
> > You might find my work on Parameterized Packages interesting:
> >
> >
> https://blog.lispy.tech/parameterized-packages-the-project-completion-update.html
> >
> > Unfortunately, it hasn't been merged into the main branch yet, however
> you should be able to make everything use -Os with the
> > patch.
> >
>
> Thank you.
>
> I have read the blog post and the linked second update and I am not sure
> how should I use it to apply CFLAGS to all the system packages.
>
> I really would like to give it a try on my system, but I am
> struggling with the patch application. I have tried using both a patch
> and a snippet fields of an origin record, with no success.
>
> On the snippet way I have no idea how to transform the (local-file)
> object representing the patch file into a string to be part of (invoke
> "patch").
>
> On the patch way, the build process fails with the following error log:
> ...
> `File Makefile.am is read-only; trying to patch anyway
> patching file Makefile.am
> Hunk #1 FAILED at 17.
> Hunk #2 succeeded at 117 (offset 3 lines).
> 1 out of 2 hunks FAILED -- saving rejects to file Makefile.am.rej
> patching file guix/parameters.scm
> File guix/transformations.scm is read-only; trying to patch anyway
> patching file guix/transformations.scm
> Hunk #1 succeeded at 37 (offset 1 line).
> Hunk #2 succeeded at 356 (offset 1 line).
> Hunk #3 succeeded at 983 (offset 19 lines).
> Hunk #4 succeeded at 1031 (offset 19 lines).
> File guix/ui.scm is read-only; trying to patch anyway
> patching file guix/ui.scm
> Hunk #2 succeeded at 79 (offset 2 lines).
> Hunk #3 succeeded at 1612 (offset 3 lines).
> source is at 'guix-1.4.0-24.9a2ddcc-checkout'
> applying
> '/gnu/store/wld7aagwmygimf6rqllrmgyp97hrz70v-parameterization.patch'...
> Backtrace:
> 5 (primitive-load "/gnu/store/7l0mipjghp0f0k4652axgyyg2vi…")
> In ice-9/eval.scm:
> 619:8 4 (_ #(#(#<directory (guile-user) 7ffff77f7c80> "gui…") #))
> In ice-9/boot-9.scm:
> 142:2 3 (dynamic-wind #<procedure 7ffff5472520 at ice-9/eval.s…> …)
> In ice-9/eval.scm:
> 619:8 2 (_ #(#(#<directory (guile-user) 7ffff77f7c80>)))
> In srfi/srfi-1.scm:
> 634:9 1 (for-each #<procedure apply-patch (a)> ("/gnu/store/wl…"))
> In guix/build/utils.scm:
> 812:6 0 (invoke "/gnu/store/210yfax18r2g2inxrml9435ikhfcca6m-p…" …)
>
> guix/build/utils.scm:812:6: In procedure invoke:
> ERROR:
> 1. &invoke-error:
> program:
> "/gnu/store/210yfax18r2g2inxrml9435ikhfcca6m-patch-2.7.6/bin/patch"
> arguments: ("--force" "--no-backup-if-mismatch" "-p1" "--input"
> "/gnu/store/wld7aagwmygimf6rqllrmgyp97hrz70v-parameterization.patch")
> exit-status: 1
> term-signal: #f
> stop-signal: #f
> ...
>
> Here is the code I used to attempt the patch, excluding module imports:
>
> (define local-files
> '(find-files "."))
>
> (define guix-source
> (package-source guix))
>
> ;;;
>
> (define make-files-writable
> `(for-each make-file-writable
> ,local-files))
>
> (define guix-origin-patches
> (origin-patches guix-source))
>
> (define guix-parameters-patches
> (list "suweren/parameterization.patch"))
>
> (define patch-guix
> '(invoke "patch"
> "--force"
> "--no-backup-if-mismatch"
> "-p1"
> "--input"
> "suweren/parameterization.patch"))
>
> ;;;
>
> (define guix-parameters-origin-snippet
> `(begin ,make-files-writable
> ,patch-guix
> #t))
>
> (define guix-parameters-origin-snippet-modules
> '((guix build utils)))
>
> (define guix-parameters-all-patches
> (append guix-origin-patches
> guix-parameters-patches))
>
> ;;;
>
> (define guix-parameters-origin
> (origin (inherit guix-source)
> (sha256 (base32
> "0823vl88gbgqadc20in9qvxnrd7zhnq047bfvw4gvdsmgxpcpvpx"))
> (patches guix-parameters-all-patches)
> ;; (snippet guix-parameters-origin-snippet)
> ;; (modules guix-parameters-origin-snippet-modules)
> ))
>
> ;;;
>
> (define guix-extra-options
> (list "--gc-keep-derivations=yes"
> "--gc-keep-outputs=yes"))
>
> (define guix-parameters
> (package (inherit guix)
> (source guix-parameters-origin)))
>
> ;;;
>
> ;; This function is part of a modify-services clause,
> ;; and it inherits the default guix configuration.
> (define (guix-options configuration-record)
> (guix-configuration (inherit configuration-record)
> (guix guix-parameters)
> (extra-options guix-extra-options)))
>
>
[-- Attachment #2: Type: text/html, Size: 6671 bytes --]
next prev parent reply other threads:[~2024-08-21 7:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 10:04 Global modification of #:make-flags Marek Paśnikowski
2024-08-20 10:29 ` Sarthak Shah
2024-08-20 13:13 ` Suhail Singh
2024-08-20 23:42 ` Sarthak Shah
2024-08-21 6:54 ` Suhail Singh
2024-08-21 7:27 ` Sarthak Shah
2024-08-21 14:37 ` Suhail Singh
2024-08-22 16:14 ` Sergio Pastor Pérez
2024-08-23 9:01 ` Sarthak Shah
2024-08-21 7:09 ` Marek Paśnikowski
2024-08-21 7:21 ` Sarthak Shah [this message]
2024-08-21 7:34 ` Marek Paśnikowski
2024-08-21 7:45 ` Sarthak Shah
2024-08-21 8:42 ` Marek Paśnikowski
2024-08-21 21:00 ` Ludovic Courtès
2024-09-06 16:27 ` Marek Paśnikowski
2024-08-22 16:35 ` Sergio Pastor Pérez
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='CADBZEVnmHzU7XzpOYWmJVdN8cTZ+gnjhR2AHfu=wABj3USXcng@mail.gmail.com' \
--to=shahsarthakw@gmail.com \
--cc=guix-devel@gnu.org \
--cc=marek@marekpasnikowski.pl \
/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).