unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Jan Nieuwenhuizen <janneke@gnu.org>
To: Mark H Weaver <mhw@netris.org>
Cc: 36747@debbugs.gnu.org
Subject: bug#36747: Official MesCC bootstrap binaries differ from my locally built ones
Date: Sun, 21 Jul 2019 15:34:10 +0200	[thread overview]
Message-ID: <87ef2j1pgt.fsf@gnu.org> (raw)
In-Reply-To: <875znwcoo9.fsf@netris.org> (Mark H. Weaver's message of "Sat, 20 Jul 2019 18:43:07 -0400")

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

Mark H Weaver writes:

> I'm working to independently verify the new bootstrap binaries.  Toward
> that end, I locally built the new bootstrap tarballs by running the
> following command from a git checkout at commit
> ef809e3ac036eccc5f9c9edd8fb661d14ae15f2f.
>
>   ./pre-inst-env guix build bootstrap-tarballs --system=i686-linux
>
> This produces a mescc-tools-static-0.5.2-0.bb062b0-i686-linux.tar.xz
> tarball that differs from the official one.  See below for the precise
> differences, but what they boil down to is that the official tarball
> contains several references to:
>
>   /gnu/store/xjr9rv1p4vgg9sclwzsai17gqi1c1d9j-glibc-2.28
>
> Whereas in my locally built tarball, these references are instead to:
>
>   /gnu/store/ggj9164ahhn1kmdcyl3sm27qsxk46h01-glibc-2.28

Aww, that's not good :(

> First of all, I hope we can agree that our bootstrap binaries shouldn't
> include any references to the store.

I think that is our policy and it is probably safest not to do so; at
least in code.  A piece of documentation can include a string
/gnu/store/.... as long at it is static and not really a reference.

Store references in bootstrap binaries or scripts cannot be used or
depended on: if our bootstrap build is clean those references will not
exist when the bootstrap binaries run.

In any case, if store references are present in bootstrap binaries, then
they should be reproducible.  Removing store references is one way to
make them reproducible but I'm not sure if that's the best way?

Making a reference invalid helps making sure that it isn't used.  But if
it cannot be used anyway, removing it could hide the fact that it may
differs accros builds, as we are finding out right now.  Thoughts?

> However, it also raises the curious question of how I ended up with
> references to a different glibc than the one referenced by the official
> tarball.  Any idea what happened here?

Yes, that's something that I would like to know...

Anyway, I have built a new set of bootstrap binaries for mescc-tools and
mes using attched patches that remove store references (also on my
https://gitlab.com/janneke/guix core-updates).

I have just verified that tcc-boot0 builds by using this local
modification

--8<---------------cut here---------------start------------->8---
15:05:56 janneke@dundal:~/src/guix/core-updates [env]
$ git diff
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 73fc7d3e5e..bca90bec94 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -288,7 +288,8 @@ or false to signal an error."
 
 (define %bootstrap-base-urls
   ;; This is where the initial binaries come from.
-  '("https://alpha.gnu.org/gnu/guix/bootstrap"
+  '("http://lilypond.org/janneke/guix"
+    "https://alpha.gnu.org/gnu/guix/bootstrap"
     "http://alpha.gnu.org/gnu/guix/bootstrap"
     "ftp://alpha.gnu.org/gnu/guix/bootstrap"
     "http://www.fdn.fr/~lcourtes/software/guix/packages"
--8<---------------cut here---------------end--------------->8---

and running
 
    ./pre-inst-env guix build --system=i686-linux -e '(@@ (gnu packages commencement) tcc-boot0)'

Thanks again for looking into this!

Greetings,
janneke


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-bootstrap-mescc-tools-static-stripped-Remove-store-r.patch --]
[-- Type: text/x-patch, Size: 2658 bytes --]

From 11c12e30bbdb1a10fd56dc9d5c14548e49b63c12 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 21 Jul 2019 11:40:54 +0200
Subject: [PATCH 1/4] bootstrap: mescc-tools-static-stripped: Remove store
 references.

* gnu/packages/make-bootstrap.scm (%mescc-tools-static-stripped): Rename from
%mescc-tools-static; update users.  Remove store references.
---
 gnu/packages/make-bootstrap.scm | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 2163b646f6..8cc4eef430 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -585,16 +585,27 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
            #t))))
     (inputs `(("gcc" ,%gcc-static)))))
 
-(define %mescc-tools-static
-  ;; A statically linked MesCC Tools for bootstrap.
+(define %mescc-tools-static-stripped
+  ;; A statically linked Mescc Tools with store references removed, for
+  ;; bootstrap.
   (package
     (inherit mescc-tools)
-    (name "mescc-tools-static")
+    (name "mescc-tools-static-stripped")
     (arguments
-     `(#:system "i686-linux"
-       ,@(substitute-keyword-arguments (package-arguments mescc-tools)
-           ((#:make-flags flags)
-            `(cons "CC=gcc -static" ,flags)))))))
+     `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+                          "CC=gcc -static")
+       #:test-target "test"
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (add-after 'install 'strip-store-references
+                    (lambda _
+                      (let* ((out (assoc-ref %outputs "out"))
+                             (bin (string-append out "/bin")))
+                        (for-each (lambda (file)
+                                 (let ((target (string-append bin "/" file)))
+                                   (format #t "strippingg `~a'...~%" target)
+                                   (remove-store-references target)))
+                               '( "M1" "blood-elf" "hex2"))))))))))
 
 (define-public %mes-minimal-stripped
   ;; A minimal Mes without documentation dependencies, for bootstrap.
@@ -791,7 +802,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
 
 (define %mescc-tools-bootstrap-tarball
   ;; A tarball with MesCC binary seed.
-  (tarball-package %mescc-tools-static))
+  (tarball-package %mescc-tools-static-stripped))
 
 (define %mes-bootstrap-tarball
   ;; A tarball with Mes ASCII Seed and binary Mes C Library.
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-bootstrap-mes-minimal-stripped-Remove-store-referenc.patch --]
[-- Type: text/x-patch, Size: 2040 bytes --]

From 2e13b6fff94027158b3de5d3a1469dc9f89b0c39 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 21 Jul 2019 14:27:07 +0200
Subject: [PATCH 2/4] bootstrap: mes-minimal-stripped: Remove store references.

* gnu/packages/make-bootstrap.scm (%mes-minimal-stripped): Remove store
references.
---
 gnu/packages/make-bootstrap.scm | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 8cc4eef430..af89ca8c3c 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -621,6 +621,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
          #:configure-flags '("--mes")
          #:phases
          (modify-phases %standard-phases
+           (delete 'patch-shebangs)
            (add-after 'install 'strip-install
              (lambda _
                (let* ((out (assoc-ref %outputs "out"))
@@ -628,10 +629,16 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                  (delete-file-recursively (string-append out "/lib/guile"))
                  (delete-file-recursively (string-append share "/guile"))
                  (delete-file-recursively (string-append share "/mes/scaffold"))
-                 (for-each
-                  delete-file
-                  (find-files (string-append share  "/mes/lib")
-                              "\\.(h|c)")))))))))))
+
+                 (for-each delete-file
+                           (find-files
+                            (string-append share "/mes/lib") "\\.(h|c)"))
+
+                 (for-each (lambda (dir)
+                             (for-each remove-store-references
+                                       (find-files (string-append out "/" dir)
+                                                   ".*")))
+                           '("bin" "share/mes")))))))))))
 
 (define %guile-static
   ;; A statically-linked Guile that is relocatable--i.e., it can search
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-bootstrap-bootstrap-mescc-tools-Update.patch --]
[-- Type: text/x-patch, Size: 1704 bytes --]

From 172ee1045689cd42d2de837ee560d32c43730cc3 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 21 Jul 2019 14:38:52 +0200
Subject: [PATCH 3/4] bootstrap: bootstrap-mescc-tools: Update.

    Built with
        2e13b6fff94027158b3de5d3a1469dc9f89b0c39 bootstrap: mes-minimal-stripped: Remove store references.

    * gnu/packages/bootstrap.scm (%bootstrap-mescc-tools): Update.
---
 gnu/packages/bootstrap.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 8dbe52435e..a8a5c93e01 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -703,7 +703,7 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
   ;; %MESCC-TOOLS-BOOTSTRAP-TARBALL.
   (package
     (name "bootstrap-mescc-tools")
-    (version "0.5.2")
+    (version "1")
     (source #f)
     (build-system trivial-build-system)
     (arguments
@@ -735,12 +735,12 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
             (method url-fetch)
             (uri (map
                   (cute string-append <>
-                        "/i686-linux/20181020/"
-                        "mescc-tools-static-0.5.2-0.bb062b0-i686-linux.tar.xz")
+                        "/i686-linux/20190721/"
+                        "mescc-tools-static-stripped-0.5.2-0.bb062b0-i686-linux.tar.xz")
                   %bootstrap-base-urls))
             (sha256
              (base32
-              "11lniw0vg61kmyhvnwkmcnkci9ym6hbmiksiqggd0hkipbq7hvlz")))))))
+              "0h7sbc5im74gxjx3xybqavq7hacbg7gcl4sznc1mpw67yja49f75")))))))
     (synopsis "Bootstrap binaries of MesCC Tools")
     (description synopsis)
     (home-page #f)
-- 
2.21.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-bootstrap-bootstrap-mes-Update.patch --]
[-- Type: text/x-patch, Size: 1591 bytes --]

From e316146f23dce4156fc8c5b3b28cd5e180487cda Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sun, 21 Jul 2019 14:42:35 +0200
Subject: [PATCH 4/4] bootstrap: bootstrap-mes: Update.

    Built with
        2e13b6fff94027158b3de5d3a1469dc9f89b0c39 bootstrap: mes-minimal-stripped: Remove store references.

* gnu/packages/bootstrap.scm (%bootstrap-mes): Update.
---
 gnu/packages/bootstrap.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index a8a5c93e01..73fc7d3e5e 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -752,7 +752,7 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
   ;; %MES-BOOTSTRAP-TARBALL.
   (package
     (name "bootstrap-mes")
-    (version "0")
+    (version "1")
     (source #f)
     (build-system trivial-build-system)
     (arguments
@@ -784,12 +784,12 @@ exec ~a/bin/.gcc-wrapped -B~a/lib \
             (method url-fetch)
             (uri (map
                   (cute string-append <>
-                        "/i686-linux/20181020/"
+                        "/i686-linux/20190721/"
                         "mes-minimal-stripped-0.19-i686-linux.tar.xz")
                   %bootstrap-base-urls))
             (sha256
              (base32
-              "0k7kkl68a6xaadv47ij0nr9jm5ca1ffj38n7f2lg80y72wdkwr9h")))))))
+              "0c8j9p84vx4w8fz6bkxf57wsarq3ng1ka09h18lv3lfxxvnpiak6")))))))
     (supported-systems '("i686-linux" "x86_64-linux"))
     (synopsis "Bootstrap binaries of Mes")
     (description synopsis)
-- 
2.21.0


[-- Attachment #6: Type: text/plain, Size: 152 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com

  reply	other threads:[~2019-07-21 13:35 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-20 22:43 bug#36747: Official MesCC bootstrap binaries differ from my locally built ones Mark H Weaver
2019-07-21 13:34 ` Jan Nieuwenhuizen [this message]
2019-07-22  0:56   ` Mark H Weaver
2019-07-22  6:18     ` Jan Nieuwenhuizen
2019-07-22  6:26       ` Jan Nieuwenhuizen
2019-07-22  8:26       ` Jan Nieuwenhuizen
2019-07-22  8:31       ` Mark H Weaver
2019-07-22 17:41         ` Jan Nieuwenhuizen
2019-07-23  5:42           ` Mark H Weaver
2019-07-23  6:28             ` Jan Nieuwenhuizen
2019-08-12  0:21               ` Mark H Weaver
2019-08-12  4:11                 ` Mark H Weaver
2019-07-23 10:03             ` Ludovic Courtès
2019-08-12  7:08               ` Mark H Weaver
2019-08-12  9:01                 ` Jan Nieuwenhuizen
2019-08-13  6:42                   ` Mark H Weaver
2019-08-13 10:17                     ` Jan Nieuwenhuizen
2019-08-14 15:03                       ` Marius Bakke
2019-08-14 17:29                         ` Marius Bakke
2019-08-14 18:35                           ` Mark H Weaver
2019-08-14 18:43                             ` Mark H Weaver
2019-08-14 19:56                             ` Marius Bakke
2019-08-14 20:43                               ` Mark H Weaver
2019-08-15 19:44                               ` Mark H Weaver
2019-08-15 21:19                                 ` Marius Bakke
2019-08-15 23:16                                   ` Mark H Weaver
2019-08-15 20:56                               ` Mark H Weaver
2019-08-16  7:42                                 ` Mark H Weaver
2019-08-17 16:49                                   ` Mark H Weaver
2019-08-16 10:49                               ` Ludovic Courtès
2019-08-16 16:59                                 ` Mark H Weaver
2019-08-17 21:38                                   ` Ludovic Courtès
2019-08-18  1:17                                     ` Mark H Weaver
2019-08-18  9:26                                       ` Ludovic Courtès
2019-08-20 18:40                                         ` Mark H Weaver
2019-08-21 20:15                                           ` Mark H Weaver
2019-08-21 21:38                                   ` Ludovic Courtès
2019-08-21 22:57                                     ` Mark H Weaver
2019-08-22 10:09                                       ` Ludovic Courtès
2019-08-24 13:31                               ` Ludovic Courtès
2019-08-24 20:34                                 ` Mark H Weaver
2019-08-26  8:25                                   ` Ludovic Courtès
2019-08-26 18:36                                     ` Mark H Weaver
2019-08-27  9:38                                       ` Ludovic Courtès
2019-08-29 22:28                                         ` Bengt Richter
2019-08-27  3:58                                     ` Mark H Weaver
2019-08-27  9:40                                       ` Ludovic Courtès
2019-08-27 14:27                                         ` Mark H Weaver
2019-08-27 16:04                                           ` Ludovic Courtès
2019-08-27 16:46                                             ` Mark H Weaver
2019-08-28  0:55                                               ` Mark H Weaver
2019-08-28 22:12                                                 ` Ludovic Courtès
2019-08-29  5:46                                                   ` Ricardo Wurmus
2019-08-29  6:32                                                     ` Ricardo Wurmus
2019-08-29 19:28                                                   ` Mark H Weaver
2019-08-29 23:23                                                     ` Ludovic Courtès
2019-08-30 19:52                                                       ` Mark H Weaver
2019-08-31 12:44                                                         ` 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=87ef2j1pgt.fsf@gnu.org \
    --to=janneke@gnu.org \
    --cc=36747@debbugs.gnu.org \
    --cc=mhw@netris.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).