all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lukasz Olszewski <dev@lukaszolszewski.info>
To: 58033@debbugs.gnu.org
Subject: bug#58033: A bug in file-dynamic-info used by validate-runpath in gnu-build-system and others.
Date: Sat, 24 Sep 2022 14:04:24 +0200	[thread overview]
Message-ID: <CACwB4R55cx=zihrqpLTGpDWpe6WAMimC1UJdmxPqfVZ5n_A=QQ@mail.gmail.com> (raw)
In-Reply-To: <CACwB4R6CtBF2SaN01BtM2k=gi+FEeQd0Q8bufdXqren_KPLXeg@mail.gmail.com>

Also, to ensure all the information is provided. This is the code that
resulted in the binary header being transformed:

(add-after 'install 'fix-issue-with-libs
  (lambda* (#:key inputs outputs #:allow-other-keys)
    (chdir "..")
    (use-modules (ice-9 ftw)
(ice-9 regex)
(ice-9 rdelim)
(ice-9 popen)
(ice-9 textual-ports))
    (let* ((libdir (string-append #$output "/lib")))
      ;; ------------------------------
      ;; patchelf
      (define (get-rpaths file)
(format #t "Getting rpaths from ~a ...~%" file)
(let* ((port (open-input-pipe (string-append "patchelf --print-rpath " file)))
       (str  (read-line port))) ; from (ice-9 rdelim)
  (close-pipe port)
  str))
      (define (patch-elf file)
      (format #t "Patching ~a ...~%" file)
(define rpath (string-append (get-rpaths file) ":" #$extra-libs "/lib"))
(display (string-append "We're setting rpath:" rpath))
(invoke "patchelf" "--set-rpath" rpath file))
      (for-each (lambda (file)
  (when (elf-file? file)
    (patch-elf file)))
(find-files #$output  ".*")))))

I can run the patch-elf procedure in repl and it runs fine, but being
run during the build it results in the problematic elf header. The
build was run twice with the same result both times.

Regards,
Lukasz




  reply	other threads:[~2022-09-25  7:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23 22:28 bug#58033: A bug in file-dynamic-info used by validate-runpath in gnu-build-system and others Lukasz Olszewski
2022-09-24 11:23 ` Lukasz Olszewski
2022-09-24 12:04   ` Lukasz Olszewski [this message]
2022-09-24 17:01 ` Lukasz Olszewski
2022-09-24 21:37   ` Lukasz Olszewski
2022-09-25 11:27 ` Lukasz Olszewski
2022-10-07  8:31   ` Ludovic Courtès
2023-02-11 19:43 ` bug#58033: PatchELF can create broken ELF binaries Maxime Devos

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

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

  git send-email \
    --in-reply-to='CACwB4R55cx=zihrqpLTGpDWpe6WAMimC1UJdmxPqfVZ5n_A=QQ@mail.gmail.com' \
    --to=dev@lukaszolszewski.info \
    --cc=58033@debbugs.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.