From: ludo@gnu.org (Ludovic Courtès)
To: Peter Mikkelsen <petermikkelsen10@gmail.com>
Cc: 28444@debbugs.gnu.org
Subject: [bug#28444] [PATCH 3/3] build-system: Add 'meson-build-system'.
Date: Fri, 15 Sep 2017 23:07:39 +0200 [thread overview]
Message-ID: <87a81vllgk.fsf@gnu.org> (raw)
In-Reply-To: <20170913125003.13313-3-petermikkelsen10@gmail.com> (Peter Mikkelsen's message of "Wed, 13 Sep 2017 14:50:03 +0200")
Peter Mikkelsen <petermikkelsen10@gmail.com> skribis:
> * Makefile.am (MODULES): Add 'guix/build-system/meson.scm' and
> 'guix/build/meson-build-system.scm'.
> * guix/build-system/meson.scm: New file.
> * guix/build/meson-build-system.scm: New file.
> * doc/guix.texi (Build Systems): Add 'meson-build-system'.
Overall LGTM! I have minor questions and comments:
> +(define* (configure #:key outputs configure-flags build-type
> + #:allow-other-keys)
> + "Configure the given package"
Make sure to add a period at the end of sentences. :-)
> +(define* (fix-runpath #:key elf-directories outputs
> + #:allow-other-keys)
ELF-DIRECTORIES should default to a list, probably the empty list (here
it defaults to #f, which cannot work.)
> + "Try to make sure all ELF files in ELF-DIRECTORIES are able to find their
> +local dependencies in their RUNPATH. Also shrink the RUNPATH to what is needed,
> +since alot of directories are left over from meson."
“a lot”
According to this description, half of it corresponds to the
‘validate-runpath’ phase, no?
The second half is the shrink-RUNPATH thing, but can you clarify why it
is needed? Which directories in RUNPATH are “left over from meson”?
> + (define (find-deps dep-name elf-files)
> + "Find the directories (if any) that contains DEP-NAME. The directories
> +searched are the ones that ELF-FILES are in."
> + (let* ((matches (filter (lambda (file)
> + (string=? dep-name (basename file)))
> + elf-files)))
> + (map dirname matches)))
Avoid local variable ‘matches’, to keep it concise. Also, for inner
‘define’s, use a comment instead of a docstring (the docstring would be
inaccessible.)
> + (define (file-needed file)
> + "Return a list of libraries that FILE needs."
> + (let* ((elf (call-with-input-file file
> + (compose parse-elf get-bytevector-all)))
> + (dyninfo (elf-dynamic-info elf)))
> + (if dyninfo
> + (elf-dynamic-info-needed dyninfo)
> + '())))
> +
> + (define (handle-file file elf-files)
> + "If FILE needs any libs that are part of ELF-FILES, the RUNPATH
> +is modified accordingly."
> + (let* ((dep-dirs (apply append (map (lambda (dep-name)
> + (find-deps dep-name elf-files))
> + (file-needed file)))))
> + (unless (null? dep-dirs)
> + (augment-rpath file (string-join dep-dirs ":")))))
> +
> + (define handle-output
> + (match-lambda
> + (elf-list (apply append (map (lambda (dir)
> + (find-files dir elf-pred))
> + excisting-elf-dirs))))
(apply append lstlst) = (concatenate lstlst)
That’s it! Could you comment and send an updated patch?
Thanks for working on it, looks like it’s going to be useful very soon!
Ludo’.
next prev parent reply other threads:[~2017-09-15 21:08 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-13 12:48 [bug#28444] [PATCH 0/3] Add meson-build-system Peter Mikkelsen
2017-09-13 12:50 ` [bug#28444] [PATCH 1/3] gnu: meson: Update to 0.42.0 Peter Mikkelsen
2017-09-13 12:50 ` [bug#28444] [PATCH 2/3] gnu: Add meson-for-build Peter Mikkelsen
2017-09-15 20:57 ` Ludovic Courtès
2017-09-15 21:00 ` Peter Mikkelsen
2017-09-13 12:50 ` [bug#28444] [PATCH 3/3] build-system: Add 'meson-build-system' Peter Mikkelsen
2017-09-15 21:07 ` Ludovic Courtès [this message]
2017-09-16 11:08 ` Peter Mikkelsen
2017-09-16 16:11 ` bug#28444: " Ludovic Courtès
2017-09-16 17:06 ` [bug#28444] " Peter Mikkelsen
2017-09-17 13:19 ` Ludovic Courtès
2017-09-17 13:24 ` Peter Mikkelsen
2017-09-17 14:01 ` Peter Mikkelsen
2017-09-17 19:21 ` Ludovic Courtès
2017-09-15 20:53 ` [bug#28444] [PATCH 1/3] gnu: meson: Update to 0.42.0 Ludovic Courtès
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=87a81vllgk.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=28444@debbugs.gnu.org \
--cc=petermikkelsen10@gmail.com \
/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).